peripherals  1.4.2
RoadNarrows Robotics Hardware Peripherals Package
imuConst.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Package: RoadNarrows Robotics Peripherals
4 //
5 // Library: libimu
6 //
7 // File: imuConst.h
8 //
9 /*! \file
10  *
11  * $LastChangedDate: 2015-02-25 14:46:44 -0700 (Wed, 25 Feb 2015) $
12  * $Rev: 3872 $
13  *
14  * \brief IMU constants.
15  *
16  * \author Robin Knight (robin.knight@roadnarrows.com)
17  *
18  * \copyright
19  * \h_copy 2015-2017. RoadNarrows LLC.\n
20  * http://www.roadnarrows.com\n
21  * All Rights Reserved
22  */
23 /*
24  * @EulaBegin@
25  * @EulaEnd@
26  */
27 ////////////////////////////////////////////////////////////////////////////////
28 
29 #ifndef _IMU_CONST_H
30 #define _IMU_CONST_H
31 
32 /*!
33  * \brief RoadNarrows Robotics standard namespace.
34  */
35 namespace rnr
36 {
37  /*!
38  * \ingroup periph_imu_base
39  * \defgroup imu_ecodes IMU Error Codes
40  *
41  * IMU wide error codes.
42  *
43  * \{
44  */
45  static const int IMU_OK = 0; ///< not an error, success
46 
47  static const int IMU_ECODE_GEN = 1; ///< general, unspecified error
48  static const int IMU_ECODE_SYS = 2; ///< system (errno) error
49  static const int IMU_ECODE_INTERNAL = 3; ///< internal error (bug)
50  static const int IMU_ECODE_NO_SENSOR = 4; ///< no sensor
51  static const int IMU_ECODE_NO_CAP = 5; ///< no capabilities
52  static const int IMU_ECODE_RANGE = 6; ///< value out-of-range
53  static const int IMU_ECODE_TIMEDOUT = 7; ///< operation timed out error
54  static const int IMU_ECODE_BUSY = 8; ///< resource busy error
55 
56  static const int IMU_ECODE_BADEC = 9; ///< bad error code
57 
58  static const int IMU_ECODE_NUMOF = 10; ///< number of error codes
59  /*! \} */
60 
61 
62 
63  // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
64 
65  /*!
66  * \ingroup periph_imu_base
67  * \defgroup imu_units IMU SI Units
68  *
69  * Exported interfaces are either in raw or SI units.
70  *
71  * \{
72  */
73  const double SI_g0 = 9.80665; ///< m/s^2 accel. in standard gravity
74  const double SI_K = 273.15; ///< 0 Celsius in Kelvins
75  const double SI_PaPsi = 6894.75729; ///< 1 psi in Pascals
76  const double SI_PaAtm = 1.01325e5; ///< 1 atmosphere in Pascals
77  const double SI_PaBar = 10000; ///< 1 bar in Pascals
78 
79  //
80  // SI conversion routines.
81  //
82  double gToMetersPerSec2(double g);
83  float gToMetersPerSec2(float g);
84 
85  double degToRad(double deg);
86  float degToRad(float deg);
87 
88  double cToK(double c);
89  float cToK(float c);
90 
91  double fToK(double f);
92  float fToK(float f);
93 
94  /*! \} */
95 
96 } // namespace rnr
97 
98 
99 #endif // _IMU_CONST_H
const double SI_PaAtm
1 atmosphere in Pascals
Definition: imuConst.h:76
const double SI_PaBar
1 bar in Pascals
Definition: imuConst.h:77
static const int IMU_ECODE_NO_CAP
no capabilities
Definition: imuConst.h:51
static const int IMU_ECODE_TIMEDOUT
operation timed out error
Definition: imuConst.h:53
const double SI_g0
m/s^2 accel. in standard gravity
Definition: imuConst.h:73
static const int IMU_OK
not an error, success
Definition: imuConst.h:45
static const int IMU_ECODE_BUSY
resource busy error
Definition: imuConst.h:54
static const int IMU_ECODE_RANGE
value out-of-range
Definition: imuConst.h:52
static const int IMU_ECODE_SYS
system (errno) error
Definition: imuConst.h:48
static const int IMU_ECODE_NO_SENSOR
no sensor
Definition: imuConst.h:50
static const int IMU_ECODE_GEN
general, unspecified error
Definition: imuConst.h:47
const double SI_K
0 Celsius in Kelvins
Definition: imuConst.h:74
static const int IMU_ECODE_NUMOF
number of error codes
Definition: imuConst.h:58
RoadNarrows Robotics standard namespace.
Definition: HID.h:65
static const int IMU_ECODE_BADEC
bad error code
Definition: imuConst.h:56
const double SI_PaPsi
1 psi in Pascals
Definition: imuConst.h:75
static const int IMU_ECODE_INTERNAL
internal error (bug)
Definition: imuConst.h:49