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

ArActionGoto Class Reference

#include <ArActionGoto.h>

Inheritance diagram for ArActionGoto:

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

Examples:

gotoActionExample.cpp.

Definition at line 51 of file ArActionGoto.h.

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 ArActionDesiredfire (ArActionDesired currentDesired)
double getCloseDist (void)
 Gets the distance which is close enough to the goal (mm).
virtual const ArActionDesiredgetDesired (void) const
virtual ArActionDesiredgetDesired (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


Member Function Documentation

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

Called by the action resover; request movement towards goal if we have one.

Parameters:
currentDesired Current desired action from the resolver

Implements ArAction.

Definition at line 88 of file ArActionGoto.cpp.

virtual ArActionDesired* ArActionGoto::getDesired void   )  [inline, virtual]
 

Used by the action resolvel; return current desired action.

Reimplemented from ArAction.

Definition at line 90 of file ArActionGoto.h.

bool ArActionGoto::haveAchievedGoal void   ) 
 

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 66 of file ArActionGoto.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Feb 20 10:51:42 2007 for Aria by  doxygen 1.4.0