MRXT: The Multi-Robot eXploration Tool
Multi-Robot autonomous exploration and mapping simulator.
include/architecture/planner/IGPlanner.h
00001 /*
00002 *
00003 * Author: Miguel Julia <mjulia@umh.es> 
00004 * 
00005 * Date:   2009
00006 * 
00007 * Class InformationGainPlanner
00008 *
00009 */
00010 
00011 #pragma once
00012 #ifndef __IG__PLANNER__
00013 #define __IG__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 = IG - Cost
00030 * 
00031 * IG: is the expected number of visible cells from that frontier cell
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 InformationGainPlanner: 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         // parameters
00053         float replanning_period;
00054         int inflate_obstacles;
00055         float utility_radius;
00056         float utility_weight;
00057         float cost_weight;
00058         
00059 //--------------------------------------------------------------------- 
00060 ///////////////////////////////////////////////////////////////////////
00061 
00062 ///////////////////////////////////////////////////////////////////////
00063 //-------------------------  Methods  ---------------------------------
00064 ///////////////////////////////////////////////////////////////////////
00065 
00066 public:
00067 
00068         /// Constructor
00069         InformationGainPlanner(const ConfigFile& config);
00070         /// Destructor
00071         virtual ~InformationGainPlanner();
00072 
00073 private:
00074 
00075         int setup();                                    // Thread setup
00076         void onStop();                                  // Thread on stop
00077         void execute();                                 // Thead execution body
00078 
00079         int utility(const gridMapInterface& omap, const binMap& esz); // evals the utility of a frontier
00080 
00081 //--------------------------------------------------------------------- 
00082 ///////////////////////////////////////////////////////////////////////
00083 
00084 };
00085 
00086 #endif
00087 
 All Classes Functions Variables Typedefs