0.3.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
VectorNavBinaryOutput.hpp
Go to the documentation of this file.
1// This file is part of INSTINCT, the INS Toolkit for Integrated
2// Navigation Concepts and Training by the Institute of Navigation of
3// the University of Stuttgart, Germany.
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
13
14#pragma once
15
16#include <memory>
17
18#include "NodeData/NodeData.hpp"
20#include "util/Eigen.hpp"
21
23#include "util/Vendor/VectorNav/BinaryOutputs/ImuOutputs.hpp"
24#include "util/Vendor/VectorNav/BinaryOutputs/GnssOutputs.hpp"
25#include "util/Vendor/VectorNav/BinaryOutputs/AttitudeOutputs.hpp"
26#include "util/Vendor/VectorNav/BinaryOutputs/InsOutputs.hpp"
27
28namespace NAV
29{
32{
33 public:
37 : imuPos(imuPos) {}
38
41 [[nodiscard]] static std::string type()
42 {
43 return "VectorNavBinaryOutput";
44 }
45
48 [[nodiscard]] std::string getType() const override { return type(); }
49
52 [[nodiscard]] static std::vector<std::string> parentTypes()
53 {
54 return { NodeData::type() };
55 }
56
58 [[nodiscard]] static std::vector<std::string> GetStaticDataDescriptors()
59 {
60 return {
61 // Group 2 (Time)
62 "Time::TimeStartup [ns]",
63 "Time::TimeGps [ns]",
64 "Time::GpsTow [ns]",
65 "Time::GpsWeek",
66 "Time::TimeSyncIn [ns]",
67 "Time::TimeGpsPps [ns]",
68 "Time::TimeUTC::year",
69 "Time::TimeUTC::month",
70 "Time::TimeUTC::day",
71 "Time::TimeUTC::hour",
72 "Time::TimeUTC::min",
73 "Time::TimeUTC::sec",
74 "Time::TimeUTC::ms",
75 "Time::SyncInCnt",
76 "Time::SyncOutCnt",
77 "Time::TimeStatus::timeOk",
78 "Time::TimeStatus::dateOk",
79 "Time::TimeStatus::utcTimeValid",
80 // Group 3 (IMU)
81 "IMU::ImuStatus",
82 "IMU::UncompMag::X [Gauss]",
83 "IMU::UncompMag::Y [Gauss]",
84 "IMU::UncompMag::Z [Gauss]",
85 "IMU::UncompAccel::X [m/s^2]",
86 "IMU::UncompAccel::Y [m/s^2]",
87 "IMU::UncompAccel::Z [m/s^2]",
88 "IMU::UncompGyro::X [rad/s]",
89 "IMU::UncompGyro::Y [rad/s]",
90 "IMU::UncompGyro::Z [rad/s]",
91 "IMU::Temp [Celsius]",
92 "IMU::Pres [kPa]",
93 "IMU::DeltaTime [s]",
94 "IMU::DeltaTheta::X [deg]",
95 "IMU::DeltaTheta::Y [deg]",
96 "IMU::DeltaTheta::Z [deg]",
97 "IMU::DeltaVel::X [m/s]",
98 "IMU::DeltaVel::Y [m/s]",
99 "IMU::DeltaVel::Z [m/s]",
100 "IMU::Mag::X [Gauss]",
101 "IMU::Mag::Y [Gauss]",
102 "IMU::Mag::Z [Gauss]",
103 "IMU::Accel::X [m/s^2]",
104 "IMU::Accel::Y [m/s^2]",
105 "IMU::Accel::Z [m/s^2]",
106 "IMU::AngularRate::X [rad/s]",
107 "IMU::AngularRate::Y [rad/s]",
108 "IMU::AngularRate::Z [rad/s]",
109 // Group 4 (GNSS1)
110 "GNSS1::UTC::year",
111 "GNSS1::UTC::month",
112 "GNSS1::UTC::day",
113 "GNSS1::UTC::hour",
114 "GNSS1::UTC::min",
115 "GNSS1::UTC::sec",
116 "GNSS1::UTC::ms",
117 "GNSS1::Tow [ns]",
118 "GNSS1::Week",
119 "GNSS1::NumSats",
120 "GNSS1::Fix",
121 "GNSS1::PosLla::latitude [deg]",
122 "GNSS1::PosLla::longitude [deg]",
123 "GNSS1::PosLla::altitude [m]",
124 "GNSS1::PosEcef::X [m]",
125 "GNSS1::PosEcef::Y [m]",
126 "GNSS1::PosEcef::Z [m]",
127 "GNSS1::VelNed::N [m/s]",
128 "GNSS1::VelNed::E [m/s]",
129 "GNSS1::VelNed::D [m/s]",
130 "GNSS1::VelEcef::X [m/s]",
131 "GNSS1::VelEcef::Y [m/s]",
132 "GNSS1::VelEcef::Z [m/s]",
133 "GNSS1::PosU::N [m]",
134 "GNSS1::PosU::E [m]",
135 "GNSS1::PosU::D [m]",
136 "GNSS1::VelU [m/s]",
137 "GNSS1::TimeU [s]",
138 "GNSS1::TimeInfo::Status::timeOk",
139 "GNSS1::TimeInfo::Status::dateOk",
140 "GNSS1::TimeInfo::Status::utcTimeValid",
141 "GNSS1::TimeInfo::LeapSeconds",
142 "GNSS1::DOP::g",
143 "GNSS1::DOP::p",
144 "GNSS1::DOP::t",
145 "GNSS1::DOP::v",
146 "GNSS1::DOP::h",
147 "GNSS1::DOP::n",
148 "GNSS1::DOP::e",
149 "GNSS1::SatInfo::NumSats",
150 "GNSS1::RawMeas::Tow [s]",
151 "GNSS1::RawMeas::Week",
152 "GNSS1::RawMeas::NumSats",
153 // Group 5 (Attitude)
154 "Att::VpeStatus::AttitudeQuality",
155 "Att::VpeStatus::GyroSaturation",
156 "Att::VpeStatus::GyroSaturationRecovery",
157 "Att::VpeStatus::MagDisturbance",
158 "Att::VpeStatus::MagSaturation",
159 "Att::VpeStatus::AccDisturbance",
160 "Att::VpeStatus::AccSaturation",
161 "Att::VpeStatus::KnownMagDisturbance",
162 "Att::VpeStatus::KnownAccelDisturbance",
163 "Att::YawPitchRoll::Y [deg]",
164 "Att::YawPitchRoll::P [deg]",
165 "Att::YawPitchRoll::R [deg]",
166 "Att::Quaternion::w",
167 "Att::Quaternion::x",
168 "Att::Quaternion::y",
169 "Att::Quaternion::z",
170 "Att::DCM::0-0",
171 "Att::DCM::0-1",
172 "Att::DCM::0-2",
173 "Att::DCM::1-0",
174 "Att::DCM::1-1",
175 "Att::DCM::1-2",
176 "Att::DCM::2-0",
177 "Att::DCM::2-1",
178 "Att::DCM::2-2",
179 "Att::MagNed::N [Gauss]",
180 "Att::MagNed::E [Gauss]",
181 "Att::MagNed::D [Gauss]",
182 "Att::AccelNed::N [m/s^2]",
183 "Att::AccelNed::E [m/s^2]",
184 "Att::AccelNed::D [m/s^2]",
185 "Att::LinearAccelBody::X [m/s^2]",
186 "Att::LinearAccelBody::Y [m/s^2]",
187 "Att::LinearAccelBody::Z [m/s^2]",
188 "Att::LinearAccelNed::N [m/s^2]",
189 "Att::LinearAccelNed::E [m/s^2]",
190 "Att::LinearAccelNed::D [m/s^2]",
191 "Att::YprU::Y [deg]",
192 "Att::YprU::P [deg]",
193 "Att::YprU::R [deg]",
194 // Group 6 (INS)
195 "INS::InsStatus::Mode",
196 "INS::InsStatus::GpsFix",
197 "INS::InsStatus::Error::IMU",
198 "INS::InsStatus::Error::MagPres",
199 "INS::InsStatus::Error::GNSS",
200 "INS::InsStatus::GpsHeadingIns",
201 "INS::InsStatus::GpsCompass",
202 "INS::PosLla::latitude [deg]",
203 "INS::PosLla::longitude [deg]",
204 "INS::PosLla::altitude [m]",
205 "INS::PosEcef::X [m]",
206 "INS::PosEcef::Y [m]",
207 "INS::PosEcef::Z [m]",
208 "INS::VelBody::X [m/s]",
209 "INS::VelBody::Y [m/s]",
210 "INS::VelBody::Z [m/s]",
211 "INS::VelNed::N [m/s]",
212 "INS::VelNed::E [m/s]",
213 "INS::VelNed::D [m/s]",
214 "INS::VelEcef::X [m/s]",
215 "INS::VelEcef::Y [m/s]",
216 "INS::VelEcef::Z [m/s]",
217 "INS::MagEcef::X [Gauss}",
218 "INS::MagEcef::Y [Gauss}",
219 "INS::MagEcef::Z [Gauss}",
220 "INS::AccelEcef::X [m/s^2]",
221 "INS::AccelEcef::Y [m/s^2]",
222 "INS::AccelEcef::Z [m/s^2]",
223 "INS::LinearAccelEcef::X [m/s^2]",
224 "INS::LinearAccelEcef::Y [m/s^2]",
225 "INS::LinearAccelEcef::Z [m/s^2]",
226 "INS::PosU [m]",
227 "INS::VelU [m/s]",
228 // Group 7 (GNSS2)
229 "GNSS2::UTC::year",
230 "GNSS2::UTC::month",
231 "GNSS2::UTC::day",
232 "GNSS2::UTC::hour",
233 "GNSS2::UTC::min",
234 "GNSS2::UTC::sec",
235 "GNSS2::UTC::ms",
236 "GNSS2::Tow [ns]",
237 "GNSS2::Week",
238 "GNSS2::NumSats",
239 "GNSS2::Fix",
240 "GNSS2::PosLla::latitude [deg]",
241 "GNSS2::PosLla::longitude [deg]",
242 "GNSS2::PosLla::altitude [m]",
243 "GNSS2::PosEcef::X [m]",
244 "GNSS2::PosEcef::Y [m]",
245 "GNSS2::PosEcef::Z [m]",
246 "GNSS2::VelNed::N [m/s]",
247 "GNSS2::VelNed::E [m/s]",
248 "GNSS2::VelNed::D [m/s]",
249 "GNSS2::VelEcef::X [m/s]",
250 "GNSS2::VelEcef::Y [m/s]",
251 "GNSS2::VelEcef::Z [m/s]",
252 "GNSS2::PosU::N [m]",
253 "GNSS2::PosU::E [m]",
254 "GNSS2::PosU::D [m]",
255 "GNSS2::VelU [m/s]",
256 "GNSS2::TimeU [s]",
257 "GNSS2::TimeInfo::Status::timeOk",
258 "GNSS2::TimeInfo::Status::dateOk",
259 "GNSS2::TimeInfo::Status::utcTimeValid",
260 "GNSS2::TimeInfo::LeapSeconds",
261 "GNSS2::DOP::g",
262 "GNSS2::DOP::p",
263 "GNSS2::DOP::t",
264 "GNSS2::DOP::v",
265 "GNSS2::DOP::h",
266 "GNSS2::DOP::n",
267 "GNSS2::DOP::e",
268 "GNSS2::SatInfo::NumSats",
269 "GNSS2::RawMeas::Tow [s]",
270 "GNSS2::RawMeas::Week",
271 "GNSS2::RawMeas::NumSats",
272 };
273 }
274
276 [[nodiscard]] static constexpr size_t GetStaticDescriptorCount() { return 205; }
277
279 [[nodiscard]] std::vector<std::string> staticDataDescriptors() const override { return GetStaticDataDescriptors(); }
280
282 [[nodiscard]] size_t staticDescriptorCount() const override { return GetStaticDescriptorCount(); }
283
287 [[nodiscard]] std::optional<double> getValueAt(size_t idx) const override
288 {
290 switch (idx)
291 {
292 // Group 2 (Time)
293 case 0: // Time::TimeStartup [ns]
294 if (timeOutputs && (timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMESTARTUP)) { return static_cast<double>(timeOutputs->timeStartup); }
295 break;
296 case 1: // Time::TimeGps [ns]
297 if (timeOutputs && (timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMEGPS)) { return static_cast<double>(timeOutputs->timeGps); }
298 break;
299 case 2: // Time::GpsTow [ns]
300 if (timeOutputs && (timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSTOW)) { return static_cast<double>(timeOutputs->gpsTow); }
301 break;
302 case 3: // Time::GpsWeek
303 if (timeOutputs && (timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSWEEK)) { return static_cast<double>(timeOutputs->gpsWeek); }
304 break;
305 case 4: // Time::TimeSyncIn [ns]
306 if (timeOutputs && (timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMESYNCIN)) { return static_cast<double>(timeOutputs->timeSyncIn); }
307 break;
308 case 5: // Time::TimeGpsPps [ns]
309 if (timeOutputs && (timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMEGPSPPS)) { return static_cast<double>(timeOutputs->timePPS); }
310 break;
311 case 6: // Time::TimeUTC::year
312 if (timeOutputs && (timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMEUTC)) { return static_cast<double>(timeOutputs->timeUtc.year); }
313 break;
314 case 7: // Time::TimeUTC::month
315 if (timeOutputs && (timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMEUTC)) { return static_cast<double>(timeOutputs->timeUtc.month); }
316 break;
317 case 8: // Time::TimeUTC::day
318 if (timeOutputs && (timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMEUTC)) { return static_cast<double>(timeOutputs->timeUtc.day); }
319 break;
320 case 9: // Time::TimeUTC::hour
321 if (timeOutputs && (timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMEUTC)) { return static_cast<double>(timeOutputs->timeUtc.hour); }
322 break;
323 case 10: // Time::TimeUTC::min
324 if (timeOutputs && (timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMEUTC)) { return static_cast<double>(timeOutputs->timeUtc.min); }
325 break;
326 case 11: // Time::TimeUTC::sec
327 if (timeOutputs && (timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMEUTC)) { return static_cast<double>(timeOutputs->timeUtc.sec); }
328 break;
329 case 12: // Time::TimeUTC::ms
330 if (timeOutputs && (timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMEUTC)) { return static_cast<double>(timeOutputs->timeUtc.ms); }
331 break;
332 case 13: // Time::SyncInCnt
333 if (timeOutputs && (timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_SYNCINCNT)) { return static_cast<double>(timeOutputs->syncInCnt); }
334 break;
335 case 14: // Time::SyncOutCnt
336 if (timeOutputs && (timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_SYNCOUTCNT)) { return static_cast<double>(timeOutputs->syncOutCnt); }
337 break;
338 case 15: // Time::TimeStatus::timeOk
339 if (timeOutputs && (timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMESTATUS)) { return static_cast<double>(timeOutputs->timeStatus.timeOk()); }
340 break;
341 case 16: // Time::TimeStatus::dateOk
342 if (timeOutputs && (timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMESTATUS)) { return static_cast<double>(timeOutputs->timeStatus.dateOk()); }
343 break;
344 case 17: // Time::TimeStatus::utcTimeValid
345 if (timeOutputs && (timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMESTATUS)) { return static_cast<double>(timeOutputs->timeStatus.utcTimeValid()); }
346 break;
347 // Group 3 (IMU)
348 case 18: // IMU::ImuStatus
349 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_IMUSTATUS)) { return static_cast<double>(imuOutputs->imuStatus); }
350 break;
351 case 19: // IMU::UncompMag::X [Gauss]
352 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPMAG)) { return static_cast<double>(imuOutputs->uncompMag(0)); }
353 break;
354 case 20: // IMU::UncompMag::Y [Gauss]
355 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPMAG)) { return static_cast<double>(imuOutputs->uncompMag(1)); }
356 break;
357 case 21: // IMU::UncompMag::Z [Gauss]
358 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPMAG)) { return static_cast<double>(imuOutputs->uncompMag(2)); }
359 break;
360 case 22: // IMU::UncompAccel::X [m/s^2]
361 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPACCEL)) { return static_cast<double>(imuOutputs->uncompAccel(0)); }
362 break;
363 case 23: // IMU::UncompAccel::Y [m/s^2]
364 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPACCEL)) { return static_cast<double>(imuOutputs->uncompAccel(1)); }
365 break;
366 case 24: // IMU::UncompAccel::Z [m/s^2]
367 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPACCEL)) { return static_cast<double>(imuOutputs->uncompAccel(2)); }
368 break;
369 case 25: // IMU::UncompGyro::X [rad/s]
370 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPGYRO)) { return static_cast<double>(imuOutputs->uncompGyro(0)); }
371 break;
372 case 26: // IMU::UncompGyro::Y [rad/s]
373 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPGYRO)) { return static_cast<double>(imuOutputs->uncompGyro(1)); }
374 break;
375 case 27: // IMU::UncompGyro::Z [rad/s]
376 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPGYRO)) { return static_cast<double>(imuOutputs->uncompGyro(2)); }
377 break;
378 case 28: // IMU::Temp [Celsius]
379 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_TEMP)) { return static_cast<double>(imuOutputs->temp); }
380 break;
381 case 29: // IMU::Pres [kPa]
382 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_PRES)) { return static_cast<double>(imuOutputs->pres); }
383 break;
384 case 30: // IMU::DeltaTime [s]
385 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_DELTATHETA)) { return static_cast<double>(imuOutputs->deltaTime); }
386 break;
387 case 31: // IMU::DeltaTheta::X [deg]
388 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_DELTATHETA)) { return static_cast<double>(imuOutputs->deltaTheta(0)); }
389 break;
390 case 32: // IMU::DeltaTheta::Y [deg]
391 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_DELTATHETA)) { return static_cast<double>(imuOutputs->deltaTheta(1)); }
392 break;
393 case 33: // IMU::DeltaTheta::Z [deg]
394 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_DELTATHETA)) { return static_cast<double>(imuOutputs->deltaTheta(2)); }
395 break;
396 case 34: // IMU::DeltaVel::X [m/s]
397 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_DELTAVEL)) { return static_cast<double>(imuOutputs->deltaV(0)); }
398 break;
399 case 35: // IMU::DeltaVel::Y [m/s]
400 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_DELTAVEL)) { return static_cast<double>(imuOutputs->deltaV(1)); }
401 break;
402 case 36: // IMU::DeltaVel::Z [m/s]
403 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_DELTAVEL)) { return static_cast<double>(imuOutputs->deltaV(2)); }
404 break;
405 case 37: // IMU::Mag::X [Gauss]
406 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_MAG)) { return static_cast<double>(imuOutputs->mag(0)); }
407 break;
408 case 38: // IMU::Mag::Y [Gauss]
409 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_MAG)) { return static_cast<double>(imuOutputs->mag(1)); }
410 break;
411 case 39: // IMU::Mag::Z [Gauss]
412 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_MAG)) { return static_cast<double>(imuOutputs->mag(2)); }
413 break;
414 case 40: // IMU::Accel::X [m/s^2]
415 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_ACCEL)) { return static_cast<double>(imuOutputs->accel(0)); }
416 break;
417 case 41: // IMU::Accel::Y [m/s^2]
418 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_ACCEL)) { return static_cast<double>(imuOutputs->accel(1)); }
419 break;
420 case 42: // IMU::Accel::Z [m/s^2]
421 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_ACCEL)) { return static_cast<double>(imuOutputs->accel(2)); }
422 break;
423 case 43: // IMU::AngularRate::X [rad/s]
424 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_ANGULARRATE)) { return static_cast<double>(imuOutputs->angularRate(0)); }
425 break;
426 case 44: // IMU::AngularRate::Y [rad/s]
427 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_ANGULARRATE)) { return static_cast<double>(imuOutputs->angularRate(1)); }
428 break;
429 case 45: // IMU::AngularRate::Z [rad/s]
430 if (imuOutputs && (imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_ANGULARRATE)) { return static_cast<double>(imuOutputs->angularRate(2)); }
431 break;
432 // Group 4 (GNSS1)
433 case 46: // GNSS1::UTC::year
434 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_UTC)) { return static_cast<double>(gnss1Outputs->timeUtc.year); }
435 break;
436 case 47: // GNSS1::UTC::month
437 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_UTC)) { return static_cast<double>(gnss1Outputs->timeUtc.month); }
438 break;
439 case 48: // GNSS1::UTC::day
440 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_UTC)) { return static_cast<double>(gnss1Outputs->timeUtc.day); }
441 break;
442 case 49: // GNSS1::UTC::hour
443 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_UTC)) { return static_cast<double>(gnss1Outputs->timeUtc.hour); }
444 break;
445 case 50: // GNSS1::UTC::min
446 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_UTC)) { return static_cast<double>(gnss1Outputs->timeUtc.min); }
447 break;
448 case 51: // GNSS1::UTC::sec
449 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_UTC)) { return static_cast<double>(gnss1Outputs->timeUtc.sec); }
450 break;
451 case 52: // GNSS1::UTC::ms
452 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_UTC)) { return static_cast<double>(gnss1Outputs->timeUtc.ms); }
453 break;
454 case 53: // GNSS1::Tow [ns]
455 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_TOW)) { return static_cast<double>(gnss1Outputs->tow); }
456 break;
457 case 54: // GNSS1::Week
458 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_WEEK)) { return static_cast<double>(gnss1Outputs->week); }
459 break;
460 case 55: // GNSS1::NumSats
461 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_NUMSATS)) { return static_cast<double>(gnss1Outputs->numSats); }
462 break;
463 case 56: // GNSS1::Fix
464 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_FIX)) { return static_cast<double>(gnss1Outputs->fix); }
465 break;
466 case 57: // GNSS1::PosLla::latitude [deg]
467 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSLLA)) { return gnss1Outputs->posLla(0); }
468 break;
469 case 58: // GNSS1::PosLla::longitude [deg]
470 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSLLA)) { return gnss1Outputs->posLla(1); }
471 break;
472 case 59: // GNSS1::PosLla::altitude [m]
473 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSLLA)) { return gnss1Outputs->posLla(2); }
474 break;
475 case 60: // GNSS1::PosEcef::X [m]
476 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSECEF)) { return gnss1Outputs->posEcef(0); }
477 break;
478 case 61: // GNSS1::PosEcef::Y [m]
479 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSECEF)) { return gnss1Outputs->posEcef(1); }
480 break;
481 case 62: // GNSS1::PosEcef::Z [m]
482 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSECEF)) { return gnss1Outputs->posEcef(2); }
483 break;
484 case 63: // GNSS1::VelNed::N [m/s]
485 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELNED)) { return static_cast<double>(gnss1Outputs->velNed(0)); }
486 break;
487 case 64: // GNSS1::VelNed::E [m/s]
488 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELNED)) { return static_cast<double>(gnss1Outputs->velNed(1)); }
489 break;
490 case 65: // GNSS1::VelNed::D [m/s]
491 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELNED)) { return static_cast<double>(gnss1Outputs->velNed(2)); }
492 break;
493 case 66: // GNSS1::VelEcef::X [m/s]
494 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELECEF)) { return static_cast<double>(gnss1Outputs->velEcef(0)); }
495 break;
496 case 67: // GNSS1::VelEcef::Y [m/s]
497 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELECEF)) { return static_cast<double>(gnss1Outputs->velEcef(1)); }
498 break;
499 case 68: // GNSS1::VelEcef::Z [m/s]
500 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELECEF)) { return static_cast<double>(gnss1Outputs->velEcef(2)); }
501 break;
502 case 69: // GNSS1::PosU::N [m]
503 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSU)) { return static_cast<double>(gnss1Outputs->posU(0)); }
504 break;
505 case 70: // GNSS1::PosU::E [m]
506 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSU)) { return static_cast<double>(gnss1Outputs->posU(1)); }
507 break;
508 case 71: // GNSS1::PosU::D [m]
509 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSU)) { return static_cast<double>(gnss1Outputs->posU(2)); }
510 break;
511 case 72: // GNSS1::VelU [m/s]
512 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELU)) { return static_cast<double>(gnss1Outputs->velU); }
513 break;
514 case 73: // GNSS1::TimeU [s]
515 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_TIMEU)) { return static_cast<double>(gnss1Outputs->timeU); }
516 break;
517 case 74: // GNSS1::TimeInfo::Status::timeOk
518 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_TIMEINFO)) { return static_cast<double>(gnss1Outputs->timeInfo.status.timeOk()); }
519 break;
520 case 75: // GNSS1::TimeInfo::Status::dateOk
521 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_TIMEINFO)) { return static_cast<double>(gnss1Outputs->timeInfo.status.dateOk()); }
522 break;
523 case 76: // GNSS1::TimeInfo::Status::utcTimeValid
524 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_TIMEINFO)) { return static_cast<double>(gnss1Outputs->timeInfo.status.utcTimeValid()); }
525 break;
526 case 77: // GNSS1::TimeInfo::LeapSeconds
527 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_TIMEINFO)) { return static_cast<double>(gnss1Outputs->timeInfo.leapSeconds); }
528 break;
529 case 78: // GNSS1::DOP::g
530 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_DOP)) { return static_cast<double>(gnss1Outputs->dop.gDop); }
531 break;
532 case 79: // GNSS1::DOP::p
533 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_DOP)) { return static_cast<double>(gnss1Outputs->dop.pDop); }
534 break;
535 case 80: // GNSS1::DOP::t
536 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_DOP)) { return static_cast<double>(gnss1Outputs->dop.tDop); }
537 break;
538 case 81: // GNSS1::DOP::v
539 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_DOP)) { return static_cast<double>(gnss1Outputs->dop.vDop); }
540 break;
541 case 82: // GNSS1::DOP::h
542 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_DOP)) { return static_cast<double>(gnss1Outputs->dop.hDop); }
543 break;
544 case 83: // GNSS1::DOP::n
545 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_DOP)) { return static_cast<double>(gnss1Outputs->dop.nDop); }
546 break;
547 case 84: // GNSS1::DOP::e
548 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_DOP)) { return static_cast<double>(gnss1Outputs->dop.eDop); }
549 break;
550 case 85: // GNSS1::SatInfo::NumSats
551 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_SATINFO)) { return static_cast<double>(gnss1Outputs->satInfo.numSats); }
552 break;
553 case 86: // GNSS1::RawMeas::Tow [s]
554 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_RAWMEAS)) { return gnss1Outputs->raw.tow; }
555 break;
556 case 87: // GNSS1::RawMeas::Week
557 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_RAWMEAS)) { return static_cast<double>(gnss1Outputs->raw.week); }
558 break;
559 case 88: // GNSS1::RawMeas::NumSats
560 if (gnss1Outputs && (gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_RAWMEAS)) { return static_cast<double>(gnss1Outputs->raw.numSats); }
561 break;
562 // Group 5 (Attitude)
563 case 89: // Att::VpeStatus::AttitudeQuality
564 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_VPESTATUS)) { return static_cast<double>(attitudeOutputs->vpeStatus.attitudeQuality()); }
565 break;
566 case 90: // Att::VpeStatus::GyroSaturation
567 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_VPESTATUS)) { return static_cast<double>(attitudeOutputs->vpeStatus.gyroSaturation()); }
568 break;
569 case 91: // Att::VpeStatus::GyroSaturationRecovery
570 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_VPESTATUS)) { return static_cast<double>(attitudeOutputs->vpeStatus.gyroSaturationRecovery()); }
571 break;
572 case 92: // Att::VpeStatus::MagDisturbance
573 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_VPESTATUS)) { return static_cast<double>(attitudeOutputs->vpeStatus.magDisturbance()); }
574 break;
575 case 93: // Att::VpeStatus::MagSaturation
576 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_VPESTATUS)) { return static_cast<double>(attitudeOutputs->vpeStatus.magSaturation()); }
577 break;
578 case 94: // Att::VpeStatus::AccDisturbance
579 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_VPESTATUS)) { return static_cast<double>(attitudeOutputs->vpeStatus.accDisturbance()); }
580 break;
581 case 95: // Att::VpeStatus::AccSaturation
582 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_VPESTATUS)) { return static_cast<double>(attitudeOutputs->vpeStatus.accSaturation()); }
583 break;
584 case 96: // Att::VpeStatus::KnownMagDisturbance
585 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_VPESTATUS)) { return static_cast<double>(attitudeOutputs->vpeStatus.knownMagDisturbance()); }
586 break;
587 case 97: // Att::VpeStatus::KnownAccelDisturbance
588 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_VPESTATUS)) { return static_cast<double>(attitudeOutputs->vpeStatus.knownAccelDisturbance()); }
589 break;
590 case 98: // Att::YawPitchRoll::Y [deg]
591 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_YAWPITCHROLL)) { return static_cast<double>(attitudeOutputs->ypr(0)); }
592 break;
593 case 99: // Att::YawPitchRoll::P [deg]
594 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_YAWPITCHROLL)) { return static_cast<double>(attitudeOutputs->ypr(1)); }
595 break;
596 case 100: // Att::YawPitchRoll::R [deg]
597 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_YAWPITCHROLL)) { return static_cast<double>(attitudeOutputs->ypr(2)); }
598 break;
599 case 101: // Att::Quaternion::w
600 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_QUATERNION)) { return static_cast<double>(attitudeOutputs->qtn.w()); }
601 break;
602 case 102: // Att::Quaternion::x
603 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_QUATERNION)) { return static_cast<double>(attitudeOutputs->qtn.x()); }
604 break;
605 case 103: // Att::Quaternion::y
606 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_QUATERNION)) { return static_cast<double>(attitudeOutputs->qtn.y()); }
607 break;
608 case 104: // Att::Quaternion::z
609 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_QUATERNION)) { return static_cast<double>(attitudeOutputs->qtn.z()); }
610 break;
611 case 105: // Att::DCM::0-0
612 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_DCM)) { return static_cast<double>(attitudeOutputs->dcm(0, 0)); }
613 break;
614 case 106: // Att::DCM::0-1
615 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_DCM)) { return static_cast<double>(attitudeOutputs->dcm(0, 1)); }
616 break;
617 case 107: // Att::DCM::0-2
618 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_DCM)) { return static_cast<double>(attitudeOutputs->dcm(0, 2)); }
619 break;
620 case 108: // Att::DCM::1-0
621 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_DCM)) { return static_cast<double>(attitudeOutputs->dcm(1, 0)); }
622 break;
623 case 109: // Att::DCM::1-1
624 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_DCM)) { return static_cast<double>(attitudeOutputs->dcm(1, 1)); }
625 break;
626 case 110: // Att::DCM::1-2
627 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_DCM)) { return static_cast<double>(attitudeOutputs->dcm(1, 2)); }
628 break;
629 case 111: // Att::DCM::2-0
630 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_DCM)) { return static_cast<double>(attitudeOutputs->dcm(2, 0)); }
631 break;
632 case 112: // Att::DCM::2-1
633 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_DCM)) { return static_cast<double>(attitudeOutputs->dcm(2, 1)); }
634 break;
635 case 113: // Att::DCM::2-2
636 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_DCM)) { return static_cast<double>(attitudeOutputs->dcm(2, 2)); }
637 break;
638 case 114: // Att::MagNed::N [Gauss]
639 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_MAGNED)) { return static_cast<double>(attitudeOutputs->magNed(0)); }
640 break;
641 case 115: // Att::MagNed::E [Gauss]
642 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_MAGNED)) { return static_cast<double>(attitudeOutputs->magNed(1)); }
643 break;
644 case 116: // Att::MagNed::D [Gauss]
645 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_MAGNED)) { return static_cast<double>(attitudeOutputs->magNed(2)); }
646 break;
647 case 117: // Att::AccelNed::N [m/s^2]
648 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_ACCELNED)) { return static_cast<double>(attitudeOutputs->accelNed(0)); }
649 break;
650 case 118: // Att::AccelNed::E [m/s^2]
651 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_ACCELNED)) { return static_cast<double>(attitudeOutputs->accelNed(1)); }
652 break;
653 case 119: // Att::AccelNed::D [m/s^2]
654 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_ACCELNED)) { return static_cast<double>(attitudeOutputs->accelNed(2)); }
655 break;
656 case 120: // Att::LinearAccelBody::X [m/s^2]
657 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_LINEARACCELBODY)) { return static_cast<double>(attitudeOutputs->linearAccelBody(0)); }
658 break;
659 case 121: // Att::LinearAccelBody::Y [m/s^2]
660 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_LINEARACCELBODY)) { return static_cast<double>(attitudeOutputs->linearAccelBody(1)); }
661 break;
662 case 122: // Att::LinearAccelBody::Z [m/s^2]
663 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_LINEARACCELBODY)) { return static_cast<double>(attitudeOutputs->linearAccelBody(2)); }
664 break;
665 case 123: // Att::LinearAccelNed::N [m/s^2]
666 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_LINEARACCELNED)) { return static_cast<double>(attitudeOutputs->linearAccelNed(0)); }
667 break;
668 case 124: // Att::LinearAccelNed::E [m/s^2]
669 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_LINEARACCELNED)) { return static_cast<double>(attitudeOutputs->linearAccelNed(1)); }
670 break;
671 case 125: // Att::LinearAccelNed::D [m/s^2]
672 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_LINEARACCELNED)) { return static_cast<double>(attitudeOutputs->linearAccelNed(2)); }
673 break;
674 case 126: // Att::YprU::Y [deg]
675 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_YPRU)) { return static_cast<double>(attitudeOutputs->yprU(0)); }
676 break;
677 case 127: // Att::YprU::P [deg]
678 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_YPRU)) { return static_cast<double>(attitudeOutputs->yprU(1)); }
679 break;
680 case 128: // Att::YprU::R [deg]
681 if (attitudeOutputs && (attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_YPRU)) { return static_cast<double>(attitudeOutputs->yprU(2)); }
682 break;
683 // Group 6 (INS)
684 case 129: // INS::InsStatus::Mode
685 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_INSSTATUS)) { return static_cast<double>(insOutputs->insStatus.mode()); }
686 break;
687 case 130: // INS::InsStatus::GpsFix
688 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_INSSTATUS)) { return static_cast<double>(insOutputs->insStatus.gpsFix()); }
689 break;
690 case 131: // INS::InsStatus::Error::IMU
691 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_INSSTATUS)) { return static_cast<double>(insOutputs->insStatus.errorIMU()); }
692 break;
693 case 132: // INS::InsStatus::Error::MagPres
694 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_INSSTATUS)) { return static_cast<double>(insOutputs->insStatus.errorMagPres()); }
695 break;
696 case 133: // INS::InsStatus::Error::GNSS
697 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_INSSTATUS)) { return static_cast<double>(insOutputs->insStatus.errorGnss()); }
698 break;
699 case 134: // INS::InsStatus::GpsHeadingIns
700 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_INSSTATUS)) { return static_cast<double>(insOutputs->insStatus.gpsHeadingIns()); }
701 break;
702 case 135: // INS::InsStatus::GpsCompass
703 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_INSSTATUS)) { return static_cast<double>(insOutputs->insStatus.gpsCompass()); }
704 break;
705 case 136: // INS::PosLla::latitude [deg]
706 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_POSLLA)) { return insOutputs->posLla(0); }
707 break;
708 case 137: // INS::PosLla::longitude [deg]
709 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_POSLLA)) { return insOutputs->posLla(1); }
710 break;
711 case 138: // INS::PosLla::altitude [m]
712 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_POSLLA)) { return insOutputs->posLla(2); }
713 break;
714 case 139: // INS::PosEcef::X [m]
715 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_POSECEF)) { return insOutputs->posEcef(0); }
716 break;
717 case 140: // INS::PosEcef::Y [m]
718 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_POSECEF)) { return insOutputs->posEcef(1); }
719 break;
720 case 141: // INS::PosEcef::Z [m]
721 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_POSECEF)) { return insOutputs->posEcef(2); }
722 break;
723 case 142: // INS::VelBody::X [m/s]
724 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELBODY)) { return static_cast<double>(insOutputs->velBody(0)); }
725 break;
726 case 143: // INS::VelBody::Y [m/s]
727 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELBODY)) { return static_cast<double>(insOutputs->velBody(1)); }
728 break;
729 case 144: // INS::VelBody::Z [m/s]
730 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELBODY)) { return static_cast<double>(insOutputs->velBody(2)); }
731 break;
732 case 145: // INS::VelNed::N [m/s]
733 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELNED)) { return static_cast<double>(insOutputs->velNed(0)); }
734 break;
735 case 146: // INS::VelNed::E [m/s]
736 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELNED)) { return static_cast<double>(insOutputs->velNed(1)); }
737 break;
738 case 147: // INS::VelNed::D [m/s]
739 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELNED)) { return static_cast<double>(insOutputs->velNed(2)); }
740 break;
741 case 148: // INS::VelEcef::X [m/s]
742 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELECEF)) { return static_cast<double>(insOutputs->velEcef(0)); }
743 break;
744 case 149: // INS::VelEcef::Y [m/s]
745 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELECEF)) { return static_cast<double>(insOutputs->velEcef(1)); }
746 break;
747 case 150: // INS::VelEcef::Z [m/s]
748 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELECEF)) { return static_cast<double>(insOutputs->velEcef(2)); }
749 break;
750 case 151: // INS::MagEcef::X [Gauss}
751 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_MAGECEF)) { return static_cast<double>(insOutputs->magEcef(0)); }
752 break;
753 case 152: // INS::MagEcef::Y [Gauss}
754 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_MAGECEF)) { return static_cast<double>(insOutputs->magEcef(1)); }
755 break;
756 case 153: // INS::MagEcef::Z [Gauss}
757 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_MAGECEF)) { return static_cast<double>(insOutputs->magEcef(2)); }
758 break;
759 case 154: // INS::AccelEcef::X [m/s^2]
760 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_ACCELECEF)) { return static_cast<double>(insOutputs->accelEcef(0)); }
761 break;
762 case 155: // INS::AccelEcef::Y [m/s^2]
763 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_ACCELECEF)) { return static_cast<double>(insOutputs->accelEcef(1)); }
764 break;
765 case 156: // INS::AccelEcef::Z [m/s^2]
766 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_ACCELECEF)) { return static_cast<double>(insOutputs->accelEcef(2)); }
767 break;
768 case 157: // INS::LinearAccelEcef::X [m/s^2]
769 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_LINEARACCELECEF)) { return static_cast<double>(insOutputs->linearAccelEcef(0)); }
770 break;
771 case 158: // INS::LinearAccelEcef::Y [m/s^2]
772 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_LINEARACCELECEF)) { return static_cast<double>(insOutputs->linearAccelEcef(1)); }
773 break;
774 case 159: // INS::LinearAccelEcef::Z [m/s^2]
775 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_LINEARACCELECEF)) { return static_cast<double>(insOutputs->linearAccelEcef(2)); }
776 break;
777 case 160: // INS::PosU [m]
778 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_POSU)) { return static_cast<double>(insOutputs->posU); }
779 break;
780 case 161: // INS::VelU [m/s]
781 if (insOutputs && (insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELU)) { return static_cast<double>(insOutputs->velU); }
782 break;
783 // Group 7 (GNSS2)
784 case 162: // GNSS2::UTC::year
785 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_UTC)) { return static_cast<double>(gnss2Outputs->timeUtc.year); }
786 break;
787 case 163: // GNSS2::UTC::month
788 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_UTC)) { return static_cast<double>(gnss2Outputs->timeUtc.month); }
789 break;
790 case 164: // GNSS2::UTC::day
791 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_UTC)) { return static_cast<double>(gnss2Outputs->timeUtc.day); }
792 break;
793 case 165: // GNSS2::UTC::hour
794 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_UTC)) { return static_cast<double>(gnss2Outputs->timeUtc.hour); }
795 break;
796 case 166: // GNSS2::UTC::min
797 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_UTC)) { return static_cast<double>(gnss2Outputs->timeUtc.min); }
798 break;
799 case 167: // GNSS2::UTC::sec
800 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_UTC)) { return static_cast<double>(gnss2Outputs->timeUtc.sec); }
801 break;
802 case 168: // GNSS2::UTC::ms
803 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_UTC)) { return static_cast<double>(gnss2Outputs->timeUtc.ms); }
804 break;
805 case 169: // GNSS2::Tow [ns]
806 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_TOW)) { return static_cast<double>(gnss2Outputs->tow); }
807 break;
808 case 170: // GNSS2::Week
809 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_WEEK)) { return static_cast<double>(gnss2Outputs->week); }
810 break;
811 case 171: // GNSS2::NumSats
812 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_NUMSATS)) { return static_cast<double>(gnss2Outputs->numSats); }
813 break;
814 case 172: // GNSS2::Fix
815 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_FIX)) { return static_cast<double>(gnss2Outputs->fix); }
816 break;
817 case 173: // GNSS2::PosLla::latitude [deg]
818 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSLLA)) { return gnss2Outputs->posLla(0); }
819 break;
820 case 174: // GNSS2::PosLla::longitude [deg]
821 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSLLA)) { return gnss2Outputs->posLla(1); }
822 break;
823 case 175: // GNSS2::PosLla::altitude [m]
824 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSLLA)) { return gnss2Outputs->posLla(2); }
825 break;
826 case 176: // GNSS2::PosEcef::X [m]
827 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSECEF)) { return gnss2Outputs->posEcef(0); }
828 break;
829 case 177: // GNSS2::PosEcef::Y [m]
830 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSECEF)) { return gnss2Outputs->posEcef(1); }
831 break;
832 case 178: // GNSS2::PosEcef::Z [m]
833 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSECEF)) { return gnss2Outputs->posEcef(2); }
834 break;
835 case 179: // GNSS2::VelNed::N [m/s]
836 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELNED)) { return static_cast<double>(gnss2Outputs->velNed(0)); }
837 break;
838 case 180: // GNSS2::VelNed::E [m/s]
839 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELNED)) { return static_cast<double>(gnss2Outputs->velNed(1)); }
840 break;
841 case 181: // GNSS2::VelNed::D [m/s]
842 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELNED)) { return static_cast<double>(gnss2Outputs->velNed(2)); }
843 break;
844 case 182: // GNSS2::VelEcef::X [m/s]
845 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELECEF)) { return static_cast<double>(gnss2Outputs->velEcef(0)); }
846 break;
847 case 183: // GNSS2::VelEcef::Y [m/s]
848 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELECEF)) { return static_cast<double>(gnss2Outputs->velEcef(1)); }
849 break;
850 case 184: // GNSS2::VelEcef::Z [m/s]
851 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELECEF)) { return static_cast<double>(gnss2Outputs->velEcef(2)); }
852 break;
853 case 185: // GNSS2::PosU::N [m]
854 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSU)) { return static_cast<double>(gnss2Outputs->posU(0)); }
855 break;
856 case 186: // GNSS2::PosU::E [m]
857 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSU)) { return static_cast<double>(gnss2Outputs->posU(1)); }
858 break;
859 case 187: // GNSS2::PosU::D [m]
860 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSU)) { return static_cast<double>(gnss2Outputs->posU(2)); }
861 break;
862 case 188: // GNSS2::VelU [m/s]
863 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELU)) { return static_cast<double>(gnss2Outputs->velU); }
864 break;
865 case 189: // GNSS2::TimeU [s]
866 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_TIMEU)) { return static_cast<double>(gnss2Outputs->timeU); }
867 break;
868 case 190: // GNSS2::TimeInfo::Status::timeOk
869 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_TIMEINFO)) { return static_cast<double>(gnss2Outputs->timeInfo.status.timeOk()); }
870 break;
871 case 191: // GNSS2::TimeInfo::Status::dateOk
872 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_TIMEINFO)) { return static_cast<double>(gnss2Outputs->timeInfo.status.dateOk()); }
873 break;
874 case 192: // GNSS2::TimeInfo::Status::utcTimeValid
875 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_TIMEINFO)) { return static_cast<double>(gnss2Outputs->timeInfo.status.utcTimeValid()); }
876 break;
877 case 193: // GNSS2::TimeInfo::LeapSeconds
878 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_TIMEINFO)) { return static_cast<double>(gnss2Outputs->timeInfo.leapSeconds); }
879 break;
880 case 194: // GNSS2::DOP::g
881 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_DOP)) { return static_cast<double>(gnss2Outputs->dop.gDop); }
882 break;
883 case 195: // GNSS2::DOP::p
884 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_DOP)) { return static_cast<double>(gnss2Outputs->dop.pDop); }
885 break;
886 case 196: // GNSS2::DOP::t
887 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_DOP)) { return static_cast<double>(gnss2Outputs->dop.tDop); }
888 break;
889 case 197: // GNSS2::DOP::v
890 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_DOP)) { return static_cast<double>(gnss2Outputs->dop.vDop); }
891 break;
892 case 198: // GNSS2::DOP::h
893 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_DOP)) { return static_cast<double>(gnss2Outputs->dop.hDop); }
894 break;
895 case 199: // GNSS2::DOP::n
896 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_DOP)) { return static_cast<double>(gnss2Outputs->dop.nDop); }
897 break;
898 case 200: // GNSS2::DOP::e
899 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_DOP)) { return static_cast<double>(gnss2Outputs->dop.eDop); }
900 break;
901 case 201: // GNSS2::SatInfo::NumSats
902 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_SATINFO)) { return static_cast<double>(gnss2Outputs->satInfo.numSats); }
903 break;
904 case 202: // GNSS2::RawMeas::Tow [s]
905 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_RAWMEAS)) { return gnss2Outputs->raw.tow; }
906 break;
907 case 203: // GNSS2::RawMeas::Week
908 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_RAWMEAS)) { return static_cast<double>(gnss2Outputs->raw.week); }
909 break;
910 case 204: // GNSS2::RawMeas::NumSats
911 if (gnss2Outputs && (gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_RAWMEAS)) { return static_cast<double>(gnss2Outputs->raw.numSats); }
912 break;
913 default:
914 return std::nullopt;
915 }
916 return std::nullopt;
917 }
918
920 std::shared_ptr<vendor::vectornav::TimeOutputs> timeOutputs = nullptr;
921
923 std::shared_ptr<vendor::vectornav::ImuOutputs> imuOutputs = nullptr;
924
926 std::shared_ptr<vendor::vectornav::GnssOutputs> gnss1Outputs = nullptr;
927
929 std::shared_ptr<vendor::vectornav::AttitudeOutputs> attitudeOutputs = nullptr;
930
932 std::shared_ptr<vendor::vectornav::InsOutputs> insOutputs = nullptr;
933
935 std::shared_ptr<vendor::vectornav::GnssOutputs> gnss2Outputs = nullptr;
936
939};
940
941} // namespace NAV
#define INS_ASSERT(_EXPR)
Assert function wrapper.
Definition Assert.h:19
Vector space operations.
Imu Position Data.
Abstract NodeData Class.
Binary Group 5 – Attitude Outputs.
IMU Position.
Definition ImuPos.hpp:26
Parent class for all data transmitted over Flow pins.
Definition NodeData.hpp:28
static std::string type()
Returns the type of the data class.
Definition NodeData.hpp:45
IMU Observation storage class.
Definition VectorNavBinaryOutput.hpp:32
std::optional< double > getValueAt(size_t idx) const override
Get the value at the index.
Definition VectorNavBinaryOutput.hpp:287
std::shared_ptr< vendor::vectornav::TimeOutputs > timeOutputs
Binary Group 2 – Time Outputs.
Definition VectorNavBinaryOutput.hpp:920
std::string getType() const override
Returns the type of the data class.
Definition VectorNavBinaryOutput.hpp:48
VectorNavBinaryOutput(const ImuPos &imuPos)
Constructor.
Definition VectorNavBinaryOutput.hpp:36
std::shared_ptr< vendor::vectornav::ImuOutputs > imuOutputs
Binary Group 3 – IMU Outputs.
Definition VectorNavBinaryOutput.hpp:923
static constexpr size_t GetStaticDescriptorCount()
Get the amount of descriptors.
Definition VectorNavBinaryOutput.hpp:276
std::shared_ptr< vendor::vectornav::InsOutputs > insOutputs
Binary Group 6 – INS Outputs.
Definition VectorNavBinaryOutput.hpp:932
static std::vector< std::string > GetStaticDataDescriptors()
Returns a vector of data descriptors.
Definition VectorNavBinaryOutput.hpp:58
static std::string type()
Returns the type of the data class.
Definition VectorNavBinaryOutput.hpp:41
static std::vector< std::string > parentTypes()
Returns the parent types of the data class.
Definition VectorNavBinaryOutput.hpp:52
std::vector< std::string > staticDataDescriptors() const override
Returns a vector of data descriptors.
Definition VectorNavBinaryOutput.hpp:279
const ImuPos & imuPos
Position and rotation information for conversion from platform to body frame.
Definition VectorNavBinaryOutput.hpp:938
std::shared_ptr< vendor::vectornav::GnssOutputs > gnss2Outputs
Binary Group 7 – GNSS2 Outputs.
Definition VectorNavBinaryOutput.hpp:935
size_t staticDescriptorCount() const override
Get the amount of descriptors.
Definition VectorNavBinaryOutput.hpp:282
std::shared_ptr< vendor::vectornav::GnssOutputs > gnss1Outputs
Binary Group 4 – GNSS1 Outputs.
Definition VectorNavBinaryOutput.hpp:926
std::shared_ptr< vendor::vectornav::AttitudeOutputs > attitudeOutputs
Binary Group 5 – Attitude Outputs.
Definition VectorNavBinaryOutput.hpp:929