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

ArActionGotoStraight Class Reference

This action goes to a given ArPose very naively. More...

#include <ArActionGotoStraight.h>

Inheritance diagram for ArActionGotoStraight:

ArAction List of all members.

Public Member Functions

 ArActionGotoStraight (const char *name="goto", double speed=400)
void cancelGoal (void)
 Cancels the goal the robot has.
virtual ArActionDesiredfire (ArActionDesired currentDesired)
 Fires the action, returning what the action wants to do.
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 ArActionDesiredgetDesired (void)
 Gets what this action wants to do (for display purposes).
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

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 ActivMedia's ARNL software.)

Definition at line 56 of file ArActionGotoStraight.h.


Member Function Documentation

ArActionDesired * ArActionGotoStraight::fire ArActionDesired  currentDesired  )  [virtual]
 

Fires the action, returning what the action wants to do.

Parameters:
currentDesired this is what the current resolver has for its desired, this is SOLELY for the purpose of giving information to the action
Returns:
pointer to what this action wants to do, NULL if it wants to do nothing

Implements ArAction.

Definition at line 118 of file ArActionGotoStraight.cpp.

References ArTransform::doTransform(), ArPose::findAngleTo(), ArPose::findDistanceTo(), ArRobot::getEncoderPose(), ArRobot::getEncoderTransform(), ArRobot::getPose(), ArRobot::getVel(), ArLog::log(), ArActionDesired::setDeltaHeading(), ArActionDesired::setHeading(), ArActionDesired::setVel(), and ArMath::subAngle().


The documentation for this class was generated from the following files:
Generated on Wed Oct 19 12:56:39 2005 for Aria by  doxygen 1.4.0