#include <ArActionGoto.h>
Inheritance diagram for ArActionGoto:
This action naively drives straight towards a given ArPose. the action stops when it gets to be a certain distance (closeDist) from the goal pose. It travels at the given speed (mm/sec).
You can give it a new goal with setGoal(), clear the current goal with cancelGoal(), and see if it got there with haveAchievedGoal(). Once the goal is reached, this action stops requesting any action.
This doesn't avoid obstacles or anything, you could have an avoid routine at a higher priority to avoid on the way there... but for real and intelligent looking navigation you should use something like ARNL, or build on these actions.
Public Member Functions | |
ArActionGoto (const char *name="goto", ArPose goal=ArPose(0.0, 0.0, 0.0), double closeDist=100, double speed=400, double speedToTurnAt=150, double turnAmount=7) | |
void | cancelGoal (void) |
virtual ArActionDesired * | fire (ArActionDesired currentDesired) |
double | getCloseDist (void) |
Gets the distance which is close enough to the goal (mm). | |
virtual const ArActionDesired * | getDesired (void) const |
virtual ArActionDesired * | getDesired (void) |
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) |
void | setCloseDist (double closeDist) |
Set the distance which is close enough to the goal (mm);. | |
void | setGoal (ArPose goal) |
Sets a new goal and sets the action to go there. | |
void | setSpeed (double speed) |
Sets the speed the action will travel to the goal at (mm/sec). | |
Protected Types | |
enum | State { STATE_NO_GOAL, STATE_ACHIEVED_GOAL, STATE_GOING_TO_GOAL } |
Protected Attributes | |
double | myCloseDist |
double | myCurTurnDir |
ArActionDesired | myDesired |
double | myDirectionToTurn |
ArPose | myGoal |
ArPose | myOldGoal |
bool | myPrinting |
double | mySpeed |
double | mySpeedToTurnAt |
State | myState |
double | myTurnAmount |
bool | myTurnedBack |
|
Cancels the goal; this action will stop requesting movement. However, any currently requested motion (either previously requested by this action or by another action) will continue to be used. Use an ArActionStop action (activate it, or set it at a lower priority) to stop the robot. |
|
Called by the action resover; request movement towards goal if we have one.
Implements ArAction. |
|
Used by the action resolvel; return current desired action. Reimplemented from ArAction. |
|
Sees if the goal has been achieved. The goal is achieved when the robot's repordet position is within a certain distance (given in the constructor or in setCloseDist) from the goal pose. |