ArActionRatioInput Class Reference

#include <ArActionRatioInput.h>

Inheritance diagram for ArActionRatioInput:

ArAction List of all members.

Detailed Description

Action that requests motion based on abstract ratios provided by diferent input sources.

This action interprets input drive commands as three abstract ratios, translation, rotation, and throttle. (In this way it mimics many joysticks.) The translation speed input ranges from -100 to 100, where -100 requests maximum backwards speed, and 100 requests maximum forward speed, 0 requests no translational speed, and values in between request a linear percentage of the maximum. Similarly, rotation speed input ranges from -100 to 100, where -100 indicates maximum rightwards or clockwise rotation, 100 indicates maximum leftwards or counter-clockwise rotation, 0 requests no rotation, and values in between request a linear percentage of the maximum. The throttle input scales the other speed, and ranges from 0 (no motion) to 100 (maximum motion).

Seperate objects (e.g. ArRatioInputKeydrive, ArRatioInputJoydrive, ArRAtionInputRobotJoydrive) are used to provide input.

When this action is activated it resets all its input ratios to 0 (including throttle).

Configuration parameters are used to map the maximum ratios to actual robot speeds. These are set be default to the robot's maximum configured velocities at startup but you can override them with ArConfig parameters (and call addToConfig()) or setParameters().

See also:
ArRatioInputKeydrive

ArRatioInputJoydrive

ArRatioInputRobotJoydrive


Public Member Functions

virtual void activate (void)
void addActivateCallback (ArFunctor *functor, ArListPos::Pos position=ArListPos::LAST)
 Adds a callback that is called when this action is activated.
void addDeactivateCallback (ArFunctor *functor, ArListPos::Pos position=ArListPos::LAST)
 Adds a callback that is called when this action is deactivated.
void addFireCallback (int priority, ArFunctor *functor)
 Adds a callback that is called from this actions fire call.
void addToConfig (ArConfig *config, const char *section)
 Adds to a section in a config.
 ArActionRatioInput (const char *name="RatioInput")
 Constructor.
virtual void deactivate (void)
virtual ArActionDesiredfire (ArActionDesired currentDesired)
virtual const ArActionDesiredgetDesired (void) const
virtual ArActionDesiredgetDesired (void)
double getRotRatio (void)
 Gets the rot ratio (from -100 (full right) to 100 (full left).
double getThrottleRatio (void)
 Gets the throttle ratio (from 0 (stopped) to 100 (full throttle).
double getTransRatio (void)
 Gets the trans ratio (from -100 (full backwards) to 100 (full forwards).
void remActivateCallback (ArFunctor *functor)
 Removes a callback that was called when this action is activated.
void remDeactivateCallback (ArFunctor *functor)
 Removes a callback that was called when this action is deactivated.
void remFireCallback (ArFunctor *functor)
 Removes a callback that was called from this actions fire callback.
void setLatRatio (double latRatio)
 Sets the lat ratio (from -100 (one way) to 100 (the other)).
void setParameters (double fullThrottleForwards, double fullThrottleBackwards, double rotAtFullForwards, double rotAtFullBackwards, double rotAtStopped, double latAtFullForwards=0, double latAtFullBackwards=0, double latAtStopped=0)
 Sets the parameters.
void setRatios (double transRatio, double rotRatio, double throttleRatio, double latRatio=0)
 Set ratios.
void setRotRatio (double rotRatio)
 Sets the rot ratio (from -100 (full right) to 100 (full left).
void setThrottleRatio (double throttleRatio)
 Sets the throttle ratio (from 0 (stopped) to 100 (full throttle).
void setTransRatio (double transRatio)
 Sets the trans ratio (from -100 (full backwards) to 100 (full forwards).
virtual ~ArActionRatioInput ()
 Destructor.

Protected Attributes

std::list< ArFunctor * > myActivateCallbacks
std::list< ArFunctor * > myDeactivateCallbacks
ArActionDesired myDesired
std::multimap< int, ArFunctor * > myFireCallbacks
double myFullThrottleBackwards
double myFullThrottleForwards
double myLatAtFullBackwards
double myLatAtFullForwards
double myLatAtStopped
double myLatDeadZone
double myLatRatio
bool myPrinting
double myRotAtFullBackwards
double myRotAtFullForwards
double myRotAtStopped
double myRotDeadZone
double myRotRatio
double myThrottleRatio
double myTransDeadZone
double myTransRatio


The documentation for this class was generated from the following file:
Generated on Thu Aug 6 09:39:34 2009 for Aria by  doxygen 1.5.1