Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages | Examples

ArActionGotoStraight Class Reference

#include <ArActionGotoStraight.h>

Inheritance diagram for ArActionGotoStraight:

ArAction List of all members.

Detailed Description

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.)


Public Member Functions

 ArActionGotoStraight (const char *name="goto", double speed=400)
void cancelGoal (void)
 Cancels the goal the robot has.
virtual ArActionDesiredfire (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 const ArActionDesiredgetDesired (void) const
virtual ArActionDesiredgetDesired (void)
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.

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


The documentation for this class was generated from the following files:
Generated on Thu Jan 7 10:34:40 2010 for Aria by  doxygen 1.4.2