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_CALLIOPE3
00075 # include "Shared/Calliope3Info.h"
00076 namespace RobotInfo { using namespace Calliope3Info; }
00077 
00078 #elif TGT_CALLIOPE3A
00079 # include "Shared/Calliope3Info.h"
00080 namespace RobotInfo { using namespace Calliope3Info; }
00081 
00082 #elif TGT_CALLIOPEU
00083 # include "Shared/CalliopeUInfo.h"
00084 namespace RobotInfo { using namespace CalliopeUInfo; }
00085 
00086 #elif TGT_BIOLOID
00087 # include "Shared/BioloidInfo.h"
00088 namespace RobotInfo { using namespace BioloidInfo; }
00089 
00090 #elif TGT_PANTILT
00091 # include "Shared/PanTiltInfo.h"
00092 namespace RobotInfo { using namespace PanTiltInfo; }
00093 
00094 #elif TGT_HANDEYE
00095 # include "Shared/HandEyeInfo.h"
00096 namespace RobotInfo { using namespace HandEyeInfo; }
00097 
00098 #elif TGT_HANDEYEZ
00099 # include "Shared/HandEyeZInfo.h"
00100 namespace RobotInfo { using namespace HandEyeZInfo; }
00101 
00102 #elif TGT_CHIARA
00103 # include "Shared/ChiaraInfo.h"
00104 namespace RobotInfo { using namespace ChiaraInfo; }
00105 
00106 #elif TGT_CHIARA2
00107 # include "Shared/Chiara2Info.h"
00108 namespace RobotInfo { using namespace Chiara2Info; }
00109 
00110 #elif TGT_DYNAMIC
00111 # include "Shared/DynamicInfo.h"
00112 namespace RobotInfo { using namespace DynamicInfo; }
00113 
00114 #elif TGT_TENTACLE
00115 # include "Shared/TentacleInfo.h"
00116 namespace RobotInfo { using namespace TentacleInfo; }
00117 
00118 #elif TGT_KHR2
00119 # include "Shared/KHR2Info.h"
00120 namespace RobotInfo { using namespace KHR2Info; }
00121 
00122 #elif TGT_MANTISARM
00123 #   include "Shared/MantisArmInfo.h"
00124 namespace RobotInfo { using namespace MantisArmInfo; }
00125 
00126 #elif TGT_MANTISLEG
00127 #   include "Shared/MantisLegInfo.h"
00128 namespace RobotInfo { using namespace MantisLegInfo; }
00129 
00130 #elif TGT_MANTIS
00131 #   include "Shared/MantisInfo.h"
00132 namespace RobotInfo { using namespace MantisInfo; }
00133 
00134 #else //default case, currently ERS-7
00135 # warning "TGT_<model> undefined or unknown model set - defaulting to ERS7"
00136 # include "Shared/ERS7Info.h"
00137 namespace RobotInfo { using namespace ERS7Info; }
00138 #endif //model selection
00139 
00140 
00141 //! Contains information about the robot, such as number of joints, PID defaults, timing information, etc.
00142 /*! This is just a wrapper for whichever namespace corresponds to the current
00143 *  robot target setting (one of TGT_ERS7, TGT_ERS210, TGT_ERS220, or the cross-booting TGT_ERS2xx)
00144 *
00145 *  You probably should look at ERS7Info, ERS210Info, ERS220Info, or ERS2xxInfo for the actual
00146 *  constants used for each model, although some common information shared by all of these namespaces
00147 *  is defined in CommonInfo.h */
00148 namespace RobotInfo {
00149   
00150   //! 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)
00151   /*! Use this if you have a robot name in string form and want to check or map its capabilities.
00152    *  (For example, if you are communicating with another robot of a different type over the network.)
00153    *  If you know at compile time the type of the robot in question, you could just directly access
00154    *  its 'capabilities' instance via its RobotInfo namespace.  (e.g. ERS210Info::capabilities)
00155    *  If you want the capabilities for the current robot, just use the global 'capabilities' instance
00156    *  as RobotInfo.h will automatically import the current robot's namespace into the global space. */
00157   inline const Capabilities* getCapabilities(const std::string& robName) {
00158     const std::map<std::string, const Capabilities*>& caps = Capabilities::getCaps();
00159     std::map<std::string, const Capabilities*>::const_iterator it = caps.find(robName);
00160     return it==caps.end() ? NULL : it->second;
00161   }
00162   
00163 #if defined(TGT_HAS_CAMERA) || defined(TGT_HAS_WEBCAM)
00164   //! Name of the camera being used on the robot
00165   /*! Gets value from previously imported namespace, but can be overridden by DeviceDriver e.g. Mirage */
00166   extern const char* CameraName;
00167   //! The camera correction homography to utilize
00168   /*! Initialized from file by StartupBehavior::doStart(), using #CameraName to indicate file name. */
00169   extern fmat::Matrix<3,3> CameraHomography;
00170 #endif
00171   
00172 }
00173 
00174 using namespace RobotInfo;
00175   
00176 /*! @file
00177  * @brief Checks the define's to load the appropriate header and namespace
00178  * @author ejt (Creator)
00179  */
00180 
00181 #endif

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:50 2016 by Doxygen 1.6.3