37 #ifndef OMPL_GEOMETRIC_PATH_GEOMETRIC_
38 #define OMPL_GEOMETRIC_PATH_GEOMETRIC_
40 #include "ompl/base/SpaceInformation.h"
41 #include "ompl/base/Path.h"
82 virtual double length(
void)
const;
85 virtual bool check(
void)
const;
116 virtual void print(std::ostream &out)
const;
void interpolate(void)
Insert a number of states in a path so that the path is made up of (approximately) the states checked...
void keepAfter(const base::State *state)
Keep the part of the path that is after state (getClosestIndex() is used to find out which way-point ...
Path(const SpaceInformationPtr &si)
Constructor. A path must always know the space information it is part of.
void copyFrom(const PathGeometric &other)
Copy data to this path from another path instance.
void overlay(const PathGeometric &over, unsigned int startIndex=0)
Overlay the path over on top of the current path. States are added to the current path if needed (by ...
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...
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...
void append(const base::State *state)
Append state to the end of this path. The memory for state is copied.
PathGeometric(const base::SpaceInformationPtr &si)
Construct a path instance for a given space information.
base::State * getState(unsigned int index)
Get the state located at index along the path.
std::size_t getStateCount(void) const
Get the number of states (way-points) that make up this path.
std::pair< bool, bool > checkAndRepair(unsigned int attempts)
Check if the path is valid. If it is not, attempts are made to fix the path by sampling around invali...
void subdivide(void)
Add a state at the middle of each segment.
bool randomValid(unsigned int attempts)
Set this path to a random valid segment. Sample attempts times for valid segments. Returns true on success.
virtual bool check(void) const
Check if the path is valid.
int getClosestIndex(const base::State *state) const
Get the index of the way-point along the path that is closest to state. Returns -1 for an empty path...
Abstract definition of a path.
void reverse(void)
Reverse the path.
Definition of an abstract state.
PathGeometric & operator=(const PathGeometric &other)
Assignment operator.
void keepBefore(const base::State *state)
Keep the part of the path that is before state (getClosestIndex() is used to find out which way-point...
const base::State * getState(unsigned int index) const
Get the state located at index along the path.
std::vector< base::State * > states_
The list of states that make up the path.
Definition of a geometric path.
void random(void)
Set this path to a random segment.
virtual double length(void) const
Compute the length of a geometric path (sum of lengths of segments that make up the path) ...
void freeMemory(void)
Free the memory corresponding to the states on this path.
virtual void print(std::ostream &out) const
Print the path to a stream.
double smoothness(void) const
Compute a notion of smoothness for this path. The closer the value is to 0, the smoother the path...
double clearance(void) const
Compute the clearance of the way-points along the path (no interpolation is performed). Detailed formula follows.