Klamp't  0.8.1
Public Types | Public Member Functions | Public Attributes | List of all members
DynamicMotionPlannerBase Class Reference

A base class for a motion planner that generates dynamic paths. The output should always respect joint, velocity, and acceleration limits and end in a zero-velocity terminal states. More...

#include <RealTimePlanner.h>

Inheritance diagram for DynamicMotionPlannerBase:
DynamicHybridTreePlanner DynamicIKPlanner DynamicPerturbationIKPlanner DynamicPerturbationPlanner DynamicRRTPlanner

Public Types

enum  { Failure =0, Success =1, Timeout =2 }

Public Member Functions

virtual void Init (CSpace *space, Robot *robot, WorldPlannerSettings *settings)
virtual void SetGoal (shared_ptr< PlannerObjectiveBase > newgoal)
virtual void SetTime (Real tstart)
virtual void SetDefaultLimits ()
virtual void SetLimits (Real qScale=1.0, Real vScale=1.0, Real aScale=1.0)
bool LogBegin (const char *fn="realtimeplanner.log")
bool LogEnd ()
virtual int PlanFrom (ParabolicRamp::DynamicPath &path, Real cutoff)
int PlanFrom (const Config &qstart, Real cutoff, ParabolicRamp::DynamicPath &result)
 Plans from a start configuration.
bool StopPlanning ()
int Shortcut (ParabolicRamp::DynamicPath &path, Real timeLimit)
 Performs shortcutting up until the time limit.
int SmartShortcut (Real tstart, ParabolicRamp::DynamicPath &path, Real timeLimit)
bool GetMilestoneRamp (const Config &q0, const Vector &dq0, const Config &q1, ParabolicRamp::DynamicPath &ramp) const
bool GetMilestoneRamp (const ParabolicRamp::DynamicPath &curPath, const Config &q, ParabolicRamp::DynamicPath &ramp) const
bool CheckMilestoneRamp (const ParabolicRamp::DynamicPath &curPath, const Config &q, ParabolicRamp::DynamicPath &ramp) const
Real EvaluateDirectPathCost (const ParabolicRamp::DynamicPath &curPath, const Config &q)
 returns the cost of going straight to q (assuming no collision detection)
Real EvaluatePathCost (const ParabolicRamp::DynamicPath &path, Real tStart=-1.0)
Real EvaluateTerminalCost (const Config &q, Real tEnd)
 returns the terminal cost for a path ending at q at time tEnd

Public Attributes

CSpace * cspace
shared_ptr< PlannerObjectiveBasegoal
ParabolicRamp::Vector qMin
ParabolicRamp::Vector qMax
ParabolicRamp::Vector velMax
ParabolicRamp::Vector accMax
Real tstart
bool stopPlanning
FILE * flog

Detailed Description

A base class for a motion planner that generates dynamic paths. The output should always respect joint, velocity, and acceleration limits and end in a zero-velocity terminal states.

Important note: the objects pointed to by CSpace* space, Robot *robot, and WorldPlannerSettings *settings must be owned by an outside source. Make sure to pass a shared_ptr to SetGoal if you are going to use the objective elsewhere.

Member Function Documentation

Real DynamicMotionPlannerBase::EvaluatePathCost ( const ParabolicRamp::DynamicPath path,
Real  tStart = -1.0 

returns the cost of using the given path. If tStart is not given, this uses the previously set tstart

Referenced by PlanFrom().

virtual int DynamicMotionPlannerBase::PlanFrom ( ParabolicRamp::DynamicPath path,
Real  cutoff 

DynamicMotionPlanner subclasses should override this. Plans from the start of 'path', and returns the result in 'path'. The planning duration should not exceed 'cutoff', if possible.

Must return Success if successful, Failure if planning fails.

Subroutines may maintain a timer, and stop and return Timeout planning time exceeds the cutoff. This is not strictly necessary; the caller should check whether the planning time exceeds the cutoff.

Reimplemented in DynamicHybridTreePlanner, DynamicPerturbationIKPlanner, DynamicPerturbationPlanner, DynamicRRTPlanner, and DynamicIKPlanner.

Referenced by PlanFrom().

int DynamicMotionPlannerBase::SmartShortcut ( Real  tstart,
ParabolicRamp::DynamicPath path,
Real  timeLimit 

Performs shortcuts that reduce the objective function, only on the portion of the path after time tstart

Referenced by PlanFrom().

bool DynamicMotionPlannerBase::StopPlanning ( )

Tells the planner to stop. Can be called from an external thread.

Subclasses should detect if stopPlanning is set to true and return Timeout.

Referenced by PlanFrom().

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