00001 #ifndef INCLUDE_NAVLIB_PATHPLANNER_GRIDPLANNER 00002 #define INCLUDE_NAVLIB_PATHPLANNER_GRIDPLANNER 00003 00004 #include "pathPlanner.h" 00005 #include <map> 00006 00007 /*namespace navlib 00008 { 00009 00011 class GridLookupTableQuery 00012 { 00013 public: 00014 GridLookupTableQuery(PathPoint wp0, PathPoint wpf); 00015 PathPoint _ip0; 00016 PathPoint _ipf; 00017 bool operator<(const GridLookupTableQuery &q) const 00018 { 00019 if (_ip0 < q._ip0) 00020 return true; 00021 else if (q._ip0 < _ip0) 00022 return false; 00023 else if (_ipf < q._ipf) 00024 return true; 00025 return false; 00026 } 00027 }; 00028 00030 typedef std::map<GridLookupTableQuery, Path*> GridLookupTable; 00031 00032 00034 class GridPlanner : public PathPlanner 00035 { 00036 public: 00039 GridPlanner(TpbvpSolver* solver, const char* lutFile=NULL); 00040 virtual ~GridPlanner() {}; 00041 Path* getPath(const PathPoint& wp0, const PathPoint& wpf, 00042 Shape* body, const std::vector<Point>& obstacles); 00046 void makeLut(double gridSpacing, double minDist, unsigned int numTheta=8, 00047 std::vector<double> curves=std::vector<double>(1, 0.0)); 00049 void saveLut(const char* lutFile); 00050 00051 public: 00052 TpbvpSolver* _solver; 00053 GridLookupTable _lut; ///< lookup table 00054 double _gridSpacing; ///< distance between grid cells 00055 double _minDist; ///< distance threshold breaks a path near grid points 00056 unsigned int _numTheta; ///< number of orientations to sample 00057 std::vector<double> _curves; ///< set of trajectories 00058 00060 bool isComposition(Path* path, double gridSpacing, double minDist); 00061 }; 00062 }*/ 00063 00064 #endif 00065