Aria  2.8.0
ArActionStallRecover Class Reference

Action to recover from a stall. More...

#include <ArActionStallRecover.h>

Inherits ArAction.

Public Member Functions

virtual void activate (void)
 
void addToConfig (ArConfig *config, const char *sectionName, ArPriority::Priority priority=ArPriority::NORMAL)
 
 ArActionStallRecover (const char *name="stall recover", double obstacleDistance=225, int cyclesToMove=50, double speed=150, double degreesToTurn=45, bool enabled=true)
 Constructor. More...
 
virtual ArActionDesiredfire (ArActionDesired currentDesired)
 
virtual ArActionDesiredgetDesired (void)
 
virtual const ArActionDesiredgetDesired (void) const
 
virtual ~ArActionStallRecover ()
 Destructor.
 
- Public Member Functions inherited from ArAction
 ArAction (const char *name, const char *description="")
 Constructor.
 
virtual void deactivate (void)
 Deactivate the action.
 
virtual const ArArggetArg (int number) const
 Gets the numbered argument. More...
 
virtual ArArggetArg (int number)
 Gets the numbered argument.
 
virtual const char * getDescription (void) const
 Gets the long description of the action.
 
virtual const char * getName (void) const
 Gets the name of the action.
 
virtual int getNumArgs (void) const
 Find the number of arguments this action takes.
 
ArRobotgetRobot () const
 Get the robot we are controlling, which was set by setRobot()
 
virtual bool isActive (void) const
 Returns whether the action is active or not.
 
virtual void log (bool verbose=true) const
 Log information about this action using ArLog.
 
virtual void setRobot (ArRobot *robot)
 Sets the robot this action is driving. More...
 
virtual ~ArAction ()
 Desructor.
 

Protected Types

enum  State { STATE_NOTHING = 0, STATE_GOING }
 
enum  What {
  BACK =0x1, FORWARD =0x2, TURN =0x4, TURN_LEFT =0x8,
  TURN_RIGHT =0x10, MOVEMASK = BACK | FORWARD, TURNMASK = TURN | TURN_LEFT | TURN_RIGHT
}
 

Protected Member Functions

void addSequence (int sequence)
 
void doit (void)
 
- Protected Member Functions inherited from ArAction
void setNextArgument (ArArg const &arg)
 Sets the argument type for the next argument (must only be used in a constructor!)
 

Protected Attributes

ArActionDesired myActionDesired
 
int myCount
 
int myCyclesToMove
 
int myCyclesToTurn
 
double myDegreesToTurn
 
double myDesiredHeading
 
int myDoing
 
bool myEnabled
 
time_t myLastFired
 
double myObstacleDistance
 
ArResolvermyResolver
 
std::map< int, int > mySequence
 
int mySequenceNum
 
int mySequencePos
 
int mySideStalled
 
double mySpeed
 
int myState
 
- Protected Attributes inherited from ArAction
std::map< int, ArArgmyArgumentMap
 
std::string myDescription
 
bool myIsActive
 
std::string myName
 
int myNumArgs
 
ArRobotmyRobot
 The robot we are controlling, set by the action resolver using setRobot()
 

Additional Inherited Members

- Static Public Member Functions inherited from ArAction
static bool getDefaultActivationState (void)
 Gets the default activation state for all ArActions.
 
static void setDefaultActivationState (bool defaultActivationState)
 Sets the default activation state for all ArActions.
 
- Static Protected Attributes inherited from ArAction
static bool ourDefaultActivationState = true
 

Detailed Description

Action to recover from a stall.

This action tries to recover if one of the wheels has stalled, it has a series of actions it tries in order to get out of the stall.

Examples:
actionExample.cpp, actionGroupExample.cpp, and wander.cpp.

Constructor & Destructor Documentation

◆ ArActionStallRecover()

ArActionStallRecover::ArActionStallRecover ( const char *  name = "stall recover",
double  obstacleDistance = 225,
int  cyclesToMove = 50,
double  speed = 150,
double  degreesToTurn = 45,
bool  enabled = true 
)

Constructor.

Parameters
namename of the action
obstacleDistancedistance at which not to move because of obstacle. (mm)
cyclesToMovedefault number of cycles to move (# of cycles) (may be changed via ArConfig)
speeddefault speed at which to back up or go forward (mm/sec) (may be changed via ArConfig)
degreesToTurndefault number of degrees to turn (deg) (may be changed vi ArConfig)
enableddefault value of "enabled" state configuration parameter (may be changed via ArConfig)

The documentation for this class was generated from the following files: