Go to the documentation of this file.00001 #ifndef __CACCESS_H__
00002 #define __CACCESS_H__
00003
00004 #include "porting.h"
00005 #include "v_repLib.h"
00006
00007 static const char pluginName[] = "RosBridge";
00008
00009
00010 class CustomDataHeaders {
00011 public:
00012
00016 typedef enum {
00017 DIRECT = 0,
00018 INTERNAL = 1
00019 } QuadrotorCtrlMode;
00020
00024 typedef enum {
00025 TF_POSITION = 0,
00026 TF_VELOCITY = 1,
00027 TF_EFFORT = 2,
00028 MOT_VELOCITY = 3,
00029 PASSIVE_MODE = 4,
00030 IGNORE_MODE = 20
00031
00032 } ManipulatorCtrlMode;
00033
00038 const static unsigned int DEVELOPER_DATA_HEADER = 769710397;
00039
00043 const static unsigned int QUADROTOR_DATA_MAIN=10;
00045 const static unsigned int QUADROTOR_TK_DATA_MAIN=20;
00047 const static unsigned int QUADROTOR_DATA_MOTOR_0=0;
00049 const static unsigned int QUADROTOR_DATA_MOTOR_1=1;
00051 const static unsigned int QUADROTOR_DATA_MOTOR_2=2;
00053 const static unsigned int QUADROTOR_DATA_MOTOR_3=3;
00055 const static unsigned int QUADROTOR_DATA_COM=11;
00057 const static unsigned int QUADROTOR_DATA_TF_RATIO=12;
00059 const static unsigned int QUADROTOR_DATA_CTRL_MODE = 13;
00061
00065 const static unsigned int IMU_DATA_MAIN=200;
00067 const static unsigned int IMU_DATA_MASS=201;
00069 const static unsigned int IMU_DATA_FORCE=202;
00071 const static unsigned int IMU_DATA_FREQ= 203;
00073 const static unsigned int IMU_DATA_CUTOFF=204;
00075
00079 const static unsigned int FORCE_SENSOR_DATA_MAIN= 250;
00081
00085 const static unsigned int CAMERA_DATA_MAIN = 300;
00087 const static unsigned int CAMERA_DATA_FREQ = 301;
00089 const static unsigned int CAMERA_DATA_RGB = 302;
00091
00095 const static unsigned int OBJ_POSE_DATA_MAIN=400;
00097
00101 const static unsigned int OBJ_TWIST_DATA_MAIN=500;
00103
00107 const static unsigned int SET_OBJ_TWIST_DATA_MAIN=550;
00109
00110
00114 const static unsigned int MANIPULATOR_DATA_MAIN = 600;
00116 const static unsigned int MANIPULATOR_DATA_FREQ = 601;
00118 const static unsigned int MANIPULATOR_DATA_JOINT = 602;
00120 const static unsigned int MANIPULATOR_DATA_CTRL_MODE = 603;
00122
00126 const static unsigned int CONTACT_DATA_MAIN= 650;
00128
00129
00130
00135 static void registerCustomDataHeaders();
00136 };
00137
00138
00139 #include <vector>
00140
00146 class CAccess
00147 {
00148 public:
00149 CAccess();
00150 virtual ~CAccess();
00151
00158 static void insertSerializationData(std::vector<unsigned char>& buffer,int dataName,const std::vector<unsigned char>& data);
00159
00166 static bool extractSerializationData(std::vector<unsigned char>& buffer,int dataName,std::vector<unsigned char>& data);
00167
00175 static int getDataLocationAndSize(const std::vector<unsigned char>& buffer,int dataName,int& theSize);
00176
00182 static void push_int(std::vector<unsigned char>& buffer,int data);
00183
00189 static void push_float(std::vector<unsigned char>& buffer,float data);
00190
00197 static int pop_int(std::vector<unsigned char>& buffer);
00198
00205 static float pop_float(std::vector<unsigned char>& buffer);
00206
00207 };
00208
00209 #endif //ndef __CACCESS_H__