MRXT: The Multi-Robot eXploration Tool
Multi-Robot autonomous exploration and mapping simulator.
|
00001 /* 00002 * 00003 * Author: Miguel Julia <mjulia@umh.es> 00004 * 00005 * Date: 2009 00006 * 00007 * Class FrontierGreedyPlanner 00008 * 00009 00010 * 00011 */ 00012 00013 #pragma once 00014 #ifndef __FBG__PLANNER__ 00015 #define __FBG__PLANNER__ 00016 00017 #include <iostream> 00018 #include <stdlib.h> 00019 #include "ClThread.h" 00020 #include "ClMutex.h" 00021 #include "stepEvent.h" 00022 #include "slamInterface.h" 00023 #include "reactive.h" 00024 #include "planner.h" 00025 #include "pathPlanning.h" 00026 #include "ConfigFile.h" 00027 00028 /** 00029 * @brief Implements an exploration algorithm directing the robot to the nearest frontier cell 00030 * 00031 */ 00032 00033 class FrontierGreedyPlanner: public planner{ 00034 00035 /////////////////////////////////////////////////////////////////////// 00036 //------------------------- Attributes ------------------------------ 00037 /////////////////////////////////////////////////////////////////////// 00038 00039 private: 00040 00041 // std::vector<ocell> relpath; // planned path 00042 std::vector<point> path; // planned path 00043 bool completedPath; // Flag to set when path is finished 00044 bool showPlanner; // Flag that indicates if the planning figure must be displayed 00045 bool endPlanner; // Flag that indicates that the thread must conclude in the next iteration 00046 ClMutex closing; // Mutex for a right stopping of the thread 00047 00048 // parameters 00049 float replanning_period; 00050 int inflate_obstacles; 00051 00052 00053 //--------------------------------------------------------------------- 00054 /////////////////////////////////////////////////////////////////////// 00055 00056 /////////////////////////////////////////////////////////////////////// 00057 //------------------------- Methods --------------------------------- 00058 /////////////////////////////////////////////////////////////////////// 00059 00060 public: 00061 00062 /// Constructor 00063 FrontierGreedyPlanner(const ConfigFile& config); 00064 /// Destructor 00065 virtual ~FrontierGreedyPlanner(); 00066 00067 private: 00068 00069 int setup(); // Thread setup 00070 void onStop(); // Thread on stop 00071 void execute(); // Thead execution body 00072 00073 //--------------------------------------------------------------------- 00074 /////////////////////////////////////////////////////////////////////// 00075 00076 }; 00077 00078 #endif 00079