Aria
2.8.0
|
This action goes to a given ArPose very naively. More...
#include <ArActionGotoStraight.h>
Inherits ArAction.
Public Member Functions | |
ArActionGotoStraight (const char *name="goto", double speed=400) | |
void | cancelGoal (void) |
Cancels the goal the robot has. | |
virtual ArActionDesired * | fire (ArActionDesired currentDesired) |
bool | getBacking (void) |
Sets whether we're backing up there or not (set in the setGoals) | |
double | getCloseDist (void) |
Gets how close we have to get if we're not in just distance mode. | |
virtual ArActionDesired * | getDesired (void) |
virtual const ArActionDesired * | getDesired (void) const |
ArPose | getEncoderGoal (void) |
Gets the goal the action has. | |
ArPose | getGoal (void) |
Gets the goal the action has. | |
double | getSpeed (void) |
Gets the speed the action will travel to the goal at (mm/sec) | |
bool | haveAchievedGoal (void) |
Sees if the goal has been achieved. | |
void | setCloseDist (double closeDist=100) |
Sets how close we have to get if we're not in just distance mode. | |
void | setEncoderGoal (ArPose encoderGoal, bool backwards=false, bool justDistance=true) |
Sets a new goal and sets the action to go there. | |
void | setEncoderGoalRel (double dist, double deltaHeading, bool backwards=false, bool justDistance=true) |
Sets the goal in a relative way. | |
void | setGoal (ArPose goal, bool backwards=false, bool justDistance=true) |
Sets a new goal and sets the action to go there. | |
void | setGoalRel (double dist, double deltaHeading, bool backwards=false, bool justDistance=true) |
Sets the goal in a relative way. | |
void | setSpeed (double speed) |
Sets the speed the action will travel to the goal at (mm/sec) | |
bool | usingEncoderGoal (void) |
Gets whether we're using the encoder goal or the normal goal. | |
Public Member Functions inherited from ArAction | |
virtual void | activate (void) |
Activate the action. | |
ArAction (const char *name, const char *description="") | |
Constructor. | |
virtual void | deactivate (void) |
Deactivate the action. | |
virtual const ArArg * | getArg (int number) const |
Gets the numbered argument. More... | |
virtual ArArg * | getArg (int number) |
Gets the numbered argument. | |
virtual const char * | getDescription (void) const |
Gets the long description of the action. | |
virtual const char * | getName (void) const |
Gets the name of the action. | |
virtual int | getNumArgs (void) const |
Find the number of arguments this action takes. | |
ArRobot * | getRobot () const |
Get the robot we are controlling, which was set by setRobot() | |
virtual bool | isActive (void) const |
Returns whether the action is active or not. | |
virtual void | log (bool verbose=true) const |
Log information about this action using ArLog. | |
virtual void | setRobot (ArRobot *robot) |
Sets the robot this action is driving. More... | |
virtual | ~ArAction () |
Desructor. | |
Protected Types | |
enum | State { STATE_NO_GOAL, STATE_ACHIEVED_GOAL, STATE_GOING_TO_GOAL } |
Protected Attributes | |
bool | myBacking |
double | myCloseDist |
ArActionDesired | myDesired |
double | myDist |
double | myDistTravelled |
ArPose | myEncoderGoal |
ArPose | myGoal |
bool | myJustDist |
ArPose | myLastPose |
bool | myPrinting |
double | mySpeed |
State | myState |
bool | myUseEncoderGoal |
Protected Attributes inherited from ArAction | |
std::map< int, ArArg > | myArgumentMap |
std::string | myDescription |
bool | myIsActive |
std::string | myName |
int | myNumArgs |
ArRobot * | myRobot |
The robot we are controlling, set by the action resolver using setRobot() | |
Additional Inherited Members | |
Static Public Member Functions inherited from ArAction | |
static bool | getDefaultActivationState (void) |
Gets the default activation state for all ArActions. | |
static void | setDefaultActivationState (bool defaultActivationState) |
Sets the default activation state for all ArActions. | |
Protected Member Functions inherited from ArAction | |
void | setNextArgument (ArArg const &arg) |
Sets the argument type for the next argument (must only be used in a constructor!) | |
Static Protected Attributes inherited from ArAction | |
static bool | ourDefaultActivationState = true |
This action goes to a given ArPose very naively.
This action naively drives straight towards a given ArPose. The action stops the robot when it has travelled the distance that that pose is away. It travels at 'speed' mm/sec.
You can give it a new goal pose with setGoal(), cancel its movement with cancelGoal(), and see if it got there with haveAchievedGoal().
For arguments to the goals and encoder goals you can tell it to go backwards by calling them with the backwards parameter true. If you set the justDistance to true it will only really care about having driven the distance, if false it'll try to get to the spot you wanted within close distance.
This doesn't avoid obstacles or anything, you could add have an obstacle avoidance ArAction at a higher priority to try to do this. (For truly intelligent navigation, see the ARNL and SONARNL software libraries.)