#include <ArActionGoto.h>
Inheritance diagram for ArActionGoto:
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) |
Cancels the goal; this action will stop requesting movement. | |
virtual ArActionDesired * | fire (ArActionDesired currentDesired) |
double | getCloseDist (void) |
Gets the distance which is close enough to the goal (mm). | |
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 |
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(), cancel its movement 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.
Definition at line 52 of file ArActionGoto.h.
|
Called by the action resover; request movement towards goal if we have one. Implements ArAction. Definition at line 89 of file ArActionGoto.cpp. References ArPose::findAngleTo(), ArPose::findDistanceTo(), ArActionDesired::getMaxVel(), ArActionDesired::getMaxVelStrength(), ArRobot::getPose(), ArRobot::getTh(), ArActionDesired::setDeltaHeading(), setGoal(), ArActionDesired::setHeading(), and ArActionDesired::setVel(). |
|
Used by the action resolvel; return current desired action. Reimplemented from ArAction. Definition at line 89 of file ArActionGoto.h. |
|
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. Definition at line 67 of file ArActionGoto.cpp. |