#include <ArActionDesired.h>
Public Member Functions | |
virtual void | accountForRobotHeading (double robotHeading) |
Accounts for robot heading, mostly internal. | |
virtual void | addAverage (ArActionDesired *actDesired) |
Adds another actionDesired into the mix to average. | |
ArActionDesired () | |
Constructor. | |
virtual void | endAverage (void) |
Ends the process of avereraging together different desireds. | |
virtual double | getDeltaHeading (void) |
Gets the delta heading desired (deg). | |
virtual double | getDeltaHeadingStrength (void) |
Gets the strength of the delta heading desired. | |
virtual double | getHeading (void) |
Gets the heading desired (deg). | |
virtual double | getHeadingStrength (void) |
Gets the strength of the heading desired. | |
virtual double | getMaxNegVel (void) |
Gets the desired maximum negative velocity (-mm/sec). | |
virtual double | getMaxNegVelStrength (void) |
Gets the desired maximum negative velocity strength. | |
virtual double | getMaxRotVel (void) |
Gets the maximum rotational velocity. | |
virtual double | getMaxRotVelStrength (void) |
Gets the maximum rotational velocity strength. | |
virtual double | getMaxVel (void) |
Gets the desired maximum velocity (mm/sec). | |
virtual double | getMaxVelStrength (void) |
Gets the maximum velocity strength. | |
virtual double | getRotAccel (void) |
Gets the desired rotational acceleration (mm/sec). | |
virtual double | getRotAccelStrength (void) |
Gets the desired rotational acceleration strength. | |
virtual double | getRotDecel (void) |
Gets the desired rotational deceleration (-mm/sec/sec). | |
virtual double | getRotDecelStrength (void) |
Gets the desired rotational deceleration strength. | |
virtual double | getRotVel (void) |
Gets the rot vel that was set. | |
virtual double | getRotVelStrength (void) |
Gets the rot vel des (deg/sec). | |
virtual double | getTransAccel (void) |
Gets the desired trans acceleration (mm/sec). | |
virtual double | getTransAccelStrength (void) |
Gets the desired trans acceleration strength. | |
virtual double | getTransDecel (void) |
Gets the desired trans deceleration (-mm/sec/sec). | |
virtual double | getTransDecelStrength (void) |
Gets the desired trans deceleration strength. | |
virtual double | getVel (void) |
Gets the translational velocity desired (mm/sec). | |
virtual double | getVelStrength (void) |
Gets the strength of the translational velocity desired. | |
virtual void | merge (ArActionDesired *actDesired) |
virtual void | reset (void) |
Resets the strengths to 0. | |
virtual void | setDeltaHeading (double deltaHeading, double strength=MAX_STRENGTH) |
Sets the delta heading (deg) and strength. | |
virtual void | setHeading (double heading, double strength=MAX_STRENGTH) |
Sets the absolute heading (deg). | |
virtual void | setMaxNegVel (double maxVel, double strength=MAX_STRENGTH) |
Sets the maximum velocity for going backwards (-mm/sec) and strength. | |
virtual void | setMaxRotVel (double maxVel, double strength=MAX_STRENGTH) |
Sets the maximum rotational velocity (deg/sec) and strength. | |
virtual void | setMaxVel (double maxVel, double strength=MAX_STRENGTH) |
Sets the maximum velocity (+mm/sec) and strength. | |
virtual void | setRotAccel (double rotAccel, double strength=MAX_STRENGTH) |
Sets the rotational acceleration (deg/sec/sec) and strength. | |
virtual void | setRotDecel (double rotDecel, double strength=MAX_STRENGTH) |
Sets the rotational deceleration (deg/sec/sec) and strength. | |
virtual void | setRotVel (double rotVel, double strength=MAX_STRENGTH) |
Sets the rotational velocity. | |
virtual void | setTransAccel (double transAccel, double strength=MAX_STRENGTH) |
Sets the translation acceleration (deg/sec/sec) and strength. | |
virtual void | setTransDecel (double transDecel, double strength=MAX_STRENGTH) |
Sets the translation deceleration (deg/sec/sec) and strength. | |
virtual void | setVel (double vel, double strength=MAX_STRENGTH) |
Sets the velocity (mm/sec) and strength. | |
virtual void | startAverage (void) |
Starts the process of avereraging together different desireds. | |
virtual | ~ArActionDesired () |
Destructor. | |
Static Public Attributes | |
static const double | MAX_STRENGTH = 1.0 |
static const double | MIN_STRENGTH = .000001 |
static const double | NO_STRENGTH = 0.0 |
Protected Attributes | |
ArActionDesiredChannel | myDeltaHeadingDes |
double | myHeading |
bool | myHeadingSet |
double | myHeadingStrength |
ArActionDesiredChannel | myMaxNegVelDes |
ArActionDesiredChannel | myMaxRotVelDes |
ArActionDesiredChannel | myMaxVelDes |
ArActionDesiredChannel | myRotAccelDes |
ArActionDesiredChannel | myRotDecelDes |
ArActionDesiredChannel | myRotVelDes |
ArActionDesiredChannel | myTransAccelDes |
ArActionDesiredChannel | myTransDecelDes |
ArActionDesiredChannel | myVelDes |
This class is use by actions to report what they want to want to do (hence the name).
The way it works, is that translational (front/back) and rotational (right/left) are seperate. Translational movement uses velocity, while rotational movement uses change in heading from current heading. Translational and rotational each have their own strength value. Both translational and rotational movement have maximum velocities as well, that also have their own strengths.
The strength value reflects how strongly an action wants to do the chosen movement command, the resolver (ArResolver) will combine these strengths and figure out what to do based on them.
For all strength values there is a total of 1.0 strength to be had. The range for strength is from 0 to 1. This is simply a convention that ARIA uses by default, if you don't like it, you can override this class and make an ArResolver.
Definition at line 117 of file ArActionDesired.h.
|
Accounts for robot heading, mostly internal. This accounts for the robots heading, and transforms the set heading on this actionDesired into a delta heading so it can be merged and averaged and the like
Definition at line 449 of file ArActionDesired.h. References setDeltaHeading(). |
|
Adds another actionDesired into the mix to average. For a description of how to use this, see startAverage.
Definition at line 392 of file ArActionDesired.h. References ArActionDesiredChannel::addAverage(), and ArActionDesiredChannel::getStrength(). |
|
Ends the process of avereraging together different desireds. For a description of how to use this, see startAverage. Definition at line 429 of file ArActionDesired.h. References ArActionDesiredChannel::endAverage(). |
|
This merges in the two different action values, accountForRobotHeading MUST be done before this is called (on both actions), since this merges their delta headings, and the deltas can't be known unless the account for angle is done.
Definition at line 338 of file ArActionDesired.h. References ArActionDesiredChannel::getStrength(), and ArActionDesiredChannel::merge(). Referenced by ArRobot::actionHandler(). |
|
Sets the delta heading (deg) and strength. If there's already a rotVel set this WILL NOT work.
Definition at line 141 of file ArActionDesired.h. References ArActionDesiredChannel::setDesired(). Referenced by accountForRobotHeading(), ArActionTurn::fire(), ArActionTriangleDriveTo::fire(), ArActionStop::fire(), ArActionStallRecover::fire(), ArActionRobotJoydrive::fire(), ArActionKeydrive::fire(), ArActionJoydrive::fire(), ArActionIRs::fire(), ArActionInput::fire(), ArActionGotoStraight::fire(), ArActionGoto::fire(), ArActionConstantVelocity::fire(), ArActionColorFollow::fire(), ArActionBumpers::fire(), ArActionAvoidSide::fire(), and ArActionAvoidFront::fire(). |
|
Sets the absolute heading (deg). If there's already a rotVel set this WILL NOT work. This is a way to set the heading instead of using a delta, there is no get for this, because accountForRobotHeading MUST be called (this should be called by all resolvers, but if you want to call it you can, thats fine).
Definition at line 153 of file ArActionDesired.h. Referenced by ArActionTriangleDriveTo::fire(), ArActionIRs::fire(), ArActionInput::fire(), ArActionGotoStraight::fire(), ArActionGoto::fire(), and ArActionBumpers::fire(). |
|
Sets the maximum velocity for going backwards (-mm/sec) and strength. This sets the maximum negative velocity for this cycle. Check the ArRobot class notes for more details.
Definition at line 187 of file ArActionDesired.h. References ArActionDesiredChannel::setDesired(). Referenced by ArActionMovementParameters::fire(), ArActionLimiterBackwards::fire(), ArActionDeceleratingLimiter::fire(), and ArActionBumpers::fire(). |
|
Sets the maximum rotational velocity (deg/sec) and strength. This sets the maximum rotational velocity for this cycle (this is sent down to the robot). Check the ArRobot class notes for more details.
Definition at line 223 of file ArActionDesired.h. References ArActionDesiredChannel::setDesired(). Referenced by ArActionMovementParameters::fire(). |
|
Sets the maximum velocity (+mm/sec) and strength. This sets the maximum positive velocity for this cycle. Check the ArRobot class notes for more details.
Definition at line 176 of file ArActionDesired.h. References ArActionDesiredChannel::setDesired(). Referenced by ArActionMovementParameters::fire(), ArActionLimiterTableSensor::fire(), ArActionLimiterForwards::fire(), ArActionDeceleratingLimiter::fire(), and ArActionBumpers::fire(). |
|
Sets the rotational acceleration (deg/sec/sec) and strength. This sets the rotational acceleration for this cycle (this is sent down to the robot). Check the ArRobot class notes for more details.
Definition at line 235 of file ArActionDesired.h. References ArActionDesiredChannel::setDesired(). Referenced by ArActionMovementParameters::fire(). |
|
Sets the rotational deceleration (deg/sec/sec) and strength. This sets the rotational deceleration for this cycle (this is sent down to the robot). Check the ArRobot class notes for more details.
Definition at line 247 of file ArActionDesired.h. References ArActionDesiredChannel::setDesired(). Referenced by ArActionRobotJoydrive::fire(), ArActionRatioInput::fire(), and ArActionMovementParameters::fire(). |
|
Sets the rotational velocity. If there's already a delta heading or heading this WILL NOT work.
Definition at line 162 of file ArActionDesired.h. References ArActionDesiredChannel::setDesired(). Referenced by ArActionTriangleDriveTo::fire(), ArActionRobotJoydrive::fire(), ArActionRatioInput::fire(), and ArActionInput::fire(). |
|
Sets the translation acceleration (deg/sec/sec) and strength. This sets the translation acceleration for this cycle (this is sent down to the robot). Check the ArRobot class notes for more details.
Definition at line 199 of file ArActionDesired.h. References ArActionDesiredChannel::setDesired(). Referenced by ArActionMovementParameters::fire(). |
|
Sets the translation deceleration (deg/sec/sec) and strength. This sets the translation deceleration for this cycle (this is sent down to the robot). Check the ArRobot class notes for more details.
Definition at line 211 of file ArActionDesired.h. References ArActionDesiredChannel::setDesired(). Referenced by ArActionRobotJoydrive::fire(), ArActionRatioInput::fire(), ArActionMovementParameters::fire(), and ArActionDeceleratingLimiter::fire(). |
|
Sets the velocity (mm/sec) and strength.
Definition at line 133 of file ArActionDesired.h. References ArActionDesiredChannel::setDesired(). Referenced by ArActionTriangleDriveTo::fire(), ArActionStop::fire(), ArActionStallRecover::fire(), ArActionRobotJoydrive::fire(), ArActionRatioInput::fire(), ArActionKeydrive::fire(), ArActionJoydrive::fire(), ArActionIRs::fire(), ArActionInput::fire(), ArActionGotoStraight::fire(), ArActionGoto::fire(), ArActionDeceleratingLimiter::fire(), ArActionConstantVelocity::fire(), ArActionColorFollow::fire(), ArActionBumpers::fire(), ArActionAvoidSide::fire(), and ArActionAvoidFront::fire(). |
|
Starts the process of avereraging together different desireds. There is a three step process for averaging actionDesireds together, first startAverage must be done to set up the process, then addAverage must be done with each average that is desired, then finally endAverage should be used, after that is done then the normal process of getting the results out should be done. Definition at line 374 of file ArActionDesired.h. References ArActionDesiredChannel::startAverage(). |