Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

RobotInfo.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_RobotInfo_h
00003 #define INCLUDED_RobotInfo_h
00004 
00005 #include <map>
00006 #include <string>
00007 
00008 // If creating a new robot configuration, add a new entry in the list below
00009 
00010 #if TGT_ERS210
00011 # include "Shared/ERS210Info.h"
00012 namespace RobotInfo { using namespace ERS210Info; }
00013 
00014 #elif TGT_ERS220
00015 # include "Shared/ERS220Info.h"
00016 namespace RobotInfo { using namespace ERS220Info; }
00017 
00018 #elif TGT_ERS2xx
00019 # include "Shared/ERS2xxInfo.h"
00020 namespace RobotInfo { using namespace ERS2xxInfo; }
00021 
00022 #elif TGT_ERS7
00023 # include "Shared/ERS7Info.h"
00024 namespace RobotInfo { using namespace ERS7Info; }
00025 
00026 #elif TGT_LYNXARM6
00027 # include "Shared/LynxArm6Info.h"
00028 namespace RobotInfo { using namespace LynxArm6Info; }
00029 
00030 #elif TGT_REGIS1
00031 # include "Shared/Regis1Info.h"
00032 namespace RobotInfo { using namespace Regis1Info; }
00033 
00034 #elif TGT_QBOTPLUS
00035 # include "Shared/QBotPlusInfo.h"
00036 namespace RobotInfo { using namespace QBotPlusInfo; }
00037 
00038 #elif TGT_QWERK
00039 # include "Shared/QwerkInfo.h"
00040 namespace RobotInfo { using namespace QwerkInfo; }
00041 
00042 #elif TGT_WIIMOTE
00043 # include "Shared/WiiMoteInfo.h"
00044 namespace RobotInfo { using namespace WiiMoteInfo; }
00045 
00046 #elif TGT_CREATE
00047 # include "Shared/CreateInfo.h"
00048 namespace RobotInfo { using namespace CreateInfo; }
00049 
00050 #elif TGT_CALLIOPE
00051 # include "Shared/CalliopeInfo.h"
00052 namespace RobotInfo { using namespace CalliopeInfo; }
00053 
00054 #elif TGT_CALLIOPELP
00055 # include "Shared/CalliopeInfo.h"
00056 namespace RobotInfo { using namespace CalliopeLPInfo; }
00057 
00058 #elif TGT_CALLIOPESP
00059 # include "Shared/CalliopeInfo.h"
00060 namespace RobotInfo { using namespace CalliopeSPInfo; }
00061 
00062 #elif TGT_CALLIOPE2SP
00063 # include "Shared/CalliopeInfo.h"
00064 namespace RobotInfo { using namespace Calliope2SPInfo; }
00065 
00066 #elif TGT_CALLIOPE5SP
00067 # include "Shared/CalliopeInfo.h"
00068 namespace RobotInfo { using namespace Calliope5SPInfo; }
00069 
00070 #elif TGT_CALLIOPE5KP
00071 # include "Shared/CalliopeInfo.h"
00072 namespace RobotInfo { using namespace Calliope5KPInfo; }
00073 
00074 #elif TGT_BIOLOID
00075 # include "Shared/BioloidInfo.h"
00076 namespace RobotInfo { using namespace BioloidInfo; }
00077 
00078 #elif TGT_PANTILT
00079 # include "Shared/PanTiltInfo.h"
00080 namespace RobotInfo { using namespace PanTiltInfo; }
00081 
00082 #elif TGT_HANDEYE
00083 # include "Shared/HandEyeInfo.h"
00084 namespace RobotInfo { using namespace HandEyeInfo; }
00085 
00086 #elif TGT_HANDEYEZ
00087 # include "Shared/HandEyeZInfo.h"
00088 namespace RobotInfo { using namespace HandEyeZInfo; }
00089 
00090 #elif TGT_CHIARA
00091 # include "Shared/ChiaraInfo.h"
00092 namespace RobotInfo { using namespace ChiaraInfo; }
00093 
00094 #elif TGT_CHIARA2
00095 # include "Shared/Chiara2Info.h"
00096 namespace RobotInfo { using namespace Chiara2Info; }
00097 
00098 #elif TGT_DYNAMIC
00099 # include "Shared/DynamicInfo.h"
00100 namespace RobotInfo { using namespace DynamicInfo; }
00101 
00102 #elif TGT_TENTACLE
00103 # include "Shared/TentacleInfo.h"
00104 namespace RobotInfo { using namespace TentacleInfo; }
00105 
00106 #elif TGT_KHR2
00107 # include "Shared/KHR2Info.h"
00108 namespace RobotInfo { using namespace KHR2Info; }
00109 
00110 #else //default case, currently ERS-7
00111 # warning "TGT_<model> undefined or unknown model set - defaulting to ERS7"
00112 # include "Shared/ERS7Info.h"
00113 namespace RobotInfo { using namespace ERS7Info; }
00114 #endif //model selection
00115 
00116 
00117 //! Contains information about the robot, such as number of joints, PID defaults, timing information, etc.
00118 /*! This is just a wrapper for whichever namespace corresponds to the current
00119 *  robot target setting (one of TGT_ERS7, TGT_ERS210, TGT_ERS220, or the cross-booting TGT_ERS2xx)
00120 *
00121 *  You probably should look at ERS7Info, ERS210Info, ERS220Info, or ERS2xxInfo for the actual
00122 *  constants used for each model, although some common information shared by all of these namespaces
00123 *  is defined in CommonInfo.h */
00124 namespace RobotInfo {
00125   
00126   //! Accessor for Capabilities::caps, returns the Capabilities instance for a specified robot model (or NULL if robot is unknown or didn't provide a Capabilities instance)
00127   /*! Use this if you have a robot name in string form and want to check or map its capabilities.
00128    *  (For example, if you are communicating with another robot of a different type over the network.)
00129    *  If you know at compile time the type of the robot in question, you could just directly access
00130    *  its 'capabilities' instance via its RobotInfo namespace.  (e.g. ERS210Info::capabilities)
00131    *  If you want the capabilities for the current robot, just use the global 'capabilities' instance
00132    *  as RobotInfo.h will automatically import the current robot's namespace into the global space. */
00133   inline const Capabilities* getCapabilities(const std::string& robName) {
00134     const std::map<std::string, const Capabilities*>& caps = Capabilities::getCaps();
00135     std::map<std::string, const Capabilities*>::const_iterator it = caps.find(robName);
00136     return it==caps.end() ? NULL : it->second;
00137   }
00138   
00139 #if defined(TGT_HAS_CAMERA) || defined(TGT_HAS_WEBCAM)
00140   //! Name of the camera being used on the robot
00141   /*! Gets value from previously imported namespace, but can be overridden by DeviceDriver e.g. Mirage */
00142   extern const char* CameraName;
00143   //! The camera correction homography to utilize
00144   /*! Initialized from file by StartupBehavior::doStart(), using #CameraName to indicate file name. */
00145   extern fmat::Matrix<3,3> CameraHomography;
00146 #endif
00147   
00148 }
00149 
00150 using namespace RobotInfo;
00151   
00152 /*! @file
00153  * @brief Checks the define's to load the appropriate header and namespace
00154  * @author ejt (Creator)
00155  */
00156 
00157 #endif

Tekkotsu v5.1CVS
Generated Tue Jan 31 04:32:06 2012 by Doxygen 1.6.3