00001 // ---------------------------------------------------------------------------- 00002 // 00003 // $Id$ 00004 // 00005 // Copyright 2008, 2009, 2010, 2011, 2012 Antonio Franchi and Paolo Stegagno 00006 // 00007 // This file is part of MIP. 00008 // 00009 // MIP is free software: you can redistribute it and/or modify 00010 // it under the terms of the GNU General Public License as published by 00011 // the Free Software Foundation, either version 3 of the License, or 00012 // (at your option) any later version. 00013 // 00014 // MIP is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 // GNU General Public License for more details. 00018 // 00019 // You should have received a copy of the GNU General Public License 00020 // along with MIP. If not, see <http://www.gnu.org/licenses/>. 00021 // 00022 // Contact info: antonio.franchi@tuebingen.mpg.de stegagno@diag.uniroma1.it 00023 // 00024 // ---------------------------------------------------------------------------- 00025 00026 00033 00034 00035 #ifndef __SUPERMARIO_H_ 00036 #define __SUPERMARIO_H_ 00037 00038 // #include <socketUDP.h> 00039 // #include <Parameter.h> 00040 #include <CommonOptions.h> 00041 00042 #include "MobileRob3D.h" 00043 // #include "URG04LX.h" 00044 #include "Korebot.h" 00045 00046 class SuperMario : public MobileRob3D{ 00047 private: 00048 static const ResourcePlate _plate = MR_KHIII_RES; 00049 /* PROMEMO from abstract class */ 00050 /* MobileRob3DPar *_par; */ 00051 /* MobileRob3DVar *_var; */ 00052 /* RangeSens *_rangeSens; */ 00053 /* Unicycle *_unicycle;*/ 00054 MobileRob3DPar *_SuperMarioPar; 00055 MobileRob3DVar *_SuperMarioVar; 00056 // URG04LX *_urg04lx; ///< abstract Robot range sensor 00057 Korebot *_korebotMot; 00058 00059 public: 00061 SuperMario(int argc, const char* argv[]){ 00062 /*FIXME eliminare se non servono*/ 00063 _SuperMarioPar = new MobileRob3DPar(); 00064 _SuperMarioVar = new MobileRob3DVar(); 00065 // _urg04lx = new URG04LX(argc,argv); 00066 _korebotMot = new Korebot(argc,argv); 00067 _par = _SuperMarioPar; 00068 _var = _SuperMarioVar; 00069 _unicycle = _korebotMot; 00070 _rangeSens = _urg04lx; 00071 } 00072 /*TODO eliminare*/ 00073 // /// \brief constructor 00074 // /// \param h hostname, ip of the machine in which player runs 00075 // /// \param p port, port which player use 00076 // PlayerRob(const string h, uint p){ 00077 // _SuperMarioPar = new PlayerRobPar(h,p); 00078 // _SuperMarioVar = new PlayerRobVar(); 00079 // _urg04lx = new URG04LX(playerClient()); 00080 // _korebotMot = new Korebot(playerClient()); 00081 // _par = _SuperMarioPar; 00082 // _var = _SuperMarioVar; 00083 // _unicycle = _korebotMot; 00084 // _rangeSens = _urg04lx; 00085 // } 00086 00088 ResourcePlate getPlate() const { 00089 return _plate; 00090 } 00092 ~SuperMario(){ 00093 // delete _urg04lx; 00094 delete _korebotMot; 00095 delete _SuperMarioPar; 00096 delete _SuperMarioVar; 00097 cout << "destr playrob" << endl; 00098 } 00099 00100 00101 /* Range Sensor */ 00102 /*defined at the top level (MobileRob3D)*/ 00103 00104 /* Motion Module */ 00106 void velCmd(Decimal drive, Decimal turnrate){ 00107 _korebotMot->velCmd(drive, turnrate); 00108 } 00112 void getVel(Decimal& drive, Decimal& turnrate){ 00113 _korebotMot->getVel(drive,turnrate); 00114 }; 00116 Pose getPose3D(void){ 00117 return _korebotMot->odometry(); 00118 } 00120 void setPose3D(Pose3D p){ 00121 _korebotMot->setOdometry(p); 00122 } 00123 00124 }; 00125 00126 #endif