37 #ifndef OMPL_GEOMETRIC_PATH_SIMPLIFIER_
38 #define OMPL_GEOMETRIC_PATH_SIMPLIFIER_
40 #include "ompl/base/SpaceInformation.h"
41 #include "ompl/geometric/PathGeometric.h"
42 #include "ompl/base/PlannerTerminationCondition.h"
43 #include "ompl/util/ClassForward.h"
44 #include "ompl/util/RandomNumbers.h"
56 OMPL_CLASS_FORWARD(PathSimplifier);
110 bool reduceVertices(PathGeometric &path,
unsigned int maxSteps = 0,
unsigned int maxEmptySteps = 0,
double rangeRatio = 0.33);
155 bool shortcutPath(PathGeometric &path,
unsigned int maxSteps = 0,
unsigned int maxEmptySteps = 0,
double rangeRatio = 0.33,
double snapToVertex = 0.005);
182 bool collapseCloseVertices(PathGeometric &path,
unsigned int maxSteps = 0,
unsigned int maxEmptySteps = 0);
197 void smoothBSpline(PathGeometric &path,
unsigned int maxSteps = 5,
double minChange = std::numeric_limits<double>::epsilon());
206 void simplify(PathGeometric &path,
double maxTime);
bool shortcutPath(PathGeometric &path, unsigned int maxSteps=0, unsigned int maxEmptySteps=0, double rangeRatio=0.33, double snapToVertex=0.005)
Given a path, attempt to shorten it while maintaining its validity. This is an iterative process that...
void simplify(PathGeometric &path, double maxTime)
Run simplification algorithms on the path for at most maxTime seconds.
PathSimplifier(const base::SpaceInformationPtr &si)
Create an instance for a specified space information.
void simplifyMax(PathGeometric &path)
Given a path, attempt to remove vertices from it while keeping the path valid. Then, try to smooth the path. This function applies the same set of default operations to the path, except in non-metric spaces, with the intention of simplifying it. In non-metric spaces, some operations are skipped because they do not work correctly when the triangle inequality may not hold.
RNG rng_
Instance of random number generator.
Encapsulate a termination condition for a motion planner. Planners will call operator() to decide whe...
Random number generation. An instance of this class cannot be used by multiple threads at once (membe...
bool reduceVertices(PathGeometric &path, unsigned int maxSteps=0, unsigned int maxEmptySteps=0, double rangeRatio=0.33)
Given a path, attempt to remove vertices from it while keeping the path valid. This is an iterative p...
base::SpaceInformationPtr si_
The space information this path simplifier uses.
This class contains routines that attempt to simplify geometric paths.
bool freeStates() const
Return true if the memory of states is freed when they are removed from a path during simplification...
bool collapseCloseVertices(PathGeometric &path, unsigned int maxSteps=0, unsigned int maxEmptySteps=0)
Given a path, attempt to remove vertices from it while keeping the path valid. This is an iterative p...
bool freeStates_
Flag indicating whether the states removed from a motion should be freed.
void smoothBSpline(PathGeometric &path, unsigned int maxSteps=5, double minChange=std::numeric_limits< double >::epsilon())
Given a path, attempt to smooth it (the validity of the path is maintained).