openrave.org

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Typedefs | Functions
OpenRAVE::planningutils Namespace Reference

Classes

class  ActiveDOFTrajectorySmoother
 Smoother planner for the trajectory points to avoiding collisions by extracting and using the currently set active dofs of the robot. More...
 
class  ActiveDOFTrajectoryRetimer
 Retimer planner the trajectory points by extracting and using the currently set active dofs of the robot. [multi-thread safe] More...
 
class  AffineTrajectoryRetimer
 Retimer planner the trajectory points consisting of affine transformation values while avoiding collisions. [multi-thread safe] More...
 
class  DHParameter
 represents the DH parameters for one joint More...
 
class  LineCollisionConstraint
 Line collision. More...
 
class  SimpleDistanceMetric
 simple distance metric based on joint weights More...
 
class  SimpleNeighborhoodSampler
 samples the neighborhood of a configuration using the configuration space distance metric and sampler. More...
 
class  ManipulatorIKGoalSampler
 Samples numsamples of solutions and each solution to vsolutions. More...
 
class  TrajectoryVerifier
 
class  PlannerStateSaver
 

Typedefs

typedef boost::shared_ptr
< ActiveDOFTrajectorySmoother
ActiveDOFTrajectorySmootherPtr
 
typedef boost::shared_ptr
< ActiveDOFTrajectoryRetimer
ActiveDOFTrajectoryRetimerPtr
 
typedef boost::shared_ptr
< AffineTrajectoryRetimer
AffineTrajectoryRetimerPtr
 
typedef boost::shared_ptr
< ManipulatorIKGoalSampler
ManipulatorIKGoalSamplerPtr
 

Functions

OPENRAVE_API int JitterActiveDOF (RobotBasePtr robot, int nMaxIterations=5000, dReal fRand=0.03f, const PlannerBase::PlannerParameters::NeighStateFn &neighstatefn=PlannerBase::PlannerParameters::NeighStateFn())
 Jitters the active joint angles of the robot until it escapes collision.
 
OPENRAVE_API bool JitterTransform (KinBodyPtr pbody, float fJitter, int nMaxIterations=1000)
 Jitters the transform of a body until it escapes collision.
 
OPENRAVE_API void VerifyTrajectory (PlannerBase::PlannerParametersConstPtr parameters, TrajectoryBaseConstPtr trajectory, dReal samplingstep=0.002)
 validates a trajectory with respect to the planning constraints. [multi-thread safe]
 
OPENRAVE_API PlannerStatus SmoothActiveDOFTrajectory (TrajectoryBasePtr traj, RobotBasePtr robot, dReal fmaxvelmult=1, dReal fmaxaccelmult=1, const std::string &plannername="", const std::string &plannerparameters="")
 Smooth the trajectory points to avoiding collisions by extracting and using the currently set active dofs of the robot. [multi-thread safe]
 
OPENRAVE_API PlannerStatus SmoothAffineTrajectory (TrajectoryBasePtr traj, const std::vector< dReal > &maxvelocities, const std::vector< dReal > &maxaccelerations, const std::string &plannername="", const std::string &plannerparameters="")
 Smooth the trajectory points consisting of affine transformation values while avoiding collisions. [multi-thread safe]
 
OPENRAVE_API PlannerStatus SmoothTrajectory (TrajectoryBasePtr traj, dReal fmaxvelmult=1, dReal fmaxaccelmult=1, const std::string &plannername="", const std::string &plannerparameters="")
 Smooth the trajectory points to avoiding collisions by extracting and using the positional data from the trajectory. [multi-thread safe]
 
OPENRAVE_API PlannerStatus RetimeActiveDOFTrajectory (TrajectoryBasePtr traj, RobotBasePtr robot, bool hastimestamps=false, dReal fmaxvelmult=1, dReal fmaxaccelmult=1, const std::string &plannername="", const std::string &plannerparameters="")
 Retime the trajectory points by extracting and using the currently set active dofs of the robot. [multi-thread safe]
 
OPENRAVE_API PlannerStatus RetimeAffineTrajectory (TrajectoryBasePtr traj, const std::vector< dReal > &maxvelocities, const std::vector< dReal > &maxaccelerations, bool hastimestamps=false, const std::string &plannername="", const std::string &plannerparameters="")
 Retime the trajectory points consisting of affine transformation values while avoiding collisions. [multi-thread safe]
 
OPENRAVE_API PlannerStatus RetimeTrajectory (TrajectoryBasePtr traj, bool hastimestamps=false, dReal fmaxvelmult=1, dReal fmaxaccelmult=1, const std::string &plannername="", const std::string &plannerparameters="")
 Retime the trajectory points using all the positional data from the trajectory. [multi-thread safe]
 
OPENRAVE_API void InsertActiveDOFWaypointWithRetiming (int index, const std::vector< dReal > &dofvalues, const std::vector< dReal > &dofvelocities, TrajectoryBasePtr traj, RobotBasePtr robot, dReal fmaxvelmult=1, dReal fmaxaccelmult=1, const std::string &plannername="")
 Inserts a waypoint into a trajectory at the index specified, and retimes the segment before and after the trajectory. [multi-thread safe]
 
OPENRAVE_API void InsertWaypointWithSmoothing (int index, const std::vector< dReal > &dofvalues, const std::vector< dReal > &dofvelocities, TrajectoryBasePtr traj, dReal fmaxvelmult=1, dReal fmaxaccelmult=1, const std::string &plannername="")
 insert a waypoint in a timed trajectory and smooth so that the trajectory always goes through the waypoint at the specified velocity.
 
OPENRAVE_API void ConvertTrajectorySpecification (TrajectoryBasePtr traj, const ConfigurationSpecification &spec)
 convert the trajectory and all its points to a new specification
 
OPENRAVE_API void ComputeTrajectoryDerivatives (TrajectoryBasePtr traj, int maxderiv)
 computes the trajectory derivatives and modifies the trajetory configuration to store them.
 
OPENRAVE_API TrajectoryBasePtr ReverseTrajectory (TrajectoryBaseConstPtr traj)
 returns a new trajectory with the order of the waypoints and times reversed.
 
OPENRAVE_API TrajectoryBasePtr MergeTrajectories (const std::list< TrajectoryBaseConstPtr > &listtrajectories)
 merges the contents of multiple trajectories into one so that everything can be played simultaneously.
 
OPENRAVE_API void GetDHParameters (std::vector< DHParameter > &vparameters, KinBodyConstPtr pbody)
 returns the Denavit-Hartenberg parameters of the kinematics structure of the body.
 
PlannerStatus _PlanActiveDOFTrajectory (TrajectoryBasePtr traj, RobotBasePtr probot, bool hastimestamps, dReal fmaxvelmult, dReal fmaxaccelmult, const std::string &plannername, bool bsmooth, const std::string &plannerparameters)
 
PlannerStatus _PlanTrajectory (TrajectoryBasePtr traj, bool hastimestamps, dReal fmaxvelmult, dReal fmaxaccelmult, const std::string &plannername, bool bsmooth, const std::string &plannerparameters)
 
static void diffstatefn (std::vector< dReal > &q1, const std::vector< dReal > &q2, const std::vector< int > vrotaxes)
 
static void _SetTransformBody (std::vector< dReal >::const_iterator itvalues, KinBodyPtr pbody, int index, int affinedofs, const Vector &vActvAffineRotationAxis)
 
static void _GetTransformBody (std::vector< dReal >::iterator itvalues, KinBodyPtr pbody, int index, int affinedofs, const Vector &vActvAffineRotationAxis)
 
static dReal _ComputeTransformBodyDistance (std::vector< dReal >::const_iterator itvalues0, std::vector< dReal >::const_iterator itvalues1, KinBodyPtr pbody, int index, int affinedofs, const Vector &vActvAffineRotationAxis)
 
void _SetAffineState (const std::vector< dReal > &v, const std::list< boost::function< void(std::vector< dReal >::const_iterator) > > &listsetfunctions)
 
void _GetAffineState (std::vector< dReal > &v, size_t expectedsize, const std::list< boost::function< void(std::vector< dReal >::iterator) > > &listgetfunctions)
 
dReal _ComputeAffineDistanceMetric (const std::vector< dReal > &v0, const std::vector< dReal > &v1, const std::list< boost::function< dReal(std::vector< dReal >::const_iterator, std::vector< dReal >::const_iterator) > > &listdistfunctions)
 
static PlannerStatus _PlanAffineTrajectory (TrajectoryBasePtr traj, const std::vector< dReal > &maxvelocities, const std::vector< dReal > &maxaccelerations, bool hastimestamps, const std::string &plannername, bool bsmooth, const std::string &plannerparameters)
 
static std::string GetPlannerFromInterpolation (TrajectoryBasePtr traj, const std::string &forceplanner=std::string())
 

Typedef Documentation

Definition at line 167 of file planningutils.h.

Definition at line 95 of file planningutils.h.

Definition at line 219 of file planningutils.h.

Definition at line 432 of file planningutils.h.

Function Documentation

dReal OpenRAVE::planningutils::_ComputeAffineDistanceMetric ( const std::vector< dReal > &  v0,
const std::vector< dReal > &  v1,
const std::list< boost::function< dReal(std::vector< dReal >::const_iterator, std::vector< dReal >::const_iterator) > > &  listdistfunctions 
)

Definition at line 530 of file planningutils.cpp.

static dReal OpenRAVE::planningutils::_ComputeTransformBodyDistance ( std::vector< dReal >::const_iterator  itvalues0,
std::vector< dReal >::const_iterator  itvalues1,
KinBodyPtr  pbody,
int  index,
int  affinedofs,
const Vector &  vActvAffineRotationAxis 
)
static

Definition at line 506 of file planningutils.cpp.

void OpenRAVE::planningutils::_GetAffineState ( std::vector< dReal > &  v,
size_t  expectedsize,
const std::list< boost::function< void(std::vector< dReal >::iterator) > > &  listgetfunctions 
)

Definition at line 522 of file planningutils.cpp.

static void OpenRAVE::planningutils::_GetTransformBody ( std::vector< dReal >::iterator  itvalues,
KinBodyPtr  pbody,
int  index,
int  affinedofs,
const Vector &  vActvAffineRotationAxis 
)
static

Definition at line 500 of file planningutils.cpp.

PlannerStatus OpenRAVE::planningutils::_PlanActiveDOFTrajectory ( TrajectoryBasePtr  traj,
RobotBasePtr  probot,
bool  hastimestamps,
dReal  fmaxvelmult,
dReal  fmaxaccelmult,
const std::string &  plannername,
bool  bsmooth,
const std::string &  plannerparameters 
)

Definition at line 303 of file planningutils.cpp.

static PlannerStatus OpenRAVE::planningutils::_PlanAffineTrajectory ( TrajectoryBasePtr  traj,
const std::vector< dReal > &  maxvelocities,
const std::vector< dReal > &  maxaccelerations,
bool  hastimestamps,
const std::string &  plannername,
bool  bsmooth,
const std::string &  plannerparameters 
)
static

Definition at line 557 of file planningutils.cpp.

PlannerStatus OpenRAVE::planningutils::_PlanTrajectory ( TrajectoryBasePtr  traj,
bool  hastimestamps,
dReal  fmaxvelmult,
dReal  fmaxaccelmult,
const std::string &  plannername,
bool  bsmooth,
const std::string &  plannerparameters 
)

Definition at line 435 of file planningutils.cpp.

void OpenRAVE::planningutils::_SetAffineState ( const std::vector< dReal > &  v,
const std::list< boost::function< void(std::vector< dReal >::const_iterator) > > &  listsetfunctions 
)

Definition at line 515 of file planningutils.cpp.

static void OpenRAVE::planningutils::_SetTransformBody ( std::vector< dReal >::const_iterator  itvalues,
KinBodyPtr  pbody,
int  index,
int  affinedofs,
const Vector &  vActvAffineRotationAxis 
)
static

Definition at line 493 of file planningutils.cpp.

void OpenRAVE::planningutils::ComputeTrajectoryDerivatives ( TrajectoryBasePtr  traj,
int  maxderiv 
)

computes the trajectory derivatives and modifies the trajetory configuration to store them.

If necessary will change the configuration specification of the trajectory. If more derivatives are requested than the trajectory supports, will ignore them. For example, acceleration of a linear trajectory.

Parameters
trajthe re-timed trajectory
maxderivthe maximum derivative to assure. If 1, will assure velocities, if 2 will assure accelerations, etc.

Definition at line 1117 of file planningutils.cpp.

void OpenRAVE::planningutils::ConvertTrajectorySpecification ( TrajectoryBasePtr  traj,
const ConfigurationSpecification &  spec 
)

convert the trajectory and all its points to a new specification

Definition at line 1102 of file planningutils.cpp.

static void OpenRAVE::planningutils::diffstatefn ( std::vector< dReal > &  q1,
const std::vector< dReal > &  q2,
const std::vector< int >  vrotaxes 
)
static

Definition at line 480 of file planningutils.cpp.

void OpenRAVE::planningutils::GetDHParameters ( std::vector< DHParameter > &  vparameters,
KinBodyConstPtr  pbody 
)

returns the Denavit-Hartenberg parameters of the kinematics structure of the body.

If the robot has joints that cannot be represented by DH, will throw an exception. Passive joints are ignored. Joints are ordered by hierarchy dependency. By convention N joints give N-1 DH parameters, but GetDHParameters returns N parameters. The reason is because the first parameter is used to define the coordinate system of the first axis relative to the robot origin.

Note
The coordinate systems computed from the DH parameters do not match the OpenRAVE link coordinate systems.
Parameters
vparametersOne set of parameters are returned for each joint.
See Also
DHParameter.
Parameters
tstartthe initial transform in the body coordinate system to the first joint

Definition at line 1331 of file planningutils.cpp.

static std::string OpenRAVE::planningutils::GetPlannerFromInterpolation ( TrajectoryBasePtr  traj,
const std::string &  forceplanner = std::string() 
)
static

Definition at line 838 of file planningutils.cpp.

void OpenRAVE::planningutils::InsertActiveDOFWaypointWithRetiming ( int  index,
const std::vector< dReal > &  dofvalues,
const std::vector< dReal > &  dofvelocities,
TrajectoryBasePtr  traj,
RobotBasePtr  robot,
dReal  fmaxvelmult = 1,
dReal  fmaxaccelmult = 1,
const std::string &  plannername = "" 
)

Inserts a waypoint into a trajectory at the index specified, and retimes the segment before and after the trajectory. [multi-thread safe]

Collision is not checked on the modified segments of the trajectory.

Parameters
indexThe index where to start modifying the trajectory.
dofvaluesthe configuration to insert into the trajectcory (active dof values of the robot)
dofvelocitiesthe velocities that the inserted point should start with
trajthe trajectory that initially contains the input points, it is modified to contain the new re-timed data.
robotuse the robot's active dofs to initialize the trajectory space
plannernamethe name of the planner to use to retime. If empty, will use the default trajectory re-timer.

Definition at line 884 of file planningutils.cpp.

void OpenRAVE::planningutils::InsertWaypointWithSmoothing ( int  index,
const std::vector< dReal > &  dofvalues,
const std::vector< dReal > &  dofvelocities,
TrajectoryBasePtr  traj,
dReal  fmaxvelmult = 1,
dReal  fmaxaccelmult = 1,
const std::string &  plannername = "" 
)

insert a waypoint in a timed trajectory and smooth so that the trajectory always goes through the waypoint at the specified velocity.

The PlannerParameters is automatically determined from the trajectory's configuration space

Parameters
[in]indexThe index where to insert the new waypoint. A negative value starts from the end.
dofvaluesthe configuration to insert into the trajectcory (active dof values of the robot)
dofvelocitiesthe velocities that the inserted point should start with
trajthe trajectory that initially contains the input points, it is modified to contain the new re-timed data.
plannernamethe name of the planner to use to smooth. If empty, will use the default trajectory smoother.

Definition at line 974 of file planningutils.cpp.

int OpenRAVE::planningutils::JitterActiveDOF ( RobotBasePtr  robot,
int  nMaxIterations = 5000,
dReal  fRand = 0.03f,
const PlannerBase::PlannerParameters::NeighStateFn &  neighstatefn = PlannerBase::PlannerParameters::NeighStateFn() 
)

Jitters the active joint angles of the robot until it escapes collision.

Return 0 if jitter failed and robot is in collision, -1 if robot originally not in collision, 1 if jitter succeeded and position is different.

Definition at line 25 of file planningutils.cpp.

bool OpenRAVE::planningutils::JitterTransform ( KinBodyPtr  pbody,
float  fJitter,
int  nMaxIterations = 1000 
)

Jitters the transform of a body until it escapes collision.

Definition at line 131 of file planningutils.cpp.

TrajectoryBasePtr OpenRAVE::planningutils::MergeTrajectories ( const std::list< TrajectoryBaseConstPtr > &  listtrajectories)

merges the contents of multiple trajectories into one so that everything can be played simultaneously.

Each trajectory needs to have a 'deltatime' group for timestamps. The trajectories cannot share common configuration data because only one trajectories's data can be set at a time.

Exceptions
openrave_exceptionthrows an exception if the trajectory data is incompatible and cannot be merged.

Definition at line 1229 of file planningutils.cpp.

PlannerStatus OpenRAVE::planningutils::RetimeActiveDOFTrajectory ( TrajectoryBasePtr  traj,
RobotBasePtr  robot,
bool  hastimestamps = false,
dReal  fmaxvelmult = 1,
dReal  fmaxaccelmult = 1,
const std::string &  plannername = "",
const std::string &  plannerparameters = "" 
)

Retime the trajectory points by extracting and using the currently set active dofs of the robot. [multi-thread safe]

Collision is not checked. Every waypoint in the trajectory is guaranteed to be hit. The velocities for the current trajectory are overwritten. The returned trajectory will contain data only for the currenstly set active dofs of the robot.

Parameters
trajthe trajectory that initially contains the input points, it is modified to contain the new re-timed data.
robotuse the robot's active dofs to initialize the trajectory space
plannernamethe name of the planner to use to retime. If empty, will use the default trajectory re-timer.
hastimestampsif true, use the already initialized timestamps of the trajectory
plannerparametersXML string to be appended to PlannerBase::PlannerParameters::_sExtraParameters passed in to the planner.
Returns
PlannerStatus of the status of the retiming planner

Definition at line 869 of file planningutils.cpp.

PlannerStatus OpenRAVE::planningutils::RetimeAffineTrajectory ( TrajectoryBasePtr  traj,
const std::vector< dReal > &  maxvelocities,
const std::vector< dReal > &  maxaccelerations,
bool  hastimestamps = false,
const std::string &  plannername = "",
const std::string &  plannerparameters = "" 
)

Retime the trajectory points consisting of affine transformation values while avoiding collisions. [multi-thread safe]

Collision is not checked. Every waypoint in the trajectory is guaranteed to be hit. The velocities for the current trajectory are overwritten.

Parameters
trajthe trajectory that initially contains the input points, it is modified to contain the new re-timed data.
maxvelocitiesthe max velocities of each dof
maxaccelerationsthe max acceleration of each dof
plannernamethe name of the planner to use to retime. If empty, will use the default trajectory re-timer.
hastimestampsif true, use the already initialized timestamps of the trajectory
plannerparametersXML string to be appended to PlannerBase::PlannerParameters::_sExtraParameters passed in to the planner.
Returns
PlannerStatus of the status of the retiming planner
Examples:
orpr2turnlever.cpp.

Definition at line 874 of file planningutils.cpp.

PlannerStatus OpenRAVE::planningutils::RetimeTrajectory ( TrajectoryBasePtr  traj,
bool  hastimestamps = false,
dReal  fmaxvelmult = 1,
dReal  fmaxaccelmult = 1,
const std::string &  plannername = "",
const std::string &  plannerparameters = "" 
)

Retime the trajectory points using all the positional data from the trajectory. [multi-thread safe]

Collision is not checked. Every waypoint in the trajectory is guaranteed to be hit. The velocities for the current trajectory are overwritten. The returned trajectory will contain data only for the currenstly set active dofs of the robot.

Parameters
trajthe trajectory that initially contains the input points, it is modified to contain the new re-timed data.
plannernamethe name of the planner to use to retime. If empty, will use the default trajectory re-timer.
hastimestampsif true, use the already initialized timestamps of the trajectory
plannerparametersXML string to be appended to PlannerBase::PlannerParameters::_sExtraParameters passed in to the planner.
Returns
PlannerStatus of the status of the retiming planner

Definition at line 879 of file planningutils.cpp.

TrajectoryBasePtr OpenRAVE::planningutils::ReverseTrajectory ( TrajectoryBaseConstPtr  traj)

returns a new trajectory with the order of the waypoints and times reversed.

Velocities are just negated and the new trajectory is not guaranteed to be executable or valid

Examples:
orpr2turnlever.cpp.

Definition at line 1171 of file planningutils.cpp.

PlannerStatus OpenRAVE::planningutils::SmoothActiveDOFTrajectory ( TrajectoryBasePtr  traj,
RobotBasePtr  robot,
dReal  fmaxvelmult = 1,
dReal  fmaxaccelmult = 1,
const std::string &  plannername = "",
const std::string &  plannerparameters = "" 
)

Smooth the trajectory points to avoiding collisions by extracting and using the currently set active dofs of the robot. [multi-thread safe]

Only initial and goal configurations are preserved. The velocities for the current trajectory are overwritten. The returned trajectory will contain data only for the currenstly set active dofs of the robot.

Parameters
trajthe trajectory that initially contains the input points, it is modified to contain the new re-timed data.
robotuse the robot's active dofs to initialize the trajectory space
plannernamethe name of the planner to use to smooth. If empty, will use the default trajectory re-timer.
plannerparametersXML string to be appended to PlannerBase::PlannerParameters::_sExtraParameters passed in to the planner.
Returns
PlannerStatus of the status of the smoothing planner
Examples:
ormulticontrol.cpp, and ortrajectory.cpp.

Definition at line 823 of file planningutils.cpp.

PlannerStatus OpenRAVE::planningutils::SmoothAffineTrajectory ( TrajectoryBasePtr  traj,
const std::vector< dReal > &  maxvelocities,
const std::vector< dReal > &  maxaccelerations,
const std::string &  plannername = "",
const std::string &  plannerparameters = "" 
)

Smooth the trajectory points consisting of affine transformation values while avoiding collisions. [multi-thread safe]

Only initial and goal configurations are preserved.

Parameters
trajthe trajectory that initially contains the input points, it is modified to contain the new re-timed data.
maxvelocitiesthe max velocities of each dof
maxaccelerationsthe max acceleration of each dof
plannernamethe name of the planner to use to smooth. If empty, will use the default trajectory re-timer.
plannerparametersXML string to be appended to PlannerBase::PlannerParameters::_sExtraParameters passed in to the planner.
Returns
PlannerStatus of the status of the smoothing planner

Definition at line 828 of file planningutils.cpp.

PlannerStatus OpenRAVE::planningutils::SmoothTrajectory ( TrajectoryBasePtr  traj,
dReal  fmaxvelmult = 1,
dReal  fmaxaccelmult = 1,
const std::string &  plannername = "",
const std::string &  plannerparameters = "" 
)

Smooth the trajectory points to avoiding collisions by extracting and using the positional data from the trajectory. [multi-thread safe]

Only initial and goal configurations are preserved. The velocities for the current trajectory are overwritten. The returned trajectory will contain data only for the currenstly set active dofs of the robot.

Parameters
trajthe trajectory that initially contains the input points, it is modified to contain the new re-timed data.
plannernamethe name of the planner to use to smooth. If empty, will use the default trajectory re-timer.
plannerparametersXML string to be appended to PlannerBase::PlannerParameters::_sExtraParameters passed in to the planner.
Returns
PlannerStatus of the status of the smoothing planner

Definition at line 833 of file planningutils.cpp.

void OpenRAVE::planningutils::VerifyTrajectory ( PlannerBase::PlannerParametersConstPtr  parameters,
TrajectoryBaseConstPtr  trajectory,
dReal  samplingstep = 0.002 
)

validates a trajectory with respect to the planning constraints. [multi-thread safe]

checks internal data structures and verifies that all trajectory via points do not violate joint position, velocity, and acceleration limits.

Parameters
parametersthe planner parameters passed to the planner that returned the trajectory. If not initialized, will attempt to create a new PlannerParameters structure from trajectory->GetConfigurationSpecification()
trajectorytrajectory of points to be checked
samplingstepIf == 0, then will only test the supports points in trajectory->GetPoints(). If > 0, then will sample the trajectory at this time interval and check that smoothness is satisfied along with segment constraints.
Exceptions
openrave_exceptionIf the trajectory is invalid, will throw ORE_InconsistentConstraints.

Definition at line 291 of file planningutils.cpp.