37 #ifndef OMPL_CONTROL_PATH_CONTROL_
38 #define OMPL_CONTROL_PATH_CONTROL_
40 #include "ompl/control/SpaceInformation.h"
41 #include "ompl/base/Path.h"
42 #include "ompl/geometric/PathGeometric.h"
73 virtual double length(
void)
const;
76 virtual bool check(
void)
const;
79 virtual void print(std::ostream &out)
const;
virtual void printAsMatrix(std::ostream &out) const
Print the path as a real-valued matrix where the i-th row represents the i-th state along the path...
PathControl & operator=(const PathControl &other)
Assignment operator.
void freeMemory(void)
Free the memory allocated by the path.
Control * getControl(unsigned int index)
Get the control located at index along the path. This is the control that gets applied to the state l...
double getControlDuration(unsigned int index) const
Get the duration of the control at index, which gets applied to the state at index.
void append(const base::State *state)
Append state to the end of the path; it is assumed state is the first state, so no control is applied...
Definition of an abstract control.
virtual double length(void) const
The path length (sum of control durations)
Definition of a control path.
virtual void print(std::ostream &out) const
Print the path to a stream.
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 no...
base::State * getState(unsigned int index)
Get the state located at index along the path.
geometric::PathGeometric asGeometric(void) const
Convert this path into a geometric path (interpolation is performed and then states are copied) ...
const base::State * getState(unsigned int index) const
Get the state located at index along the path.
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 ...
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.
Abstract definition of a path.
void interpolate(void)
Make the path such that all controls are applied for a single time step (computes intermediate states...
Definition of an abstract state.
const Control * getControl(unsigned int index) const
Get the control located at index along the path. This is the control that gets applied to the state l...
std::size_t getControlCount(void) const
Get the number of controls applied along this path. This should be equal to getStateCount() - 1 unles...
std::vector< double > controlDurations_
The duration of the control applied at each state. This array contains one element less than the list...
std::vector< base::State * > states_
The list of states that make up the path.
PathControl(const base::SpaceInformationPtr &si)
Constructor.
virtual bool check(void) const
Check if the path is valid.
Definition of a geometric path.
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)
void copyFrom(const PathControl &other)
Copy the content of a path to this one.
std::size_t getStateCount(void) const
Get the number of states (way-points) that make up this path.
std::vector< Control * > controls_
The control applied at each state. This array contains one element less than the list of states...