Imu3D.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00033
00034
00038
00039
00040
00041 #ifndef __IMU_SENSOR3D_H_
00042 #define __IMU_SENSOR3D_H_
00043
00044 #ifdef MIP_HOST_APPLE
00045 #include <applePatch.h>
00046 #endif
00047
00048 #include <stdlib.h>
00049 #include <string>
00050 #include <sstream>
00051 #include <vector>
00052 #include <assert.h>
00053 #include <pthread.h>
00054
00055 #include <baselib.h>
00056 #include <Resource.h>
00057
00058 using namespace MipBaselib;
00059
00060 namespace MipResources{
00061
00063
00064
00065
00069 class ImuPar
00070 {
00071 private:
00072 string _name;
00073
00074 Acceleration3D _acc;
00075 Acceleration3D _gyro;
00076 Orientation3D _magn;
00077
00078 protected:
00082 void setIMUName(string value)
00083 {
00084 _name = value;
00085 return;
00086 }
00087
00091 void setIMUAcceleration(Acceleration3D a)
00092 {
00093 _acc = a;
00094 return;
00095 }
00096
00100 void setIMUAngRate(Acceleration3D g)
00101 {
00102 _gyro = g;
00103 return;
00104 }
00105
00109 void setIMUOri(Orientation3D m)
00110 {
00111 _magn = m;
00112 return;
00113 }
00114
00115
00116 public:
00117
00119 ~ImuPar(){};
00120
00122 ImuPar ()
00123 {
00124 _acc = Acceleration3D(0.0, 0.0, 0.0);
00125 _gyro = Acceleration3D(0.0, 0.0, 0.0);
00126 _magn = Orientation3D(0.0, 0.0, 0.0);
00127 }
00128
00130 ImuPar(const ImuPar& s)
00131 {
00132 _acc = s._acc;
00133 _gyro = s._gyro;
00134 _magn = s._magn;
00135 }
00136
00137
00139 ImuPar& operator=(const ImuPar& s)
00140 {
00141 if (this != &s)
00142 {
00143 _acc = s._acc;
00144 _gyro = s._gyro;
00145 _magn = s._magn;
00146 }
00147 return *this;
00148 }
00149
00151
00152 };
00153
00160 class ImuVar {};
00161
00169 class Imu : public Resource
00170 {
00171 private:
00172 bool _IMUavail;
00173
00174 protected:
00175 ImuPar *_par;
00177 public:
00178
00179 virtual ResourcePlate getPlate() const =0;
00180
00182 Imu()
00183 {
00184 cout << "Imu constructor starting." << endl;
00185 _par = new ImuPar();
00186 _IMUavail = true;
00187 cout << "Imu constructor end." << endl;
00188 };
00189
00190
00192 ~Imu(){};
00193
00194 virtual bool getIMUMeasure(Acceleration3D &acc, Acceleration3D &gyro, Orientation3D &magn, Decimal *MeasTime)=0;
00195 };
00196
00197
00198
00199 };
00200
00201
00202 #endif
00203
00204
00205
00206
00207