BaseArnl: ArActionPlanAndMoveToGoal Class Reference

- Main Page
- Classes
- Related Pages
- Examples

- Class List
- Class Hierarchy
- Class Members

# ArActionPlanAndMoveToGoal Class Reference

`#include <ArPathPlanningTask.h>`

List of all members.

## Detailed Description

This is the action for local obstacle avoidance and path following. This class uses the ArPathPlanningTask methods to drive the robot safely.

## Public Member Functions
| ArActionPlanAndMoveToGoal (double maxVel, double maxRotVel, ArPathPlanningTask *ppt, ArRangeDevice *laser, ArRangeDevice *sonar)
| Constructor, sets the maximums and the parent pointer.
virtual | ~ArActionPlanAndMoveToGoal (void)
| Destructor, no new objects, we don't need to do anything.
virtual ArActionDesired * | fire (ArActionDesired currentDesired)
| Fire, this is what the resolver calls to find out what this action wants.
virtual void | deactivate (void)
| Overrides base deactivate to uninitialize ArPathPlanningTask.
void | setTotalVel (double lvel, double avel)
| Set the two vels.
void | setEndMoveParams (void)
| Set end move params such as accels and decels for fine positioning.
void | setHeadingParams (void)
| Set params such as accels and decels for heading only situations.
void | clearRangeDevices (void)
| Clear the range devices.
void | clearCumRangeDevices (unsigned int cyt)
| Clear the cumulative range devices.
void | setMaxVel (double v)
| Set max vel.
void | setMaxRotVel (double r)
| Set max rot vel.
void | setFailedTimes (int i)
| Set times failed.
void | setRangeFactor (double r)
| Set range factor.
void | setEndMoveFlag (bool f)
| Set end move flag.
void | setPlanState (ArPathPlanningTask::LocalPlanningState s)
| Set plan state.
void | setReplannedTimes (int f)
| Set the no of times to replan to a goal.
double | getMaxVel (void)
| Get max vel.
double | getRotMaxVel (void)
| Get max rot vel.
int | getFailedTimes (void)
| Get times failed.
double | getRangeFactor (void)
| Get range factor.
bool | getEndMoveFlag (void)
| Get end move flag.
ArPathPlanningTask::LocalPlanningState | getPlanState (void)
| Get last plan state.
int | getReplannedTimes (void)
| Set the no of times to replan to a goal.
void | setCurrentDynamicParams (ArActionDesired curDesired)
| Set the desired action.
double | getFailedTimeRatio (void)
| This gets how close we are to failing as a ratio between 0 and 1.
virtual ArActionDesired * | getDesired (void)
| Get the desired action.
double | computeSafeDecel (double obsDist, double linVel, double rotVel, double currentDecel, bool &eStopFlag, bool &brakeFlag)
| Computes the safe deceleration from obstacle distance if any.
ArActionDesired * | stop (double obsDist, double linVel, double rotVel, double currentDecel)
## Protected Attributes
ArRangeDevice * | myLaser
| This holds the laser info.
ArRangeDevice * | mySonar
| Holds sonar stuff.
ArActionDesired | myDesired
| What the action wants to do.
double | myMaxVel
| Max translational velocity.
double | myMaxRotVel
| Max rotational velocity.
double | myVel
| Current linear velocity.
double | myRotVel
| Current angular velocity.
double | myHeading
| Current heading;.
ArPathPlanningTask * | myPathPlanningTask
| Link to the class that does the actual path planning.
int | myFailedTimes
| Failed times.
double | myRangeFactor
| Range factor.
bool | myEndMoveFlag
| End move flag.
ArPose | myEndMoveEncoderGoal
| End move position.
ArPathPlanningTask::LocalPlanningState | myPlanState
| Planning state.
int | myReplannedTimes
| No of times the same goal was replanned.

## Constructor & Destructor Documentation

ArActionPlanAndMoveToGoal::ArActionPlanAndMoveToGoal | ( | double | maxVel,
|  | double | maxRotVel,
|  | ArPathPlanningTask * | ppt,
|  | ArRangeDevice * | laser,
|  | ArRangeDevice * | sonar |
| ) |  |  |

Constructor, sets the maximums and the parent pointer.

Parameters:

  | maxVel,: | Maximum translational velocity.
  | maxRotVel,: | Maximum rotational velocity.
  | ppt,: | The pointer to the pathplanning class which does the work.

## Member Function Documentation

ArActionDesired * ArActionPlanAndMoveToGoal::fire | ( | ArActionDesired | currentDesired | ) | `[virtual]`

Fire, this is what the resolver calls to find out what this action wants.

This is the guts of the action. Virtual function redefined. Here the path planning flags and variables are used to set the actual robot velocity.

Parameters:

  | currentDesired,: | The ArActionDesired pointer.

void ArActionPlanAndMoveToGoal::deactivate | ( | void |  | ) | `[virtual]`

Overrides base deactivate to uninitialize ArPathPlanningTask.

deactivates the action.

void ArActionPlanAndMoveToGoal::setTotalVel | ( | double | linVel,
|  | double | rotVel |
| ) |  |  |

Set the two vels.

Sets the linear and rotational velocites at a shot.

Parameters:

  | linVel,: | Linear velocity to be set in the action.
  | rotVel,: | Angular velocity to be set in the action.

void ArActionPlanAndMoveToGoal::setEndMoveParams | ( | void |  | ) |

Set end move params such as accels and decels for fine positioning.

Sets the vel, accel, decel params for the end move.

void ArActionPlanAndMoveToGoal::setHeadingParams | ( | void |  | ) |

Set params such as accels and decels for heading only situations.

Sets the vel, accel, decel params for the heading.

void ArActionPlanAndMoveToGoal::setCurrentDynamicParams | ( | ArActionDesired | currentDesired | ) |

Set the desired action.

Sets the motion params by looking at the actions which are based on the sectors the robot is at.

Parameters:

  | currentDesired,: | The global action desired.

double ArActionPlanAndMoveToGoal::computeSafeDecel | ( | double | obsDist,
|  | double | linVel,
|  | double | rotVel,
|  | double | currentDecel,
|  | bool & | eStopFlag,
|  | bool & | brakeFlag |
| ) |  |  |

Computes the safe deceleration from obstacle distance if any.

Computes the safe deceleration with the given obstacle distance and current velocities. If needed it will compute the additional braking deceleration and call the EStop in the worst case.

Parameters:

  | obsDist,: | Distance to obstacle on the current path.
  | linVel,: | Current linear velocity.
  | rotVel,: | Current rotational velocity.
  | currentDecel,: | Current deceleration.
  | eStopFlag,: | returns true if estop is needed to avoid collision.
  | brakeFlag,: | returns true if more braking than currentDecel is needed.

Returns:
  The computed deceleration.

ArActionDesired * ArActionPlanAndMoveToGoal::stop | ( | double | obsDist,
|  | double | linVel,
|  | double | rotVel,
|  | double | currentDecel |
| ) |  |  |

Stop the robot. Brake harder if necessary.

: Distance to obstacle on the current path. : Current linear velocity. : Current rotational velocity. : Current deceleration.

Returns:
  The action desired filled in.