All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
ompl::control::PathControl Class Reference

Definition of a control path. More...

#include <PathControl.h>

Inheritance diagram for ompl::control::PathControl:

List of all members.

Public Member Functions

 PathControl (const base::SpaceInformationPtr &si)
 Constructor.
 PathControl (const PathControl &path)
 Copy constructor.
PathControloperator= (const PathControl &other)
 Assignment operator.
virtual double length (void) const
 The path length (sum of control durations)
virtual bool check (void) const
 Check if the path is valid.
virtual void print (std::ostream &out) const
 Print the path to a stream.
geometric::PathGeometric asGeometric (void) const
 Convert this path into a geometric path (interpolation is performed and then states are copied)
Path operations
void append (const base::State *state)
 Append state to the end of the path; it is assumed state is the last state, so no control is applied. The memory for state is copied. There are no checks to make sure the number of controls and states make sense.
void append (const base::State *state, const Control *control, double duration)
 Append state to the end of the path and assume control is applied for the duration duration. The memory for state and for control is copied. There are no checks to make sure the number of controls and states make sense.
void interpolate (void)
 Make the path such that all controls are applied for a single time step (computes intermediate states)
void random (void)
 Set this path to a random segment.
bool randomValid (unsigned int attempts)
 Set this path to a random valid segment. Sample attempts times for valid segments. Returns true on success.
Functionality for accessing states and controls
std::vector< base::State * > & getStates (void)
 Get the states that make up the path (as a reference, so it can be modified, hence the function is not const)
std::vector< Control * > & getControls (void)
 Get the controls that make up the path (as a reference, so it can be modified, hence the function is not const)
std::vector< double > & getControlDurations (void)
 Get the control durations used along the path (as a reference, so it can be modified, hence the function is not const)
base::StategetState (unsigned int index)
 Get the state located at index along the path.
const base::StategetState (unsigned int index) const
 Get the state located at index along the path.
ControlgetControl (unsigned int index)
 Get the control located at index along the path. This is the control that gets applied to the state located at index.
const ControlgetControl (unsigned int index) const
 Get the control located at index along the path. This is the control that gets applied to the state located at index.
double getControlDuration (unsigned int index) const
 Get the duration of the control at index, which gets applied to the state at index.
std::size_t getStateCount (void) const
 Get the number of states (way-points) that make up this path.
std::size_t getControlCount (void) const
 Get the number of controls applied along this path. This should be equal to getStateCount() - 1 unless there are 0 states, in which case the number of controls will also be 0.

Protected Member Functions

void freeMemory (void)
 Free the memory allocated by the path.
void copyFrom (const PathControl &other)
 Copy the content of a path to this one.

Protected Attributes

std::vector< base::State * > states_
 The list of states that make up the path.
std::vector< Control * > controls_
 The control applied at each state. This array contains one element less than the list of states.
std::vector< double > controlDurations_
 The duration of the control applied at each state. This array contains one element less than the list of states.

Detailed Description

Definition of a control path.

This is the type of path produced when planning with differential constraints.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends