PathGeometric.cpp
51 ompl::geometric::PathGeometric::PathGeometric(const base::SpaceInformationPtr &si, const base::State *state)
58 ompl::geometric::PathGeometric::PathGeometric(const base::SpaceInformationPtr &si, const base::State *state1,
67 ompl::geometric::PathGeometric::PathGeometric(const base::SpaceInformationPtr &si, std::vector<const base::State *> &states)
76 ompl::geometric::PathGeometric &ompl::geometric::PathGeometric::operator=(const PathGeometric &other)
100 ompl::base::Cost ompl::geometric::PathGeometric::cost(const base::OptimizationObjectivePtr &opt) const
265 radius = std::max(si_->distance(states_[i - 1], temp), si_->distance(states_[i - 1], states_[i]));
364 // compute an approximate number of states the following segment needs to contain; this includes endpoints
367 i + 1 == n1 ? maxNStates + 2 : (int)floor(0.5 + (double)count * segmentLength / remainingLength) + 1;
441 void ompl::geometric::PathGeometric::overlay(const PathGeometric &over, unsigned int startIndex)
bool randomValid(unsigned int attempts)
Set this path to a random valid segment. Sample attempts times for valid segments....
Definition: PathGeometric.cpp:415
Representation of a space in which planning can be performed. Topology specific sampling,...
Definition: StateSpace.h:134
void prepend(const base::State *state)
Prepend state to the start of this path. The memory for state is copied.
Definition: PathGeometric.cpp:479
AdvancedStateCopyOperation copyStateData(const StateSpacePtr &destS, State *dest, const StateSpacePtr &sourceS, const State *source)
Copy data from source (state from space sourceS) to dest (state from space destS) on a component by c...
Definition: StateSpace.cpp:1236
double smoothness() const
Compute a notion of smoothness for this path. The closer the value is to 0, the smoother the path....
Definition: PathGeometric.cpp:132
PathGeometric & operator=(const PathGeometric &other)
Assignment operator.
Definition: PathGeometric.cpp:76
bool sampleNear(State *state, const State *near, double distance) override
Sample a state near another, within specified distance. Return false, in case of failure.
Definition: UniformValidStateSampler.cpp:59
virtual void copyToReals(std::vector< double > &reals, const State *source) const
Copy all the real values from a state source to the array reals using getValueAddressAtLocation()
Definition: StateSpace.cpp:329
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...
Definition: PathGeometric.cpp:502
Definition of a cost value. Can represent the cost of a motion or the cost of a state.
Definition: Cost.h:111
bool sample(State *state) override
Sample a state. Return false in case of failure.
Definition: UniformValidStateSampler.cpp:46
base::Cost cost(const base::OptimizationObjectivePtr &obj) const override
The sum of the costs for the sequence of segments that make up the path, computed using OptimizationO...
Definition: PathGeometric.cpp:100
A state sampler that only samples valid states, uniformly.
Definition: UniformValidStateSampler.h:112
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....
Definition: PathGeometric.cpp:198
void freeMemory()
Free the memory corresponding to the states on this path.
Definition: PathGeometric.cpp:94
std::vector< base::State * > states_
The list of states that make up the path.
Definition: PathGeometric.h:310
void setNrAttempts(unsigned int attempts)
Finding a valid sample usually requires performing multiple attempts. This call allows setting the nu...
Definition: ValidStateSampler.h:160
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.
Definition: PathGeometric.cpp:523
void append(const base::State *state)
Append state to the end of this path. The memory for state is copied.
Definition: PathGeometric.cpp:462
void interpolate()
Insert a number of states in a path so that the path is made up of (approximately) the states checked...
Definition: PathGeometric.cpp:316
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 ...
Definition: PathGeometric.cpp:484
double length() const override
Compute the length of a geometric path (sum of lengths of segments that make up the path)
Definition: PathGeometric.cpp:112
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...
Definition: PathGeometric.cpp:211
void copyFrom(const PathGeometric &other)
Copy data to this path from another path instance.
Definition: PathGeometric.cpp:87
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 ...
Definition: PathGeometric.cpp:441
void print(std::ostream &out) const override
Print the path to a stream.
Definition: PathGeometric.cpp:191
double clearance() const
Compute the clearance of the way-points along the path (no interpolation is performed)....
Definition: PathGeometric.cpp:120
PathGeometric(const base::SpaceInformationPtr &si)
Construct a path instance for a given space information.
Definition: PathGeometric.h:101