All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
ompl::geometric::PathSimplifier Class Reference

This class contains routines that attempt to simplify geometric paths. More...

#include <PathSimplifier.h>

List of all members.

Public Member Functions

 PathSimplifier (const base::SpaceInformationPtr &si)
 Create an instance for a specified space information.
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 process that attempts to do "short-cutting" on the path. Connection is attempted between non-consecutive way-points on the path. If the connection is successful, the path is shortened by removing the in-between way-points. This function returns true if changes were made to the path.
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 attempts to do "short-cutting" on the path. Connection is attempted between random points along the path segments. Unlike the reduceVertices() function, this function does not sample only vertices produced by the planner, but intermediate points on the path. If the connection is successful, the path is shortened by removing the in-between states (and new vertices are created when needed). This function returns true if changes were made to the path.
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 process that attempts to do "short-cutting" on the path. Connection is attempted between non-consecutive states that are close along the path. If the connection is successful, the path is shortened by removing the in-between states. This function returns true if changes were made to the path.
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).
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 always applies the same set of default operations to the path, with the intention of simplifying it.
void simplify (PathGeometric &path, double maxTime)
 Run simplification algorithms on the path for at most maxTime seconds.
void simplify (PathGeometric &path, const base::PlannerTerminationCondition &ptc)
 Run simplification algorithms on the path as long as the termination condition does not become true.

Protected Attributes

base::SpaceInformationPtr si_
 The space information this path simplifier uses.
RNG rng_
 Instance of random number generator.

Detailed Description

This class contains routines that attempt to simplify geometric paths.

These are in fact routines that shorten the path, and do not necessarily make it smoother.

Definition at line 66 of file PathSimplifier.h.


Member Function Documentation

bool ompl::geometric::PathSimplifier::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 process that attempts to do "short-cutting" on the path. Connection is attempted between non-consecutive states that are close along the path. If the connection is successful, the path is shortened by removing the in-between states. This function returns true if changes were made to the path.

Parameters:
paththe path to reduce vertices from
maxStepsthe maximum number of attempts to "short-cut" the path. If this value is set to 0 (the default), the number of attempts made is equal to the number of states in path. If this value is set to 0 (the default), the number of attempts made is equal to the number of states in path.
maxEmptyStepsnot all iterations of this function produce a simplification. If an iteration does not produce a simplification, it is called an empty step. maxEmptySteps denotes the maximum number of consecutive empty steps before the simplification process terminates.

Definition at line 300 of file PathSimplifier.cpp.

bool ompl::geometric::PathSimplifier::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 process that attempts to do "short-cutting" on the path. Connection is attempted between non-consecutive way-points on the path. If the connection is successful, the path is shortened by removing the in-between way-points. This function returns true if changes were made to the path.

Parameters:
paththe path to reduce vertices from
maxStepsthe maximum number of attempts to "short-cut" the path. If this value is set to 0 (the default), the number of attempts made is equal to the number of states in path.
maxEmptyStepsnot all iterations of this function produce a simplification. If an iteration does not produce a simplification, it is called an empty step. maxEmptySteps denotes the maximum number of consecutive empty steps before the simplification process terminates. If this value is set to 0 (the default), the number of attempts made is equal to the number of states in path.
rangeRatiothe maximum distance between states a connection is attempted, as a fraction relative to the total number of states (between 0 and 1).

Definition at line 90 of file PathSimplifier.cpp.

bool ompl::geometric::PathSimplifier::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 attempts to do "short-cutting" on the path. Connection is attempted between random points along the path segments. Unlike the reduceVertices() function, this function does not sample only vertices produced by the planner, but intermediate points on the path. If the connection is successful, the path is shortened by removing the in-between states (and new vertices are created when needed). This function returns true if changes were made to the path.

Parameters:
paththe path to reduce vertices from
maxStepsthe maximum number of attempts to "short-cut" the path. If this value is set to 0 (the default), the number of attempts made is equal to the number of states in path.
maxEmptyStepsnot all iterations of this function produce a simplification. If an iteration does not produce a simplification, it is called an empty step. maxEmptySteps denotes the maximum number of consecutive empty steps before the simplification process terminates. If this value is set to 0 (the default), the number of attempts made is equal to the number of states in path.
rangeRatiothe maximum distance between states a connection is attempted, as a fraction relative to the total number of states (between 0 and 1).
snapToVertexWhile sampling random points on the path, sometimes the points may be close to vertices on the original path (way-points). This function will then "snap to the near vertex", if the distance is less than snapToVertex fraction of the total path length. This should usually be a small value (e.g., one percent of the total path length: 0.01; the default is half a percent)

Definition at line 151 of file PathSimplifier.cpp.

void ompl::geometric::PathSimplifier::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).

This function applies maxSteps steps of smoothing with B-Splines. Fewer steps are applied if no progress is detected: states are either not updated or their update is smaller than minChange. At each step the path is subdivided and states along it are updated such that the smoothness is improved.

Note:
This function may significantly increase the number of states along the solution path.

Definition at line 46 of file PathSimplifier.cpp.


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