MRXT: The Multi-Robot eXploration Tool
Multi-Robot autonomous exploration and mapping simulator.
|
00001 00002 /* 00003 * 00004 * Author: Miguel Julia <mjulia@umh.es> 00005 * 00006 * Date: 2008 00007 * 00008 * Class team 00009 * 00010 * 00011 */ 00012 00013 #pragma once 00014 #ifndef __ROBOT__TEAM___ 00015 #define __ROBOT__TEAM___ 00016 00017 #include "slamInterface.h" 00018 #include "robot.h" 00019 #include "worldModelInterface.h" 00020 #include "ConfigFile.h" 00021 00022 /** 00023 * @brief Implements a team of robots with global SLAM 00024 * 00025 */ 00026 class team { 00027 00028 /////////////////////////////////////////////////////////////////////// 00029 //------------------------- Attributes ------------------------------ 00030 /////////////////////////////////////////////////////////////////////// 00031 private: 00032 int nrobots; 00033 robot** theRobots; 00034 slamInterface* globalSlam; 00035 worldModelInterface *scene; // this class is not the owner of this pointer 00036 char* teamName; 00037 00038 //--------------------------------------------------------------------- 00039 /////////////////////////////////////////////////////////////////////// 00040 00041 /////////////////////////////////////////////////////////////////////// 00042 //------------------------- Methods --------------------------------- 00043 /////////////////////////////////////////////////////////////////////// 00044 public: 00045 00046 /// Default constructor 00047 team(); 00048 /// Default destructor 00049 virtual ~team(); 00050 /// Builds a team of nrobots in the virtual world scene 00051 team(int nrobots, worldModelInterface& scene, ConfigFile& stratConfig, ConfigFile& slamConfig, int robotType, const char* teamName); 00052 /// initilizes a team of nrobots in the virtual world scene 00053 void initialize(int nrobots, worldModelInterface &scene, ConfigFile& stratConfig, ConfigFile& slamConfig, int robotType, const char* teamName); 00054 00055 /// returns a reference to the robot r 00056 robot* getRobot(int r) const; 00057 /// returns the number of robots 00058 int getNRobots() const; 00059 /// returns a pointer to the global slam object 00060 slamInterface* getGlobalSlam() const; 00061 00062 /// sets the reference to the virtual world 00063 void setWorldModel(worldModelInterface& scene); 00064 00065 /// sets the name of the log file 00066 void setLogName(const char*); 00067 00068 /// team exploration, it blocks the thread until the exploration is concluded 00069 void start(); 00070 void waitForTaskFinished(); 00071 00072 /// stops the exploration 00073 void stop(); 00074 //--------------------------------------------------------------------- 00075 /////////////////////////////////////////////////////////////////////// 00076 }; 00077 00078 inline robot* team::getRobot(int r) const {return (theRobots[r]);} 00079 inline int team::getNRobots() const {return nrobots;} 00080 inline slamInterface* team::getGlobalSlam() const {return globalSlam;} 00081 00082 #endif