00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef ARACTIONGOTO_H
00028 #define ARACTIONGOTO_H
00029
00030 #include "ariaTypedefs.h"
00031 #include "ariaUtil.h"
00032 #include "ArAction.h"
00033
00035
00052 class ArActionGoto : public ArAction
00053 {
00054 public:
00055 ArActionGoto(const char *name = "goto",
00056 ArPose goal = ArPose(0.0, 0.0, 0.0),
00057 double closeDist = 100, double speed = 400,
00058 double speedToTurnAt = 150, double turnAmount = 7);
00059 virtual ~ArActionGoto();
00060
00064 bool haveAchievedGoal(void);
00065
00067 void cancelGoal(void);
00068
00070 void setGoal(ArPose goal);
00071
00073 ArPose getGoal(void) { return myGoal; }
00074
00076 void setCloseDist(double closeDist) { myCloseDist = closeDist; }
00078 double getCloseDist(void) { return myCloseDist; }
00080 void setSpeed(double speed) { mySpeed = speed; }
00082 double getSpeed(void) { return mySpeed; }
00083
00086 virtual ArActionDesired *fire(ArActionDesired currentDesired);
00087
00089 virtual ArActionDesired *getDesired(void) { return &myDesired; }
00090 protected:
00091 ArPose myGoal;
00092 double myCloseDist;
00093 double mySpeed;
00094 double mySpeedToTurnAt;
00095 double myDirectionToTurn;
00096 double myCurTurnDir;
00097 double myTurnAmount;
00098 ArActionDesired myDesired;
00099 bool myTurnedBack;
00100 bool myPrinting;
00101 ArPose myOldGoal;
00102
00103 enum State
00104 {
00105 STATE_NO_GOAL,
00106 STATE_ACHIEVED_GOAL,
00107 STATE_GOING_TO_GOAL
00108 };
00109 State myState;
00110 };
00111
00112 #endif // ARACTIONGOTO