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 #ifndef DYNAMIC_PATH_H
00033 #define DYNAMIC_PATH_H
00034
00035 #include "constraint_aware_spline_smoother/ParabolicRamp.h"
00036
00039 class FeasibilityCheckerBase
00040 {
00041 public:
00042 FeasibilityCheckerBase(){};
00043 virtual ~FeasibilityCheckerBase(){};
00044 virtual bool ConfigFeasible(const Vector& x)=0;
00045 virtual bool SegmentFeasible(const Vector& a,const Vector& b)=0;
00046 };
00047
00054 class DistanceCheckerBase
00055 {
00056 public:
00057 virtual ~DistanceCheckerBase();
00058 virtual Real ObstacleDistanceNorm() const { return Inf; }
00059 virtual Real ObstacleDistance(const Vector& x)=0;
00060 };
00061
00065 class DynamicPath
00066 {
00067 public:
00068 DynamicPath();
00069 void Init(const Vector& velMax,const Vector& accMax);
00070 inline void Clear() { ramps.clear(); }
00071 inline bool Empty() const { return ramps.empty(); }
00072 Real GetTotalTime() const;
00073 void Evaluate(Real t,Vector& x);
00074 void Derivative(Real t,Vector& dx);
00075 void SetMilestones(const std::vector<Vector>& x);
00076 void SetMilestones(const std::vector<Vector>& x,const std::vector<Vector>& dx);
00077 void GetMilestones(std::vector<Vector>& x,std::vector<Vector>& dx) const;
00078 void Append(const Vector& x);
00079 void Append(const Vector& x,const Vector& dx);
00080 bool TryShortcut(Real t1,Real t2,FeasibilityCheckerBase*,Real tol);
00081 bool TryShortcut(Real t1,Real t2,FeasibilityCheckerBase*,DistanceCheckerBase*);
00082 int Shortcut(int numIters,FeasibilityCheckerBase*,Real tol);
00083 int ShortCircuit(FeasibilityCheckerBase*,Real tol);
00084 int Shortcut(int numIters,FeasibilityCheckerBase*,DistanceCheckerBase*);
00085 int ShortCircuit(FeasibilityCheckerBase*,DistanceCheckerBase*);
00086
00088 Vector velMax,accMax;
00090 std::vector<ParabolicRampND> ramps;
00091 };
00092
00093
00094 #endif