oem7_imu.cpp
Go to the documentation of this file.
1 //
3 // Copyright (c) 2020 NovAtel Inc.
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal
7 // in the Software without restriction, including without limitation the rights
8 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 // copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be included in all
13 // copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 // SOFTWARE.
22 //
24 
26 
27 
28 #include <cmath> // PI
29 
30 namespace novatel_oem7_driver
31 {
32 
33 const double ONE_G = 9.80665;
34 
38 inline double arcsecondsToRadians(double arcsecs)
39 {
40  return arcsecs * M_PI / (180.0 * 3600.0);
41 }
42 
46 inline double degreesToRadians(double degrees)
47 {
48  return degrees * M_PI / 180.0;
49 }
50 
54 inline double feetToMeters(double feet)
55 {
56  return feet / 3.2808;
57 }
58 
59 
60 bool
62  oem7_imu_type_t imu_type,
63  imu_rate_t imu_rate,
64  double& gyro_scale,
65  double& acc_scale)
66 {
67  // Refer to RAWIMUSX in OEM7 documentation.
68 
69  switch(imu_type)
70  {
71  case IMU_TYPE_LN200:
72  gyro_scale = pow(2.0, -19);
73  acc_scale = pow(2.0, -14);
74  break;
75 
82  gyro_scale = pow(2.0, -33);
83  acc_scale = feetToMeters(pow(2.0, -27));
84  break;
85 
88  gyro_scale = pow(2.0, -33);
89  acc_scale = feetToMeters(pow(2.0, -26));
90  break;
91 
92 
93  case IMU_TYPE_IMAR_FSAS:
94  gyro_scale = arcsecondsToRadians(0.1 / pow(2, 8));
95  acc_scale = 0.05 / pow(2.0, 15);
96  break;
97 
98  case IMU_TYPE_ISA100C:
100  gyro_scale = 1.0E-9;
101  acc_scale = 2.0E-8;
102  break;
103 
104  case IMU_TYPE_ADIS16488:
105  gyro_scale = degreesToRadians(720.0/pow(2,31));
106  acc_scale = 200.0 / pow(2, 31);
107  break;
108 
109  case IMU_TYPE_STIM300:
110  case IMU_TYPE_STIM_300D:
111  gyro_scale = degreesToRadians(pow(2,-21));
112  acc_scale = pow(2, -22);
113  break;
114 
115  case IMU_TYPE_KVH_1750:
116  gyro_scale = 0.1 / (3600.0 * 256.0);
117  acc_scale = 0.05 * pow(2.0, -15);
118  break;
119 
120  case IMU_TYPE_EPSON_G320:
122  gyro_scale = degreesToRadians(0.008 / pow(2.0, 16)) / imu_rate;
123  acc_scale = ( (0.2 / pow(2.0, 16)) * (ONE_G/1000.0) ) / imu_rate;
124  break;
125 
129  gyro_scale = pow(2.0, -33);
130  acc_scale = pow(2.0, -29);
131  break;
132 
133 
134  case IMU_TYPE_EPSON_G370:
135  gyro_scale = degreesToRadians(0.0151515/ pow(2.0, 16)) / imu_rate;
136  acc_scale = ((0.4 / pow(2.0, 16)) * (ONE_G/1000.0)) / imu_rate;
137  break;
138 
139  case IMU_TYPE_KVH_COTS:
140  gyro_scale = 0.1 / (3600.0 * 256.0);
141  acc_scale = 0.05 / pow(2.0, 15);
142  break;
143 
144  case IMU_TYPE_UNKNOWN: // Unsupported
145  default:
146  return false;
147  };
148 
149  return true;
150 
151 }
152 
153 
154 }
novatel_oem7_driver::IMU_TYPE_HG1900_CA50
@ IMU_TYPE_HG1900_CA50
Definition: oem7_imu.hpp:42
novatel_oem7_driver::oem7_imu_type_t
oem7_imu_type_t
IMUs supported on OEM7 products; refer to INSCONFIG in the OEM7 manual.
Definition: oem7_imu.hpp:29
novatel_oem7_driver::IMU_TYPE_UNKNOWN
@ IMU_TYPE_UNKNOWN
Definition: oem7_imu.hpp:31
novatel_oem7_driver::IMU_TYPE_HG4930_AN04
@ IMU_TYPE_HG4930_AN04
Definition: oem7_imu.hpp:53
novatel_oem7_driver::IMU_TYPE_HG1700_AG17
@ IMU_TYPE_HG1700_AG17
Definition: oem7_imu.hpp:33
novatel_oem7_driver::IMU_TYPE_EPSON_G320_200HZ
@ IMU_TYPE_EPSON_G320_200HZ
Definition: oem7_imu.hpp:52
novatel_oem7_driver::degreesToRadians
double degreesToRadians(double degrees)
Definition: bestpos_handler.cpp:84
novatel_oem7_driver::IMU_TYPE_EPSON_G320
@ IMU_TYPE_EPSON_G320
Definition: oem7_imu.hpp:47
novatel_oem7_driver::IMU_TYPE_HG1700_AG62
@ IMU_TYPE_HG1700_AG62
Definition: oem7_imu.hpp:37
novatel_oem7_driver::IMU_TYPE_IMAR_FSAS
@ IMU_TYPE_IMAR_FSAS
Definition: oem7_imu.hpp:38
novatel_oem7_driver::IMU_TYPE_STIM300
@ IMU_TYPE_STIM300
Definition: oem7_imu.hpp:45
novatel_oem7_driver::IMU_TYPE_HG1930_AA99
@ IMU_TYPE_HG1930_AA99
Definition: oem7_imu.hpp:40
novatel_oem7_driver::IMU_TYPE_LN200
@ IMU_TYPE_LN200
Definition: oem7_imu.hpp:35
novatel_oem7_driver::IMU_TYPE_EPSON_G370
@ IMU_TYPE_EPSON_G370
Definition: oem7_imu.hpp:51
oem7_imu.hpp
novatel_oem7_driver::IMU_TYPE_KVH_COTS
@ IMU_TYPE_KVH_COTS
Definition: oem7_imu.hpp:39
novatel_oem7_driver::IMU_TYPE_STIM_300D
@ IMU_TYPE_STIM_300D
Definition: oem7_imu.hpp:49
novatel_oem7_driver::imu_rate_t
int imu_rate_t
IMU message output rate. Refer to INSCONFIG in the OEM7 manual.s.
Definition: oem7_imu.hpp:59
novatel_oem7_driver::arcsecondsToRadians
double arcsecondsToRadians(double arcsecs)
Definition: oem7_imu.cpp:38
novatel_oem7_driver::IMU_TYPE_ISA100C
@ IMU_TYPE_ISA100C
Definition: oem7_imu.hpp:41
novatel_oem7_driver::IMU_TYPE_LITEF_MICROIMU
@ IMU_TYPE_LITEF_MICROIMU
Definition: oem7_imu.hpp:48
novatel_oem7_driver::IMU_TYPE_HG1900_CA29
@ IMU_TYPE_HG1900_CA29
Definition: oem7_imu.hpp:34
novatel_oem7_driver::IMU_TYPE_KVH_1750
@ IMU_TYPE_KVH_1750
Definition: oem7_imu.hpp:46
novatel_oem7_driver::getImuRawScaleFactors
bool getImuRawScaleFactors(oem7_imu_type_t imu_type, imu_rate_t imu_rate, double &gyro_scale, double &acc_scale)
Definition: oem7_imu.cpp:61
novatel_oem7_driver::IMU_TYPE_HG1700_AG58
@ IMU_TYPE_HG1700_AG58
Definition: oem7_imu.hpp:36
novatel_oem7_driver::IMU_TYPE_ADIS16488
@ IMU_TYPE_ADIS16488
Definition: oem7_imu.hpp:44
novatel_oem7_driver::feetToMeters
double feetToMeters(double feet)
Definition: oem7_imu.cpp:54
novatel_oem7_driver::IMU_TYPE_HG1930_CA50
@ IMU_TYPE_HG1930_CA50
Definition: oem7_imu.hpp:43
novatel_oem7_driver::IMU_TYPE_HG4930_AN01
@ IMU_TYPE_HG4930_AN01
Definition: oem7_imu.hpp:50
novatel_oem7_driver::IMU_TYPE_HG4930_AN04_400HZ
@ IMU_TYPE_HG4930_AN04_400HZ
Definition: oem7_imu.hpp:54
novatel_oem7_driver
Definition: oem7_imu.hpp:25
novatel_oem7_driver::ONE_G
const double ONE_G
Definition: oem7_imu.cpp:33
novatel_oem7_driver::IMU_TYPE_HG1700_AG11
@ IMU_TYPE_HG1700_AG11
Definition: oem7_imu.hpp:32


novatel_oem7_driver
Author(s):
autogenerated on Sat Feb 3 2024 03:51:34