Go to the documentation of this file.00001
00012 #ifndef REDNAV_LIBS_NAVIGATOR_HPP
00013 #define REDNAV_LIBS_NAVIGATOR_HPP
00014
00015 #include <rednav/sensorModel.hpp>
00016 #include <rednav/pathTool.hpp>
00017 #include <lgl/NavGraph.hpp>
00018 #include <lgl/GeoData.hpp>
00019 #include <lgl/Location.hpp>
00020 #include <iostream>
00021 #include <string>
00022
00023
00024 namespace jafar {
00025 namespace rednav {
00026
00027 class Navigator {
00028 private:
00030 int xsize;
00032 int ysize;
00034 int zsize;
00036 double xMapOrigin;
00038 double yMapOrigin;
00040 double zMapOrigin;
00042 double pixelScale;
00044 int startx;
00046 int starty;
00048 int startz;
00050 double startutmx;
00052 double startutmy;
00054 double startutmz;
00056 int goalx;
00058 int goaly;
00060 int goalz;
00062 double goalutmx;
00064 double goalutmy;
00066 double goalutmz;
00067
00069 jafar::lgl::GeoData *navMap;
00070
00072 jafar::lgl::Quadtree<double, jafar::lgl::GeoData> *navQuadtree;
00073
00075 jafar::lgl::NavGraph *navGraph;
00076
00078 PathTool *multiTool;
00079
00085 bool isDrawingNSU;
00086
00087 public:
00088
00090 Navigator();
00091
00093 Navigator(const std::string& filepath);
00094
00096 Navigator(double* bufferedData, int xsize_, int ysize_, int zsize_, double xMapOrigin_, double yMapOrigin_, double zMapOrigin_, double pixelScale_);
00097
00099 ~Navigator();
00100
00102 SensorModel *sensor;
00103
00105 bool isUp();
00106
00108 bool savePath(const std::string& outfile, jafar::lgl::NavPath& savingpath);
00109
00116 bool saveData(const std::string& outfile, const std::string& toutfile, const std::string& quadTreeFile);
00117
00119 bool saveGeodata(const std::string& outfile);
00120
00122 bool fastFindPath(const jafar::lgl::NavLocation& locstart, const jafar::lgl::NavLocation& locend, jafar::lgl::NavPath& navpath);
00123
00125 bool findPath(const jafar::lgl::NavLocation& locstart, const jafar::lgl::NavLocation& locend, jafar::lgl::NavPath& navpath);
00126
00128 bool findPath(const jafar::lgl::NavLocation& locstart, const jafar::lgl::NavLocation& locend, jafar::lgl::NavPath& navpath, double& pathCost);
00129
00131 bool findPathOnUtility(const jafar::lgl::NavLocation& locstart, const jafar::lgl::NavLocation& locend, jafar::lgl::NavPath& navpath, double authDist=0.0);
00132
00134 bool updateMap(double* bufferedData, int xsize_, int ysize_);
00135
00137 bool updateMap(jafar::lgl::GeoData *inputGData);
00138
00139
00141 void printInfo();
00142
00144 jafar::lgl::GeoData* getNavMap() { return navMap; };
00145
00147 jafar::lgl::NavGraph::NavGraphContainer* getGraph();
00148
00150 jafar::lgl::Decomp* getDecomposition();
00151
00153 std::list<jafar::lgl::NavGraph::frontierPoint> getNavGraphFrontiers();
00154
00156 bool getIsDrawingNSU();
00157
00158
00160 bool setMapOrigin(double xMapOrigin_, double yMapOrigin_, double zMapOrigin_, double pixelScale_);
00161
00163 void setMapSize(int xsize_, int ysize_, int zsize_);
00164
00166 void setGoal(const jafar::lgl::NavLocation& A);
00168 void setGoal(int x, int y, int z);
00170 void setGoal(double x, double y, double z);
00171
00173 void setStart(const jafar::lgl::NavLocation& A);
00175 void setStart(int x, int y, int z);
00177 void setStart(double x, double y, double z);
00178
00180 void setPathCropers(double pce, double pcp);
00181
00186 void setMaxWayPts(int maxwpts);
00187
00189 void setSigmaFactor(double sig_);
00190
00192 void setProbabilityLag(double probaLag_);
00193
00195 void setPathToolPathMaxDistance(double pmd);
00196
00198 void setPathToolSubSampler(double setsbs);
00199
00201 void setPathToolInterpolationDist(double);
00202
00204 void setPathToolInterpolationIndexStart(int);
00205
00207 void setPathToolInterpolationIndexStop(int);
00208
00213 void setIsDrawingNSU(bool B);
00214
00218 void setPathMaxStepDistance(double pmsd);
00219
00220
00221
00229 bool findUtilityStartFromFrontiers(jafar::lgl::NavLocation& autoStart);
00230
00233 bool doCalculateNavigationUtility();
00234
00241 bool cropPath(double vent, double vproba, jafar::lgl::NavPath& navpath);
00242
00244 bool applyTool(jafar::lgl::NavPath& srcPath, jafar::lgl::NavPath& outPath, PATH_TRANSFORMATION);
00245
00246 };
00247 }}
00248
00249 #endif //REDNAV_LIBS_NAVIGATOR_HPP