Skyward boardcore
Loading...
Searching...
No Matches
VN300Defs.h
Go to the documentation of this file.
1/* Copyright (c) 2023 Skyward Experimental Rocketry
2 * Authors: Lorenzo Cucchi, Fabrizio Monti
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
22
23#pragma once
24#include <reflect.hpp>
25
26namespace Boardcore
27{
28
29namespace VN300Defs
30{
31
45
70
89
109
133
153
174
179{
180 float posX; // Relative position of GPS antenna (X-axis)
181 float posY;
182 float posZ;
183 float uncX; // Uncertainty in the X-axis position measurement
184 float uncY;
185 float uncZ;
186};
187
192{
193 uint64_t insTimestamp;
194 uint16_t gpsFix;
195 uint16_t insStatus;
196 float yaw;
197 float pitch;
198 float roll;
199 float latitude;
201 float altitude;
202 float velocityX; // Estimated velocity (NED) in m/s
205
206 static constexpr auto reflect()
207 {
208 return STRUCT_DEF(
209 INSData,
210 FIELD_DEF(insTimestamp) FIELD_DEF(gpsFix) FIELD_DEF(insStatus)
211 FIELD_DEF(yaw) FIELD_DEF(pitch) FIELD_DEF(roll)
212 FIELD_DEF(latitude) FIELD_DEF(longitude) FIELD_DEF(altitude)
213 FIELD_DEF(velocityX) FIELD_DEF(velocityY)
214 FIELD_DEF(velocityZ));
215 }
216};
217
221enum class SampleOptions : uint8_t
222{
223 FULL,
224 REDUCED,
225};
226
231struct __attribute__((packed)) BinaryDataFull
232{
233 uint8_t selectedGroups; // Indicates which groups are selected
234 uint16_t selectedFieldsCommonGroup; // Indicates which fields are selected
235 uint16_t selectedFieldsGnssGroup; // Indicates which fields are selected
236 float yaw;
237 float pitch;
238 float roll;
239 float quaternionX;
240 float quaternionY;
241 float quaternionZ;
242 float quaternionW;
243 float angularX;
244 float angularY;
245 float angularZ;
246 float velocityX; // Estimated velocity (NED) in m/s
247 float velocityY;
248 float velocityZ;
249 float accelX;
250 float accelY;
251 float accelZ;
252 float magneticX;
253 float magneticY;
254 float magneticZ;
255 float temperature;
256 float pressure;
257 uint16_t insStatus; // Status of the INS
258 uint8_t numsats; // Number of tracked gps satellites
259 uint8_t gpsFix;
260 double latitude;
261 double longitude;
262 double altitude;
263 uint16_t checksum;
264};
265
277struct __attribute__((packed)) BinaryDataReduced
278{
279 uint8_t selectedGroups; // Indicates which groups are selected
280 uint16_t selectedFieldsCommonGroup; // Indicates which fields are selected
281 uint16_t selectedFieldsGnssGroup; // Indicates which fields are selected
282 float yaw;
283 float pitch;
284 float roll;
285 float quaternionX;
286 float quaternionY;
287 float quaternionZ;
288 float quaternionW;
289 float angularX;
290 float angularY;
291 float angularZ;
292 float accelX;
293 float accelY;
294 float accelZ;
295 uint8_t gpsFix;
296 double latitude;
297 double longitude;
298 double altitude;
299 uint16_t checksum;
300};
301
302} // namespace VN300Defs
303
304} // namespace Boardcore
CommonGroup
Values used to select data for the binary output from group 1 (common group).
Definition VN300Defs.h:51
@ COMMONGROUP_TIMEGPS
Gps time.
Definition VN300Defs.h:54
@ COMMONGROUP_TIMESYNCIN
Time since last sync in trigger.
Definition VN300Defs.h:55
@ COMMONGROUP_VELOCITY
Velocity.
Definition VN300Defs.h:60
@ COMMONGROUP_TIMESTARTUP
Time since startup (nanoseconds).
Definition VN300Defs.h:53
@ COMMONGROUP_YAWPITCHROLL
Yaw pitch roll.
Definition VN300Defs.h:56
@ COMMONGROUP_TIMEGPSPPS
Time since last GpsPps trigger.
Definition VN300Defs.h:68
@ COMMONGROUP_SYNCINCNT
SyncIn count.
Definition VN300Defs.h:67
@ COMMONGROUP_ACCEL
Acceleration compensated (body).
Definition VN300Defs.h:61
@ COMMONGROUP_ANGULARRATE
Angular Rate.
Definition VN300Defs.h:58
@ COMMONGROUP_INSSTATUS
Ins status.
Definition VN300Defs.h:66
@ COMMONGROUP_DELTATHETA
Delta time, theta and velocity.
Definition VN300Defs.h:65
@ COMMONGROUP_IMU
Uncompensated gyro and accelerometer.
Definition VN300Defs.h:62
@ COMMONGROUP_QUATERNION
Quaternion.
Definition VN300Defs.h:57
@ COMMONGROUP_MAGPRES
Compensated magnetic, temperature and pressure.
Definition VN300Defs.h:63
@ COMMONGROUP_POSITION
Position.
Definition VN300Defs.h:59
InsGroup
Values used to select data for the binary output from group 6 (ins group).
Definition VN300Defs.h:159
@ INSGROUP_ACCELECEF
Compensated acceleration (ECEF).
Definition VN300Defs.h:168
@ INSGROUP_MAGECEF
Compensated magnetic (ECEF).
Definition VN300Defs.h:167
@ INSGROUP_LINEARACCELECEF
Compensated linear acceleration (ECEF).
Definition VN300Defs.h:169
@ INSGROUP_POSLLA
Position (latitude, longitude, altitude).
Definition VN300Defs.h:162
@ INSGROUP_VELBODY
Velocity (body).
Definition VN300Defs.h:164
@ INSGROUP_VELNED
Velocity (NED).
Definition VN300Defs.h:165
@ INSGROUP_VELECEF
Velocity (ECEF).
Definition VN300Defs.h:166
@ INSGROUP_VELU
Velocity uncertainty.
Definition VN300Defs.h:172
@ INSGROUP_POSECEF
Position (ECEF).
Definition VN300Defs.h:163
@ INSGROUP_INSSTATUS
Status.
Definition VN300Defs.h:161
@ INSGROUP_POSU
Position uncertainty.
Definition VN300Defs.h:171
ImuGroup
Values used to select data for the binary output from group 3 (imu group).
Definition VN300Defs.h:95
@ IMUGROUP_UNCOMPMAG
Uncompensated magnetic.
Definition VN300Defs.h:98
@ IMUGROUP_UNCOMPACCEL
Uncompensated accelerometer.
Definition VN300Defs.h:99
@ IMUGROUP_DELTATHETA
Delta theta angles.
Definition VN300Defs.h:103
@ IMUGROUP_PRES
Pressure.
Definition VN300Defs.h:102
@ IMUGROUP_ACCEL
Compensated accelerometer.
Definition VN300Defs.h:106
@ IMUGROUP_IMUSTATUS
Imu status.
Definition VN300Defs.h:97
@ IMUGROUP_UNCOMPGYRO
Uncompensated gyroscope.
Definition VN300Defs.h:100
@ IMUGROUP_MAG
Compensated magnetometer.
Definition VN300Defs.h:105
@ IMUGROUP_DELTAVEL
Delta velocity.
Definition VN300Defs.h:104
@ IMUGROUP_ANGULARRATE
Compensated gyroscope.
Definition VN300Defs.h:107
@ IMUGROUP_TEMP
Temperature.
Definition VN300Defs.h:101
TimeGroup
Values used to select data for the binary output from group 2 (time group).
Definition VN300Defs.h:76
@ TIMEGROUP_GPSWEEK
Gps week.
Definition VN300Defs.h:81
@ TIMEGROUP_SYNCOUTCNT
Sync out trigger count.
Definition VN300Defs.h:86
@ TIMEGROUP_TIMEUTC
UTC time.
Definition VN300Defs.h:84
@ TIMEGROUP_TIMESTATUS
Time valid status flag.
Definition VN300Defs.h:87
@ TIMEGROUP_TIMEGPSPPS
Time since last GpsPps trigger.
Definition VN300Defs.h:83
@ TIMEGROUP_SYNCINCNT
Sync in trigger count.
Definition VN300Defs.h:85
@ TIMEGROUP_TIMESYNCIN
Time since last sync in trigger.
Definition VN300Defs.h:82
@ TIMEGROUP_GPSTOW
Time since start of gps week.
Definition VN300Defs.h:80
@ TIMEGROUP_TIMESTARTUP
Time since startup (nanoseconds).
Definition VN300Defs.h:78
@ TIMEGROUP_TIMEGPS
Gps time.
Definition VN300Defs.h:79
BinaryGroup
The groups of binary data available from the sensor.
Definition VN300Defs.h:36
@ BINARYGROUP_IMU
IMU group.
Definition VN300Defs.h:39
@ BINARYGROUP_INS
INS group.
Definition VN300Defs.h:42
@ BINARYGROUP_TIME
Time group.
Definition VN300Defs.h:38
@ BINARYGROUP_ATTITUDE
Attitude group.
Definition VN300Defs.h:41
@ BINARYGROUP_COMMON
Common group.
Definition VN300Defs.h:37
@ BINARYGROUP_GPS
GPS group.
Definition VN300Defs.h:40
@ BINARYGROUP_GPS2
GPS2 group.
Definition VN300Defs.h:43
SampleOptions
Sample options (data output packets) available.
Definition VN300Defs.h:222
@ REDUCED
Only data needed for the reduced data packet.
GpsGroup
Values used to select data for the binary output from group 4 and 7 (gps and gps2 group).
Definition VN300Defs.h:115
@ GPSGROUP_POSECEF
Gps position (ECEF).
Definition VN300Defs.h:124
@ GPSGROUP_VELNED
Gps velocity (NED).
Definition VN300Defs.h:125
@ GPSGROUP_NUMSATS
Number of tracked satellites.
Definition VN300Defs.h:120
@ GPSGROUP_WEEK
Gps week.
Definition VN300Defs.h:119
@ GPSGROUP_POSLLA
Gps position (latitude, longitude, altitude).
Definition VN300Defs.h:122
@ GPSGROUP_FIX
Gps fix.
Definition VN300Defs.h:121
@ GPSGROUP_UTC
Gps UTC time.
Definition VN300Defs.h:117
@ GPSGROUP_TIMEINFO
Gps time status and leap seconds.
Definition VN300Defs.h:130
@ GPSGROUP_DOP
Dilution of precision values.
Definition VN300Defs.h:131
@ GPSGROUP_VELU
Velocity uncertainty.
Definition VN300Defs.h:128
@ GPSGROUP_TIMEU
Time uncertainty.
Definition VN300Defs.h:129
@ GPSGROUP_TOW
Gps time of week.
Definition VN300Defs.h:118
@ GPSGROUP_VELECEF
Gps velocity (ECEF).
Definition VN300Defs.h:126
@ GPSGROUP_POSU
Position uncertainty (NED).
Definition VN300Defs.h:127
AttitudeGroup
Values used to select data for the binary output from group 5 (attitude group).
Definition VN300Defs.h:139
@ ATTITUDEGROUP_ACCELNED
Compensated acceleration (NED).
Definition VN300Defs.h:146
@ ATTITUDEGROUP_LINEARACCELBODY
Compensated linear acceleration (no gravity).
Definition VN300Defs.h:147
@ ATTITUDEGROUP_LINEARACCELNED
Compensated linear acceleration (no gravity) (NED).
Definition VN300Defs.h:149
@ ATTITUDEGROUP_YAWPITCHROLL
Yaw pitch roll.
Definition VN300Defs.h:142
@ ATTITUDEGROUP_QUATERNION
Quaternion.
Definition VN300Defs.h:143
@ ATTITUDEGROUP_MAGNED
Compensated magnetic (NED).
Definition VN300Defs.h:145
@ ATTITUDEGROUP_DCM
Directional cosine matrix.
Definition VN300Defs.h:144
@ ATTITUDEGROUP_YPRU
Yaw Pitch Roll uncertainty.
Definition VN300Defs.h:151
@ ATTITUDEGROUP_VPESTATUS
VpeStatus.
Definition VN300Defs.h:141
struct __attribute__((packed)) BinaryDataFull
Structure to handle binary message in case of full sampling (all available measurements are taken).
Definition VN300Defs.h:231
Driver for the VN100S IMU.
Structure to handle antenna A position units [m].
Definition VN300Defs.h:179
Structure to handle INS (inertial navigation system) data.
Definition VN300Defs.h:192
static constexpr auto reflect()
Definition VN300Defs.h:206