MRXT: The Multi-Robot eXploration Tool
Multi-Robot autonomous exploration and mapping simulator.
include/architecture/planner/CoordinatedPlanner.h
00001 /**
00002 *
00003 * Author: Miguel Julia <mjulia@umh.es> 
00004 * 
00005 * Date:   2009
00006 * 
00007 * Class CoordinatedPlanner
00008 *
00009 *
00010 */
00011 #pragma once
00012 #ifndef __COORDINATED__PLANNER__
00013 #define __COORDINATED__PLANNER__
00014 
00015 #include <iostream>
00016 #include <stdlib.h>
00017 #include "ClThread.h"
00018 #include "stepEvent.h"
00019 #include "slamInterface.h"
00020 #include "reactive.h"
00021 #include "planner.h"
00022 #include "pathPlanning.h"
00023 #include "ConfigFile.h"
00024 
00025 /**
00026 *
00027 * @brief Implements an exploration algorithm that chooses its target cell using a cost-utility model
00028 *
00029 * Value = Utility - Cost
00030 * 
00031 * Utility: is a function to the distance to the cells assigned to the other robots
00032 *
00033 * Cost: is the length of the path to arrive to the cell
00034 *
00035 * The target frontier cell that maximizes the value is chosen
00036 */
00037 
00038 class CoordinatedPlanner: public planner{
00039 
00040 ///////////////////////////////////////////////////////////////////////
00041 //-------------------------  Attributes  ------------------------------
00042 ///////////////////////////////////////////////////////////////////////
00043 
00044 private: 
00045 
00046         ClMutex closing;                                // Mutex for a right stopping of the thread
00047         bool endPlanner;                                // Flag that indicates that the thread must conclude in the next iteration 
00048         bool showPlanner;                               // Flag that indicates if the planning figure must be displayed
00049         bool completedPath;                             // Flag to set when path is finished
00050         std::vector<point> path;                        // planned path
00051 
00052         point* destinations;                            // destinations selected by other robots
00053 
00054         // parameters
00055         float replanning_period;
00056         int inflate_obstacles;
00057         float influence_radius;
00058 
00059 //--------------------------------------------------------------------- 
00060 ///////////////////////////////////////////////////////////////////////
00061 
00062 ///////////////////////////////////////////////////////////////////////
00063 //-------------------------  Methods  ---------------------------------
00064 ///////////////////////////////////////////////////////////////////////
00065 
00066 public:
00067 
00068         /// Constructor
00069         CoordinatedPlanner(const ConfigFile& config);
00070         /// Destructor
00071         virtual ~CoordinatedPlanner();
00072 
00073 private:
00074 
00075         /// Thread setup
00076         int setup();                                    
00077         /// Thread on stop
00078         void onStop();  
00079         /// Thead execution body                                
00080         void execute();                                 
00081 
00082 //--------------------------------------------------------------------- 
00083 ///////////////////////////////////////////////////////////////////////
00084 
00085 };
00086 
00087 #endif
00088 
 All Classes Functions Variables Typedefs