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: 2008 00006 * 00007 * Class FrontierGreedyPlanner 00008 * 00009 * 00010 */ 00011 00012 #pragma once 00013 #ifndef __FSA__PLANNER__ 00014 #define __FSA__PLANNER__ 00015 00016 #include <iostream> 00017 #include <stdlib.h> 00018 #include "ClThread.h" 00019 #include "ClMutex.h" 00020 #include "stepEvent.h" 00021 #include "slamInterface.h" 00022 #include "reactive.h" 00023 #include "planner.h" 00024 #include "ConfigFile.h" 00025 00026 00027 /** 00028 * @brief Implements a Finite State Automata that performs a reactive behaviour based exploration 00029 * 00030 */ 00031 00032 class FSAPlanner: public planner{ 00033 00034 /////////////////////////////////////////////////////////////////////// 00035 //------------------------- Attributes ------------------------------ 00036 /////////////////////////////////////////////////////////////////////// 00037 00038 private: 00039 00040 bool exploring, // exploration estate 00041 returning, // return to precise poses 00042 escapingFromLocalMinimum, // path following to the nearest frontier 00043 returningEscape; // path following to the nearest precise pose 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 std::vector<point> path; // escape from local minimum planned path 00048 bool completedPath; // Flag to set when path is finished 00049 00050 // parameters 00051 int inflate_obstacles; 00052 bool integrate_slam; 00053 bool escape_allowed; 00054 00055 00056 //--------------------------------------------------------------------- 00057 /////////////////////////////////////////////////////////////////////// 00058 00059 /////////////////////////////////////////////////////////////////////// 00060 //------------------------- Methods --------------------------------- 00061 /////////////////////////////////////////////////////////////////////// 00062 00063 public: 00064 00065 /// Constructor 00066 FSAPlanner(const ConfigFile& config); 00067 /// Destructor 00068 virtual ~FSAPlanner(); 00069 00070 private: 00071 00072 int setup(); // Thread setup 00073 void onStop(); // Thread on stop 00074 void execute(); // Thead execution body 00075 00076 //--------------------------------------------------------------------- 00077 /////////////////////////////////////////////////////////////////////// 00078 }; 00079 00080 #endif