INTRODUCTION
Overview
Download and Install
Documentation
Publications

REPOSITORY
Libraries

DEVELOPER
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

imudecoder.h

00001 /*
00002  * GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
00003  *               http://gearbox.sf.net/
00004  * Copyright (c) 2004-2010 Michael Moser
00005  *
00006  * This distribution is licensed to you under the terms described in
00007  * the LICENSE file included in this distribution.
00008  *
00009  */
00010 #ifndef GBX_NOVATEL_IMUDECODER_H
00011 #define GBX_NOVATEL_IMUDECODER_H
00012 
00013 #include <stdint.h>
00014 #include <string>
00015 namespace gbxnovatelutilacfr{
00016 //the novatel span system supports different IMUs, with different status bit-fields and different conversion factors
00017 
00018 //yield [rad]
00019 const double GyroConstantHg1700Ag11Ag58 = 1.16415321826934814453e-10;
00020 const double GyroConstantHg1700Ag17Ag62 = 1.16415321826934814453e-10; //verified on Hw
00021 const double GyroConstantImarFsas = 4.8481368110953599359e-7;
00022 const double GyroConstantLn200 = 1.9073486328125e-6;
00023 
00024 //yield [m/s]
00025 const double AccelConstantHg1700Ag11Ag58 = 2.27094150781631469727e-9;
00026 const double AccelConstantHg1700Ag17Ag62 = 4.54188301563262939453e-9; //verified on Hw
00027 const double AccelConstantImarFsas = 1.52587890625e-6;
00028 const double AccelConstantLn200 = 6.103515625e-5;
00029 
00030 class ImuDecoder {
00031 public:
00032     virtual ~ImuDecoder(){}
00033     inline double gyroCnt2Rad(const int32_t cnt){ return cnt*gyroConstant_; }
00034     inline double accelCnt2MperSec(const int32_t cnt){ return cnt*accelConstant_; }
00035     virtual inline bool statusIsGood(const uint32_t imuStatus){return true;} // possibly we need isWarning(), isError() as well. Currently anything not good is treated as error.
00036     virtual std::string statusToString(const uint32_t imuStatus)=0;
00037 
00038 protected:
00039     double gyroConstant_;
00040     double accelConstant_;
00041 };
00042 
00043 extern "C"{
00044     ImuDecoder *createImuDecoder(std::string type);
00045 }
00046 
00047 }//namespace
00048 
00049 #endif
 

Generated for GearBox by  doxygen 1.4.5