00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef IMU6DOFSENSOR_H_
00020 #define IMU6DOFSENSOR_H_
00021
00022 #include <cmath>
00023 #include <sys/time.h>
00024 #include <SerialStream.h>
00025 #include <boost/numeric/ublas/vector.hpp>
00026 #include "Sensor.h"
00027
00028 using namespace LibSerial;
00029 using namespace boost::numeric::ublas;
00030
00031 namespace uvsim
00032 {
00033
00034 static const char exitMenuCmd = '9';
00035 static const char stopCmd = ' ';
00036 static const char startCmd = '#';
00037
00038
00039 class Imu6DofSensor : public uvsim::Sensor
00040 {
00041 public:
00042 Imu6DofSensor(std::string port, vector<double> freqCutMb,
00043 vector<double> freqCutFb, vector<double> freqCutWb);
00044 virtual ~Imu6DofSensor();
00045 void stop();
00046 void start(double frequency);
00047 void print();
00048 virtual void update();
00049 private:
00050 SerialStream serialPort;
00051 bool read();
00052 vector<double> mbRaw, fbRaw, wbRaw, freqCutMb, freqCutFb, freqCutWb;
00053 public:
00054 vector<double> mb, fb, wb;
00055 double freq;
00056 bool isStarted;
00057 };
00058
00059 }
00060
00061 #endif