00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef OMPL_GEOMETRIC_PATH_SIMPLIFIER_
00038 #define OMPL_GEOMETRIC_PATH_SIMPLIFIER_
00039
00040 #include "ompl/base/SpaceInformation.h"
00041 #include "ompl/geometric/PathGeometric.h"
00042 #include "ompl/base/PlannerTerminationCondition.h"
00043 #include "ompl/util/ClassForward.h"
00044 #include "ompl/util/RandomNumbers.h"
00045 #include "ompl/util/Console.h"
00046 #include <limits>
00047
00048 namespace ompl
00049 {
00050
00051 namespace geometric
00052 {
00053
00055
00056 ClassForward(PathSimplifier);
00058
00066 class PathSimplifier
00067 {
00068 public:
00069
00071 PathSimplifier(const base::SpaceInformationPtr &si) : si_(si)
00072 {
00073 }
00074
00075 virtual ~PathSimplifier(void)
00076 {
00077 }
00078
00079
00110 bool reduceVertices(PathGeometric &path, unsigned int maxSteps = 0, unsigned int maxEmptySteps = 0, double rangeRatio = 0.33);
00111
00153 bool shortcutPath(PathGeometric &path, unsigned int maxSteps = 0, unsigned int maxEmptySteps = 0, double rangeRatio = 0.33, double snapToVertex = 0.005);
00154
00180 bool collapseCloseVertices(PathGeometric &path, unsigned int maxSteps = 0, unsigned int maxEmptySteps = 0);
00181
00193 void smoothBSpline(PathGeometric &path, unsigned int maxSteps = 5, double minChange = std::numeric_limits<double>::epsilon());
00194
00198 void simplifyMax(PathGeometric &path);
00199
00201 void simplify(PathGeometric &path, double maxTime);
00202
00204 void simplify(PathGeometric &path, const base::PlannerTerminationCondition &ptc);
00205
00206 protected:
00207
00209 base::SpaceInformationPtr si_;
00210
00212 RNG rng_;
00213
00214 };
00215 }
00216 }
00217
00218 #endif