2
3
4
5
6
7
18#include "witmotion/version.h"
22
23
24
25
26
27
34static const float DEG2RAD = M_PI / 180.f;
37
38
39
40
57
58
59
60
76
77
78
79
81 {0x50,
"Real Time Clock"},
82 {0x51,
"Accelerations"},
83 {0x52,
"Angular velocities"},
84 {0x53,
"Spatial orientation (Euler angles)"},
85 {0x54,
"Magnetometer/Magnetic orientation"},
86 {0x55,
"Data ports (D0-D3) status"},
87 {0x56,
"Barometry/Altimeter"},
88 {0x57,
"GPS Coordinates"},
89 {0x58,
"GPS Ground Speed"},
90 {0x59,
"Spatial orientation (Quaternion)"},
91 {0x5A,
"GPS accuracy estimation"}
95
96
103 int8_t raw_signed[8];
105 int16_t raw_cells[4];
106 int32_t raw_large[2];
112
113
114
115
116
121
122
123
124
125
126
127
128
131
132
133
134
135
136
137
138
139
140
141
142
143
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
168
169
170
171
172
173
174
175
176
188
189
190
191
192
193
196
197
198
199
200
201
202
203
206
207
208
209
210
211
214
215
216
217
218
219
232
233
234
235
236
237
240
241
242
243
244
245
246
247
248
249
250
251
252
256
257
258
259
260
261
262
263
264
265
268
269
270
271
272
273
274
275
276
277
328
329
343
344
345
346
347
348
358 void Error(
const QString& description);
363Q_DECLARE_METATYPE(
witmotion::witmotion_datapacket);
364Q_DECLARE_METATYPE(
witmotion::witmotion_config_packet);
Abstract base class to program convenience classes for the sensors.
Definition types.h:350
virtual void RunPoll()=0
Public abstract slot to be implemented in the derived class. The common use is to start the polling t...
void Error(const QString &description)
Signal function to be emitted when the internal error reported in the polling thread or process....
Main namespace of Witmotion UART connection library.
Definition jy901-uart.h:19
witmotion_config_register_id
List of configuration slots (registers) available for the library.
Definition types.h:118
@ ridPortPWMLevelD3
Digital port D3 PWM high level pulse width, microseconds, 16-bit unsigned integer.
Definition types.h:224
@ ridAngularVelocityBiasY
Sets angular velocity zero point bias for Y axis. NOT YET PROVEN AS WORKING.
Definition types.h:182
@ ridSetMagnetometerY
Sets up origin point or impostor value (needed when the measurement is forced for output by ridOutput...
Definition types.h:295
@ ridTimeDayHour
Sets RTC to the given day of the month (witmotion_config_packet::setting.`raw[0]`) and hour (witmotio...
Definition types.h:285
@ ridGyroscopeRange
Regulates gyroscope value range according to witmotion_config_packet::setting.
Definition types.h:266
@ ridSetAltitudeHigh
Sets up high part of initial value for 32-bit altitude measurement register. NOT YET PROVEN AS WORKIN...
Definition types.h:308
@ ridPortPWMPeriodD1
Digital port D1 PWM period length, microseconds, 16-bit unsigned integer.
Definition types.h:226
@ ridSetAngleRoll
Sets up origin point or impostor value (needed when the measurement is forced for output by ridOutput...
Definition types.h:297
@ ridPortPWMLevelD0
Digital port D0 PWM high level pulse width, microseconds, 16-bit unsigned integer.
Definition types.h:221
@ ridGPSBaudRate
Regulates GPS receiver baud rate on port D1 (see ridPortModeD1).
Definition types.h:238
@ ridSetPortStatusD2
Action unknown, not yet documented by Witmotion.
Definition types.h:303
@ ridPortPWMPeriodD3
Digital port D3 PWM period length, microseconds, 16-bit unsigned integer.
Definition types.h:228
@ ridSetAltitudeLow
Sets up low part of initial value for 32-bit altitude measurement register. NOT YET PROVEN AS WORKING...
Definition types.h:307
@ ridSetTemperature
Sets up origin point or impostor value (needed when the corresponding spatial measurement is forced f...
Definition types.h:300
@ ridLED
Toggles on/off LED indication (for enclosed sensors only).
Definition types.h:230
@ ridMagnetometerBiasX
Sets magnetometer zero point bias for X axis. MAY BLOCK THE MEASUREMENTS
Definition types.h:184
@ ridSaveSettings
Saves the settings uploaded in the current bringup session, or resets it to default (if supported)....
Definition types.h:119
@ ridSetLatitudeHigh
Sets up high part of initial value for 32-bit latitude measurement register. NOT YET PROVEN AS WORKIN...
Definition types.h:312
@ ridInstructionStart
Instruction mode. 0x00 in witmotion_config_packet::setting.`raw[0]` means starting instruction mode,...
Definition types.h:282
@ ridIICAddress
Sets up I2C address of the sensor. Default value is 0x50, 7-bit unsigned integer in witmotion_config_...
Definition types.h:229
@ ridSetOrientationZ
Sets up origin point or impostor value (needed when the measurement is forced for output by ridOutput...
Definition types.h:319
@ ridSetMagnetometerZ
Sets up origin point or impostor value (needed when the measurement is forced for output by ridOutput...
Definition types.h:296
@ ridSetAccelerationX
Sets up origin point or impostor value (needed when the measurement is forced for output by ridOutput...
Definition types.h:288
@ ridSetAngularVelocityY
Sets up origin point or impostor value (needed when the measurement is forced for output by ridOutput...
Definition types.h:292
@ ridSetOrientationY
Sets up origin point or impostor value (needed when the measurement is forced for output by ridOutput...
Definition types.h:318
@ ridSetPortStatusD0
Action unknown, not yet documented by Witmotion.
Definition types.h:301
@ ridSetPressureHigh
Sets up high part of initial value for 32-bit pressure measurement register. NOT YET PROVEN AS WORKIN...
Definition types.h:306
@ ridMagnetometerBiasY
Sets magnetometer zero point bias for Y axis. MAY BLOCK THE MEASUREMENTS
Definition types.h:185
@ ridSetPressureLow
Sets up low part of initial value for 32-bit pressure measurement register. NOT YET PROVEN AS WORKING...
Definition types.h:305
@ ridPortPWMLevelD1
Digital port D1 PWM high level pulse width, microseconds, 16-bit unsigned integer.
Definition types.h:222
@ ridSetGPSYaw
Sets up initial or impostor value (needed when the measurement is forced for output by ridOutputValue...
Definition types.h:314
@ ridSetMagnetometerX
Sets up origin point or impostor value (needed when the measurement is forced for output by ridOutput...
Definition types.h:294
@ ridSetAngularVelocityX
Sets up origin point or impostor value (needed when the measurement is forced for output by ridOutput...
Definition types.h:291
@ ridSetLongitudeHigh
Sets up high part of initial value for 32-bit longitude measurement register. NOT YET PROVEN AS WORKI...
Definition types.h:310
@ ridOutputFrequency
Regulates output frequency.
Definition types.h:166
@ ridSetOrientationW
Sets up origin point or impostor value (needed when the measurement is forced for output by ridOutput...
Definition types.h:320
@ ridPortModeD2
Digital port D2 mode.
Definition types.h:212
@ ridTransitionAlgorithm
Regulates whether 9-axis (0x01 in witmotion_config_packet::setting.`raw[0]`) or 6-axis (0x00) transit...
Definition types.h:281
@ ridSetAccelerationZ
Sets up origin point or impostor value (needed when the measurement is forced for output by ridOutput...
Definition types.h:290
@ ridPortPWMPeriodD2
Digital port D2 PWM period length, microseconds, 16-bit unsigned integer.
Definition types.h:227
@ ridSetOrientationX
Sets up origin point or impostor value (needed when the measurement is forced for output by ridOutput...
Definition types.h:317
@ ridSetAngularVelocityZ
Sets up origin point or impostor value (needed when the measurement is forced for output by ridOutput...
Definition types.h:293
@ ridAccelerometerRange
Regulates accelerometer value range according to witmotion_config_packet::setting.
Definition types.h:278
@ ridPortModeD3
Digital port D3 mode.
Definition types.h:220
@ ridGyroscopeAutoCalibrate
Toggles on/off automatic precalibration of the gyroscope. witmotion_config_packet::setting....
Definition types.h:322
@ ridSetGPSAltitude
Sets up initial or impostor value (needed when the measurement is forced for output by ridOutputValue...
Definition types.h:313
@ ridPortPWMPeriodD0
Digital port D0 PWM period length, microseconds, 16-bit unsigned integer.
Definition types.h:225
@ ridPortModeD1
Digital port D1 mode.
Definition types.h:204
@ ridTimeYearMonth
Sets RTC to the given year (witmotion_config_packet::setting.`raw[0]`) and month (witmotion_config_pa...
Definition types.h:284
@ ridTimeMilliseconds
Sets RTC to the given milliseconds exposed as 16-bit unsigned integer.
Definition types.h:287
@ ridAngularVelocityBiasX
Sets angular velocity zero point bias for X axis. NOT YET PROVEN AS WORKING.
Definition types.h:181
@ ridInstallationDirection
Toggles on/off internal rotation transform for vertical installation. witmotion_config_packet::settin...
Definition types.h:280
@ ridAccelerationBiasZ
Sets acceleration zero point bias for Z axis, refer to Acceleration bias calculation page for explana...
Definition types.h:180
@ ridStandbyMode
Toggles dormant mode. witmotion_config_packet::setting.`raw[0]` should be set to 0x01,...
Definition types.h:279
@ ridSetPortStatusD3
Action unknown, not yet documented by Witmotion.
Definition types.h:304
@ ridSetGPSGroundSpeedHigh
Sets up high part of initial value for 32-bit GPS ground speed measurement register....
Definition types.h:316
@ ridSetGPSGroundSpeedLow
Sets up low part of initial value for 32-bit GPS ground speed measurement register....
Definition types.h:315
@ ridTimeMinuteSecond
Sets RTC to the given minute (witmotion_config_packet::setting.`raw[0]`) and second (witmotion_config...
Definition types.h:286
@ ridAccelerationBiasX
Sets acceleration zero point bias for X axis, refer to Acceleration bias calculation page for explana...
Definition types.h:178
@ ridPortBaudRate
Regulates port baud rate.
Definition types.h:177
@ ridAccelerationBiasY
Sets acceleration zero point bias for Y axis, refer to Acceleration bias calculation page for explana...
Definition types.h:179
@ ridCalibrate
Sets the sensor to calibration mode.
Definition types.h:129
@ ridOutputValueSet
Regulates sensor output.
Definition types.h:144
@ ridSetPortStatusD1
Action unknown, not yet documented by Witmotion.
Definition types.h:302
@ ridSetAnglePitch
Sets up origin point or impostor value (needed when the measurement is forced for output by ridOutput...
Definition types.h:298
@ ridMagnetometerBiasZ
Sets magnetometer zero point bias for Z axis. MAY BLOCK THE MEASUREMENTS
Definition types.h:186
@ ridFilterBandwidth
Regulates internal filter bandwidth according to witmotion_config_packet::setting.
Definition types.h:253
@ ridPortModeD0
Digital port D0 mode.
Definition types.h:194
@ ridSetAngleYaw
Sets up origin point or impostor value (needed when the measurement is forced for output by ridOutput...
Definition types.h:299
@ ridPortPWMLevelD2
Digital port D2 PWM high level pulse width, microseconds, 16-bit unsigned integer.
Definition types.h:223
@ ridSetLongitudeLow
Sets up low part of initial value for 32-bit longitude measurement register. NOT YET PROVEN AS WORKIN...
Definition types.h:309
@ ridUnlockConfiguration
"Magic" vendor-defined value for configuration unlock packet 0xFF 0xAA 0x69 0x88 0xB5.
Definition types.h:324
@ ridSetLatitudeLow
Sets up low part of initial value for 32-bit latitude measurement register. NOT YET PROVEN AS WORKING...
Definition types.h:311
@ ridSetAccelerationY
Sets up origin point or impostor value (needed when the measurement is forced for output by ridOutput...
Definition types.h:289
@ ridAngularVelocityBiasZ
Sets angular velocity zero point bias for Z axis. NOT YET PROVEN AS WORKING.
Definition types.h:183
static const std::map< uint8_t, std::string > witmotion_packet_descriptions
Packet ID string set to store built-in descriptions for message-enumerator.
Definition types.h:80
witmotion_packet_id
Packet type IDs from the vendor-defined protocol.
Definition types.h:42
@ pidRTC
Real-Time-Clock: Year from 2000, Month, Day, Hour, Minute, Second (8-bit unsigned integers) + Millise...
Definition types.h:43
@ pidGPSAccuracy
GPS: visible satellites + variance vector [East-North-Up] (16-bit binary normalized quasi-floats)
Definition types.h:53
@ pidAngles
Euler angles + temperature/reserved field [Roll-Pitch-Yaw] (16-bit binary normalized quasi-floats)
Definition types.h:46
@ pidOrientation
Orientation defined as quaternion [X-Y-Z-W], when available from the sensor firmware (16-bit binary n...
Definition types.h:52
@ pidGPSCoordinates
GPS: longitude + latitude, if supported by hardware (32-bit binary normalized quasi-floats)
Definition types.h:50
@ pidGPSGroundSpeed
GPS: ground speed (32-bit binary normalized quasi-float) + altitude + angular velocity around vertica...
Definition types.h:51
@ pidDataPortStatus
Data port status packet, vendor-defined value.
Definition types.h:48
@ pidAltimeter
Altimeter + Barometer output (32-bit binary normalized quasi-floats)
Definition types.h:49
@ pidMagnetometer
Magnetic field tensity + temperature/reserved field [world X-Y-Z] (16-bit binary normalized quasi-flo...
Definition types.h:47
@ pidAcceleration
Linear accelerations + temperature/reserved field [X-Y-Z] (16-bit binary normalized quasi-floats)
Definition types.h:44
@ pidAngularVelocity
Angular velocities + temperature/reserved field [Roll-Pitch-Yaw] (16-bit binary normalized quasi-floa...
Definition types.h:45
static const uint8_t WITMOTION_HEADER_BYTE
Packet header byte value (vendor protocol-specific)
Definition types.h:31
static const uint8_t WITMOTION_CONFIG_HEADER
Configuration header byte value (vendor protocol-specific)
Definition types.h:32
static const std::set< size_t > witmotion_registered_ids
Packet ID set to retrieve descriptions via witmotion_packet_descriptions.
Definition types.h:61
static const uint8_t WITMOTION_CONFIG_KEY
Configuration marker key byte value (vendor protocol-specific)
Definition types.h:33
Generic structure respresenting the standard 5-byte configuration command defined in Witmotion protoc...
Definition types.h:331
uint8_t key_byte
Packet type, constantly set to WITMOTION_CONFIG_KEY.
Definition types.h:333
uint8_t header_byte
Header byte, set constantly to WITMOTION_CONFIG_HEADER.
Definition types.h:332
uint8_t address_byte
Configuration slot address, refers to the registered values in witmotion_config_register_id.
Definition types.h:334
Generic structure respresenting the standard 11-byte datapacket defined in Witmotion protocol.
Definition types.h:98
uint8_t id_byte
Packet type ID, referring to witmotion_packet_id, otherwise the packet is considered of unknown type.
Definition types.h:100
uint8_t crc
Validation CRC for the packet. Calculated as an equivalent to the following operation: reinterpret_ca...
Definition types.h:108
uint8_t header_byte
Header byte, set constantly to WITMOTION_HEADER_BYTE.
Definition types.h:99