Aria  2.8.0
ArActionDesired Class Reference

Contains values returned by ArAction objects expressing desired motion commands to resolver. More...

#include <ArActionDesired.h>

Public Member Functions

virtual void accountForRobotHeading (double robotHeading)
 Accounts for robot heading, mostly internal. More...
 
virtual void addAverage (ArActionDesired *actDesired)
 Adds another actionDesired into the mix to average. More...
 
 ArActionDesired ()
 Constructor.
 
virtual void endAverage (void)
 Ends the process of avereraging together different desireds. More...
 
virtual double getDeltaHeading (void) const
 Gets the delta heading desired (deg)
 
virtual double getDeltaHeadingStrength (void) const
 Gets the strength of the delta heading desired.
 
virtual double getHeading (void) const
 Gets the heading desired (deg)
 
virtual double getHeadingStrength (void) const
 Gets the strength of the heading desired.
 
virtual double getLatAccel (void) const
 Gets the desired lateral acceleration (mm/sec)
 
virtual double getLatAccelSlowestUsed (void) const
 Gets whether the slowest lat accel is being used or not.
 
virtual double getLatAccelStrength (void) const
 Gets the desired lateral acceleration strength.
 
virtual double getLatDecel (void) const
 Gets the desired lateral deceleration (-mm/sec/sec)
 
virtual double getLatDecelFastestUsed (void) const
 Gets whether the fastest lat decel is being used or not.
 
virtual double getLatDecelStrength (void) const
 Gets the desired lateral deceleration strength.
 
virtual double getLatVel (void) const
 Gets the lat vel that was set.
 
virtual double getLatVelStrength (void) const
 Gets the lat vel des (deg/sec)
 
virtual double getMaxLeftLatVel (void) const
 Gets the maximum lateral velocity.
 
virtual double getMaxLeftLatVelSlowestUsed (void) const
 Gets whether the slowest lat vel is being used or not.
 
virtual double getMaxLeftLatVelStrength (void) const
 Gets the maximum lateral velocity strength.
 
virtual double getMaxNegVel (void) const
 Gets the desired maximum negative velocity (-mm/sec)
 
virtual double getMaxNegVelSlowestUsed (void) const
 Gets whether the slowest is being used or not.
 
virtual double getMaxNegVelStrength (void) const
 Gets the desired maximum negative velocity strength.
 
virtual double getMaxRightLatVel (void) const
 Gets the maximum lateral velocity.
 
virtual double getMaxRightLatVelSlowestUsed (void) const
 Gets whether the slowest lat vel is being used or not.
 
virtual double getMaxRightLatVelStrength (void) const
 Gets the maximum lateral velocity strength.
 
virtual double getMaxRotVel (void) const
 Gets the maximum rotational velocity.
 
virtual double getMaxRotVelNeg (void) const
 Gets the maximum rotational velocity in the negative direction.
 
virtual double getMaxRotVelNegSlowestUsed (void) const
 Gets whether the slowest rot vel in the negative direction is being used or not.
 
virtual double getMaxRotVelNegStrength (void) const
 Gets the maximum rotational velocity in the negative direction strength.
 
virtual double getMaxRotVelPos (void) const
 Gets the maximum rotational velocity in the positive direction.
 
virtual double getMaxRotVelPosSlowestUsed (void) const
 Gets whether the slowest rot vel in the positive direction is being used or not.
 
virtual double getMaxRotVelPosStrength (void) const
 Gets the maximum rotational velocity in the positive direction strength.
 
virtual double getMaxRotVelSlowestUsed (void) const
 Gets whether the slowest rot vel is being used or not.
 
virtual double getMaxRotVelStrength (void) const
 Gets the maximum rotational velocity strength.
 
virtual double getMaxVel (void) const
 Gets the desired maximum velocity (mm/sec)
 
virtual double getMaxVelSlowestUsed (void) const
 Gets whether the slowest is being used or not.
 
virtual double getMaxVelStrength (void) const
 Gets the maximum velocity strength.
 
virtual double getRotAccel (void) const
 Gets the desired rotational acceleration (mm/sec)
 
virtual double getRotAccelSlowestUsed (void) const
 Gets whether the slowest rot accel is being used or not.
 
virtual double getRotAccelStrength (void) const
 Gets the desired rotational acceleration strength.
 
virtual double getRotDecel (void) const
 Gets the desired rotational deceleration (-mm/sec/sec)
 
virtual double getRotDecelFastestUsed (void) const
 Gets whether the fastest rot decel is being used or not.
 
virtual double getRotDecelStrength (void) const
 Gets the desired rotational deceleration strength.
 
virtual double getRotVel (void) const
 Gets the rot vel that was set.
 
virtual double getRotVelStrength (void) const
 Gets the rot vel des (deg/sec)
 
virtual double getTransAccel (void) const
 Gets the desired trans acceleration (mm/sec)
 
virtual double getTransAccelSlowestUsed (void) const
 Gets whether the slowest accel is being used or not.
 
virtual double getTransAccelStrength (void) const
 Gets the desired trans acceleration strength.
 
virtual double getTransDecel (void) const
 Gets the desired trans deceleration (-mm/sec/sec)
 
virtual double getTransDecelFastestUsed (void) const
 Gets whether the fastest decel is being used or not.
 
virtual double getTransDecelStrength (void) const
 Gets the desired trans deceleration strength.
 
virtual double getVel (void) const
 Gets the translational velocity desired (mm/sec)
 
virtual double getVelStrength (void) const
 Gets the strength of the translational velocity desired.
 
virtual bool isAnythingDesired (void) const
 Gets whether anything is desired (should only really be used in relation to logging)
 
virtual void log (void) const
 Logs what is desired.
 
virtual void merge (ArActionDesired *actDesired)
 Merges the given ArActionDesired into this one (this one has precedence), internal. More...
 
virtual void reset (void)
 Resets the strengths to 0.
 
virtual void sanityCheck (const char *actionName)
 Do a sanity check on the action (this is set up this way so the action name can be passed in)
 
virtual void setDeltaHeading (double deltaHeading, double strength=MAX_STRENGTH)
 Sets the delta heading (deg) and strength. More...
 
virtual void setHeading (double heading, double strength=MAX_STRENGTH)
 Sets the absolute heading (deg) More...
 
virtual void setLatAccel (double latAccel, double strength=MAX_STRENGTH, bool useSlowest=true)
 Sets the lateral acceleration (deg/sec/sec) and strength. More...
 
virtual void setLatDecel (double latDecel, double strength=MAX_STRENGTH, bool useFastest=true)
 Sets the lateral deceleration (deg/sec/sec) and strength. More...
 
virtual void setLeftLatVel (double latVel, double strength=MAX_STRENGTH)
 Sets the left lateral velocity (mm/sec) and strength. More...
 
virtual void setMaxLeftLatVel (double maxVel, double strength=MAX_STRENGTH, bool useSlowest=true)
 Sets the maximum lateral velocity (deg/sec) and strength. More...
 
virtual void setMaxNegVel (double maxVel, double strength=MAX_STRENGTH, bool useSlowest=true)
 Sets the maximum velocity for going backwards (-mm/sec) and strength. More...
 
virtual void setMaxRightLatVel (double maxVel, double strength=MAX_STRENGTH, bool useSlowest=true)
 Sets the maximum lateral velocity (deg/sec) and strength. More...
 
virtual void setMaxRotVel (double maxVel, double strength=MAX_STRENGTH, bool useSlowest=true)
 Sets the maximum rotational velocity (deg/sec) and strength. More...
 
virtual void setMaxRotVelNeg (double maxVel, double strength=MAX_STRENGTH, bool useSlowest=true)
 Sets the maximum rotational velocity (deg/sec) in the negative direction and strength. More...
 
virtual void setMaxRotVelPos (double maxVel, double strength=MAX_STRENGTH, bool useSlowest=true)
 Sets the maximum rotational velocity (deg/sec) in the positive direction and strength. More...
 
virtual void setMaxVel (double maxVel, double strength=MAX_STRENGTH, bool useSlowest=true)
 Sets the maximum velocity (+mm/sec) and strength. More...
 
virtual void setRightLatVel (double latVel, double strength=MAX_STRENGTH)
 Sets the right lateral velocity (mm/sec) and strength. More...
 
virtual void setRotAccel (double rotAccel, double strength=MAX_STRENGTH, bool useSlowest=true)
 Sets the rotational acceleration (deg/sec/sec) and strength. More...
 
virtual void setRotDecel (double rotDecel, double strength=MAX_STRENGTH, bool useFastest=true)
 Sets the rotational deceleration (deg/sec/sec) and strength. More...
 
virtual void setRotVel (double rotVel, double strength=MAX_STRENGTH)
 Sets the rotational velocity. More...
 
virtual void setTransAccel (double transAccel, double strength=MAX_STRENGTH, bool useSlowest=true)
 Sets the translation acceleration (deg/sec/sec) and strength. More...
 
virtual void setTransDecel (double transDecel, double strength=MAX_STRENGTH, bool useFastestDecel=true)
 Sets the translation deceleration (deg/sec/sec) and strength. More...
 
virtual void setVel (double vel, double strength=MAX_STRENGTH)
 Sets the velocity (mm/sec) and strength. More...
 
virtual void startAverage (void)
 Starts the process of avereraging together different desireds. More...
 
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 myLatAccelDes
 
ArActionDesiredChannel myLatDecelDes
 
ArActionDesiredChannel myLatVelDes
 
ArActionDesiredChannel myMaxLeftLatVelDes
 
ArActionDesiredChannel myMaxNegVelDes
 
ArActionDesiredChannel myMaxRightLatVelDes
 
ArActionDesiredChannel myMaxRotVelDes
 
ArActionDesiredChannel myMaxRotVelNegDes
 
ArActionDesiredChannel myMaxRotVelPosDes
 
ArActionDesiredChannel myMaxVelDes
 
ArActionDesiredChannel myRotAccelDes
 
ArActionDesiredChannel myRotDecelDes
 
ArActionDesiredChannel myRotVelDes
 
ArActionDesiredChannel myTransAccelDes
 
ArActionDesiredChannel myTransDecelDes
 
ArActionDesiredChannel myVelDes
 

Detailed Description

Contains values returned by ArAction objects expressing desired motion commands to resolver.

This class is use by actions to report what want movement commands they want. The action resolver combines the ArActionDesired objects returned by different actions.

A brief summary follows. For a fuller explanation of actions, see Actions.

Different values are organized into different "channels". Translational (front/back) and rotational (right/left) movements are separate channels. Translational movement uses velocity, while rotational movement uses change in heading from current heading. Each channel has a 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 combined strength avaliable. 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 could override this class the ArResolver class.

Note that for the different maximum/accel/decel values they take an additional argument of whether just to use the slowest speed, slowest accel, or fastest decel. By default these will just use safer values (slowest speed, slowest accel, fastest decel)... you can specify false on these for the old behavior. Note that if you're safest values then the strength is largely ignored though it is still tracked and must still be greater than MIN_STRENGTH to work and it is still capped at MAX_STRENGTH).

See also
Actions
Examples:
actionExample.cpp, actsColorFollowingExample.cpp, and joydriveActionExample.cpp.

Member Function Documentation

◆ accountForRobotHeading()

virtual void ArActionDesired::accountForRobotHeading ( double  robotHeading)
inlinevirtual

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

Parameters
robotHeadingthe heading the real actual robot is at now

◆ addAverage()

virtual void ArActionDesired::addAverage ( ArActionDesired actDesired)
inlinevirtual

Adds another actionDesired into the mix to average.

For a description of how to use this, see startAverage.

Parameters
actDesiredthe actionDesired to add into the average

◆ endAverage()

virtual void ArActionDesired::endAverage ( void  )
inlinevirtual

Ends the process of avereraging together different desireds.

For a description of how to use this, see startAverage.

◆ merge()

virtual void ArActionDesired::merge ( ArActionDesired actDesired)
inlinevirtual

Merges the given ArActionDesired into this one (this one has precedence), internal.

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.

Parameters
actDesiredthe actionDesired to merge with this one

◆ setDeltaHeading()

virtual void ArActionDesired::setDeltaHeading ( double  deltaHeading,
double  strength = MAX_STRENGTH 
)
inlinevirtual

Sets the delta heading (deg) and strength.

If there's already a rotVel set this WILL NOT work.

Parameters
deltaHeadingdesired change in heading (deg)
strengthstrength given to this, defaults to MAX_STRENGTH (1.0)

◆ setHeading()

virtual void ArActionDesired::setHeading ( double  heading,
double  strength = MAX_STRENGTH 
)
inlinevirtual

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

Parameters
headingdesired heading (deg)
strengthstrength given to this, defaults to MAX_STRENGTH (1.0)

◆ setLatAccel()

virtual void ArActionDesired::setLatAccel ( double  latAccel,
double  strength = MAX_STRENGTH,
bool  useSlowest = true 
)
inlinevirtual

Sets the lateral acceleration (deg/sec/sec) and strength.

This sets the lateral acceleration for this cycle (this is sent down to the robot). Check the ArRobot class notes for more details.

Parameters
latAcceldesired lateral acceleration (deg/sec/sec)
strengthstrength given to this, defaults to MAX_STRENGTH (1.0)
useSlowestif this is true (the default) everywhere then the slowest lat accel is what will be selected

◆ setLatDecel()

virtual void ArActionDesired::setLatDecel ( double  latDecel,
double  strength = MAX_STRENGTH,
bool  useFastest = true 
)
inlinevirtual

Sets the lateral deceleration (deg/sec/sec) and strength.

This sets the lateral deceleration for this cycle (this is sent down to the robot). Check the ArRobot class notes for more details.

Parameters
latDeceldesired lateral deceleration (deg/sec/sec)
strengthstrength given to this, defaults to MAX_STRENGTH (1.0)
useFastestif this is true (the default) everywhere then the fastest lat decel is what will be selected

◆ setLeftLatVel()

virtual void ArActionDesired::setLeftLatVel ( double  latVel,
double  strength = MAX_STRENGTH 
)
inlinevirtual

Sets the left lateral velocity (mm/sec) and strength.

Note that there is only one actual velocity for lat vel, but instead of making people remember which way is left and right there are two functions, setLeftLatVel and setRightLatVel... all setRightLatVel does is flip the direction on the vel. You can set a negative left lat vel and thats the same as setting a positive right vel. You can do the same with setting a negative right vel to get a positive left vel.

Parameters
latVeldesired vel (mm/sec)
strengthstrength given to this, defaults to MAX_STRENGTH (1.0)

◆ setMaxLeftLatVel()

virtual void ArActionDesired::setMaxLeftLatVel ( double  maxVel,
double  strength = MAX_STRENGTH,
bool  useSlowest = true 
)
inlinevirtual

Sets the maximum lateral velocity (deg/sec) and strength.

This sets the maximum lateral velocity for this cycle. Check the ArRobot class notes for more details.

Parameters
maxVeldesired maximum lateral velocity (deg/sec)
strengthstrength given to this, defaults to MAX_STRENGTH (1.0)
useSlowestif this is true (the default) everywhere then the slowest lat vel is what will be selected

◆ setMaxNegVel()

virtual void ArActionDesired::setMaxNegVel ( double  maxVel,
double  strength = MAX_STRENGTH,
bool  useSlowest = true 
)
inlinevirtual

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.

Parameters
maxVeldesired maximum velocity for going backwards (-mm/sec)
strengthstrength given to this, defaults to MAX_STRENGTH (1.0)
useSlowestif this is true (the default) everywhere then the slowest max neg vel is what will be selected

◆ setMaxRightLatVel()

virtual void ArActionDesired::setMaxRightLatVel ( double  maxVel,
double  strength = MAX_STRENGTH,
bool  useSlowest = true 
)
inlinevirtual

Sets the maximum lateral velocity (deg/sec) and strength.

This sets the maximum lateral velocity for this cycle. Check the ArRobot class notes for more details.

Parameters
maxVeldesired maximum lateral velocity (deg/sec)
strengthstrength given to this, defaults to MAX_STRENGTH (1.0)
useSlowestif this is true (the default) everywhere then the slowest lat vel is what will be selected

◆ setMaxRotVel()

virtual void ArActionDesired::setMaxRotVel ( double  maxVel,
double  strength = MAX_STRENGTH,
bool  useSlowest = true 
)
inlinevirtual

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.

Parameters
maxVeldesired maximum rotational velocity (deg/sec)
strengthstrength given to this, defaults to MAX_STRENGTH (1.0)
useSlowestif this is true (the default) everywhere then the slowest rot vel is what will be selected

◆ setMaxRotVelNeg()

virtual void ArActionDesired::setMaxRotVelNeg ( double  maxVel,
double  strength = MAX_STRENGTH,
bool  useSlowest = true 
)
inlinevirtual

Sets the maximum rotational velocity (deg/sec) in the negative direction and strength.

This sets the maximum rotational velocity for this cycle (this is sent down to the robot) in the negative direction. If the setMaxRotVel is set to less than this that will be used instead. Check the ArRobot class notes for more details.

Parameters
maxVeldesired maximum rotational velocity in the negative direction (deg/sec)
strengthstrength given to this, defaults to MAX_STRENGTH (1.0)
useSlowestif this is true (the default) everywhere then the slowest rot vel is what will be selected

◆ setMaxRotVelPos()

virtual void ArActionDesired::setMaxRotVelPos ( double  maxVel,
double  strength = MAX_STRENGTH,
bool  useSlowest = true 
)
inlinevirtual

Sets the maximum rotational velocity (deg/sec) in the positive direction and strength.

This sets the maximum rotational velocity for this cycle (this is sent down to the robot) in the positive direction. If the setMaxRotVel is set to less than this that will be used instead. Check the ArRobot class notes for more details.

Parameters
maxVeldesired maximum rotational velocity in the positive direction (deg/sec)
strengthstrength given to this, defaults to MAX_STRENGTH (1.0)
useSlowestif this is true (the default) everywhere then the slowest rot vel is what will be selected

◆ setMaxVel()

virtual void ArActionDesired::setMaxVel ( double  maxVel,
double  strength = MAX_STRENGTH,
bool  useSlowest = true 
)
inlinevirtual

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.

Parameters
maxVeldesired maximum velocity (+mm/sec)
strengthstrength given to this, defaults to MAX_STRENGTH (1.0)
useSlowestif this is true (the default) everywhere then the slowest maximum vel is what will be selected

◆ setRightLatVel()

virtual void ArActionDesired::setRightLatVel ( double  latVel,
double  strength = MAX_STRENGTH 
)
inlinevirtual

Sets the right lateral velocity (mm/sec) and strength.

Note that there is only one actual velocity for lat vel, but instead of making people remember which way is left and right there are two functions, setLeftLatVel and setRightLatVel... all setRightLatVel does is flip the direction on the vel. You can set a negative left lat vel and thats the same as setting a positive right vel. You can do the same with setting a negative right vel to get a positive left vel.

Parameters
latVeldesired vel (mm/sec)
strengthstrength given to this, defaults to MAX_STRENGTH (1.0)

◆ setRotAccel()

virtual void ArActionDesired::setRotAccel ( double  rotAccel,
double  strength = MAX_STRENGTH,
bool  useSlowest = true 
)
inlinevirtual

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.

Parameters
rotAcceldesired rotational acceleration (deg/sec/sec)
strengthstrength given to this, defaults to MAX_STRENGTH (1.0)
useSlowestif this is true (the default) everywhere then the slowest rot accel is what will be selected

◆ setRotDecel()

virtual void ArActionDesired::setRotDecel ( double  rotDecel,
double  strength = MAX_STRENGTH,
bool  useFastest = true 
)
inlinevirtual

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.

Parameters
rotDeceldesired rotational deceleration (deg/sec/sec)
strengthstrength given to this, defaults to MAX_STRENGTH (1.0)
useFastestif this is true (the default) everywhere then the fastest rot decel is what will be selected

◆ setRotVel()

virtual void ArActionDesired::setRotVel ( double  rotVel,
double  strength = MAX_STRENGTH 
)
inlinevirtual

Sets the rotational velocity.

If there's already a delta heading or heading this WILL NOT work.

Parameters
rotVeldesired rotational velocity (deg/sec)
strengthstrength given to this, defaults to MAX_STRENGTH (1.0)

◆ setTransAccel()

virtual void ArActionDesired::setTransAccel ( double  transAccel,
double  strength = MAX_STRENGTH,
bool  useSlowest = true 
)
inlinevirtual

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.

Parameters
transAcceldesired translation acceleration (deg/sec/sec)
strengthstrength given to this, defaults to MAX_STRENGTH (1.0)
useSlowestif this is true (the default) everywhere then the slowest accel is what will be selected

◆ setTransDecel()

virtual void ArActionDesired::setTransDecel ( double  transDecel,
double  strength = MAX_STRENGTH,
bool  useFastestDecel = true 
)
inlinevirtual

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.

Parameters
transDeceldesired translation deceleration (deg/sec/sec)
strengthstrength given to this, defaults to MAX_STRENGTH (1.0)
useFastestDecelif this is true (the default) everywhere then the fastest decel is what will be selected

◆ setVel()

virtual void ArActionDesired::setVel ( double  vel,
double  strength = MAX_STRENGTH 
)
inlinevirtual

Sets the velocity (mm/sec) and strength.

Parameters
veldesired vel (mm/sec)
strengthstrength given to this, defaults to MAX_STRENGTH (1.0)

◆ startAverage()

virtual void ArActionDesired::startAverage ( void  )
inlinevirtual

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.


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