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 robotBase 00008 * 00009 * This class connects with the real robot in real experiments 00010 * 00011 * or runs a thread in a virtual world 00012 * 00013 */ 00014 00015 00016 #include "robotBase.h" 00017 #include <stdio.h> 00018 #include "worldModelInterface.h" 00019 00020 // Constructors 00021 00022 robotBase::robotBase(): 00023 scene(0), 00024 number(0), 00025 captured(false) 00026 { 00027 // printf("[ROBOTBASE] RobotBase created\n"); 00028 } 00029 00030 robotBase::robotBase(int n): 00031 number(n), 00032 captured(false) 00033 { 00034 // printf("[ROBOTBASE] RobotBase created\n"); 00035 } 00036 00037 robotBase::~robotBase(){ 00038 // printf("[ROBOTBASE] RobotBase finished\n"); 00039 } 00040 00041 void robotBase::setWorldModel(void* s) { 00042 scene = (worldModelInterface*) s; 00043 } 00044 00045 00046 rangeSensorData* robotBase::getRangeSensorData(){ 00047 return ((worldModelInterface*)scene)->getRangeSensorData(number); 00048 } 00049 00050 landmarksData* robotBase::getLandmarksData() { 00051 return ((worldModelInterface*)scene)->getLandmarksData(number); 00052 } 00053 00054 pose* robotBase::getOdometry() { 00055 return ((worldModelInterface*)scene)->getOdometry(number); 00056 } 00057 00058 void robotBase::setSpeed(float v, float w){ 00059 ((worldModelInterface*)scene)->setSpeed(number,v,w); 00060 } 00061 00062 int robotBase::fire(){ 00063 return ((worldModelInterface*)scene)->fire(number); 00064 } 00065