0.5.1
Loading...
Searching...
No Matches
VectorNavBinaryConverter.cpp
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
10
11#include <cmath>
12
15#include "util/Logger.hpp"
16
18
20
23
24/// @brief Scale factor to kPa to hPa
25constexpr double SCALE_FACTOR_KILO2HECTOPASCAL = 10;
26
38
43
45{
46 return "VectorNavBinaryConverter";
47}
48
50{
51 return typeStatic();
52}
53
55{
56 return "Converter";
57}
58
60{
61 if (gui::widgets::EnumCombo(fmt::format("Output Type##{}", size_t(id)).c_str(), _outputType))
62 {
63 LOG_DEBUG("{}: Output Type changed to {}", nameId(), to_string(_outputType));
65 {
68 }
70 {
73 }
75 {
78 }
80 {
83 }
85 {
88 }
89
90 for (auto& link : outputPins.front().links)
91 {
92 if (auto* connectedPin = link.getConnectedPin())
93 {
94 outputPins.front().recreateLink(*connectedPin);
95 }
96 }
97
99 }
101 {
102 if (ImGui::Checkbox(fmt::format("Use compensated data##{}", size_t(id)).c_str(), &_useCompensatedData))
103 {
104 LOG_DEBUG("{}: _useCompensatedData changed to {}", nameId(), _useCompensatedData);
106 }
107 }
109 {
110 if (auto posVelSource = static_cast<int>(_posVelSource);
111 ImGui::Combo(fmt::format("Data Source##{}", size_t(id)).c_str(), &posVelSource, "Best\0INS\0GNSS 1\0GNSS 2\0\0"))
112 {
113 _posVelSource = static_cast<decltype(_posVelSource)>(posVelSource);
114 LOG_DEBUG("{}: _posVelSource changed to {}", nameId(), fmt::underlying(_posVelSource));
116 }
117 if (ImGui::Checkbox(fmt::format("Force static##{}", size_t(id)).c_str(), &_forceStatic))
118 {
119 LOG_DEBUG("{}: _forceStatic changed to {}", nameId(), _forceStatic);
121 }
122 }
123}
124
126{
127 LOG_TRACE("{}: called", nameId());
128
129 json j;
130
131 j["outputType"] = _outputType;
132 j["posVelSource"] = _posVelSource;
133 j["forceStatic"] = _forceStatic;
134 j["useCompensatedData"] = _useCompensatedData;
135
136 return j;
137}
138
140{
141 LOG_TRACE("{}: called", nameId());
142
143 if (j.contains("outputType"))
144 {
145 j.at("outputType").get_to(_outputType);
146
147 if (!outputPins.empty())
148 {
150 {
153 }
155 {
158 }
160 {
163 }
165 {
168 }
170 {
173 }
174 }
175 }
176 if (j.contains("posVelSource"))
177 {
178 j.at("posVelSource").get_to(_posVelSource);
179 }
180 if (j.contains("forceStatic"))
181 {
182 _forceStatic = j.at("forceStatic");
183 }
184 if (j.contains("useCompensatedData"))
185 {
186 _useCompensatedData = j.at("useCompensatedData");
187 }
188}
189
191{
192 LOG_TRACE("{}: called", nameId());
193
194 _posVelAtt__init = nullptr;
195
196 return true;
197}
198
200{
201 auto vnObs = std::static_pointer_cast<const VectorNavBinaryOutput>(queue.extract_front());
202
203 std::shared_ptr<const NodeData> convertedData = nullptr;
204
206 {
207 convertedData = convert2ImuObsWDelta(vnObs);
208 }
210 {
211 convertedData = convert2ImuObs(vnObs);
212 }
214 {
215 convertedData = convert2BaroPressObs(vnObs);
216 }
218 {
219 convertedData = convert2PosVelAtt(vnObs);
220 }
222 {
223 convertedData = convert2GnssObs(vnObs);
224 }
225
226 if (convertedData)
227 {
229 }
230}
231
232std::shared_ptr<const NAV::ImuObsWDelta> NAV::VectorNavBinaryConverter::convert2ImuObsWDelta(const std::shared_ptr<const VectorNavBinaryOutput>& vnObs) const // NOLINT(readability-convert-member-functions-to-static)
233{
234 auto imuObs = std::make_shared<ImuObsWDelta>(vnObs->imuPos);
235
236 if (vnObs->gnss1Outputs || vnObs->gnss2Outputs) // If there is no GNSS data selected in the vnSensor, Imu messages should still be sent out. The VN-100 will not provide any data otherwise.
237 {
238 if (!vnObs->timeOutputs
239 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMESTATUS)
240 || !vnObs->timeOutputs->timeStatus.dateOk()
241 || !vnObs->timeOutputs->timeStatus.timeOk()
242 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSTOW)
243 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSWEEK))
244 {
245 return nullptr;
246 }
247 imuObs->insTime = InsTime(InsTime_GPSweekTow(0, static_cast<int32_t>(vnObs->timeOutputs->gpsWeek), static_cast<double>(vnObs->timeOutputs->gpsTow) * 1e-9L));
248 }
249 else
250 {
251 // VN-100 vnObs->insTime is set from
252 // - 'timeSyncMaster->ppsTime + timeSyncIn' when working together with the VN-310E or
253 // - the computer time
254 imuObs->insTime = vnObs->insTime;
255 }
256
257 bool accelFound = false;
258 bool gyroFound = false;
259 bool dThetaFound = false;
260 bool dVelFound = false;
261 if (vnObs->imuOutputs)
262 {
264 {
265 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPMAG)
266 {
267 imuObs->p_magneticField = vnObs->imuOutputs->uncompMag.cast<double>();
268 }
269 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPACCEL)
270 {
271 imuObs->p_acceleration = vnObs->imuOutputs->uncompAccel.cast<double>();
272 accelFound = true;
273 }
274 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPGYRO)
275 {
276 imuObs->p_angularRate = vnObs->imuOutputs->uncompGyro.cast<double>();
277 gyroFound = true;
278 }
279 }
280 else
281 {
282 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_MAG)
283 {
284 imuObs->p_magneticField = vnObs->imuOutputs->mag.cast<double>();
285 }
286 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_ACCEL)
287 {
288 imuObs->p_acceleration = vnObs->imuOutputs->accel.cast<double>();
289 accelFound = true;
290 }
291 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_ANGULARRATE)
292 {
293 imuObs->p_angularRate = vnObs->imuOutputs->angularRate.cast<double>();
294 gyroFound = true;
295 }
296 }
297 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_TEMP)
298 {
299 imuObs->temperature = vnObs->imuOutputs->temp;
300 }
301 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_DELTATHETA)
302 {
303 imuObs->dtime = vnObs->imuOutputs->deltaTime;
304 imuObs->dtheta = deg2rad(vnObs->imuOutputs->deltaTheta.cast<double>());
305 dThetaFound = true;
306 }
307 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_DELTAVEL)
308 {
309 imuObs->dvel = vnObs->imuOutputs->deltaV.cast<double>();
310 dVelFound = true;
311 }
312 }
313
314 if (accelFound && gyroFound && dThetaFound && dVelFound)
315 {
316 return imuObs;
317 }
318
319 LOG_ERROR("{}: Conversion failed. Need {} acceleration and gyroscope measurements and deltaTheta and deltaVel in the input data.",
320 nameId(), _useCompensatedData ? "compensated" : "uncompensated");
321 return nullptr;
322}
323
324std::shared_ptr<const NAV::ImuObs> NAV::VectorNavBinaryConverter::convert2ImuObs(const std::shared_ptr<const VectorNavBinaryOutput>& vnObs) const // NOLINT(readability-convert-member-functions-to-static)
325{
326 auto imuObs = std::make_shared<ImuObs>(vnObs->imuPos);
327
328 if (vnObs->gnss1Outputs || vnObs->gnss2Outputs) // If there is no GNSS data selected in the vnSensor, Imu messages should still be sent out. The VN-100 will not provide any data otherwise.
329 {
330 if (!vnObs->timeOutputs
331 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMESTATUS)
332 || !vnObs->timeOutputs->timeStatus.dateOk()
333 || !vnObs->timeOutputs->timeStatus.timeOk()
334 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSTOW)
335 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSWEEK))
336 {
337 return nullptr;
338 }
339 imuObs->insTime = InsTime(InsTime_GPSweekTow(0, static_cast<int32_t>(vnObs->timeOutputs->gpsWeek), static_cast<double>(vnObs->timeOutputs->gpsTow) * 1e-9L));
340 }
341 else
342 {
343 // VN-100 vnObs->insTime is set from
344 // - 'timeSyncMaster->ppsTime + timeSyncIn' when working together with the VN-310E or
345 // - the computer time
346 imuObs->insTime = vnObs->insTime;
347 }
348
349 bool accelFound = false;
350 bool gyroFound = false;
351 if (vnObs->imuOutputs)
352 {
354 {
355 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPMAG)
356 {
357 imuObs->p_magneticField = vnObs->imuOutputs->uncompMag.cast<double>();
358 }
359 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPACCEL)
360 {
361 imuObs->p_acceleration = vnObs->imuOutputs->uncompAccel.cast<double>();
362 accelFound = true;
363 }
364 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPGYRO)
365 {
366 imuObs->p_angularRate = vnObs->imuOutputs->uncompGyro.cast<double>();
367 gyroFound = true;
368 }
369 }
370 else
371 {
372 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_MAG)
373 {
374 imuObs->p_magneticField = vnObs->imuOutputs->mag.cast<double>();
375 }
376 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_ACCEL)
377 {
378 imuObs->p_acceleration = vnObs->imuOutputs->accel.cast<double>();
379 accelFound = true;
380 }
381 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_ANGULARRATE)
382 {
383 imuObs->p_angularRate = vnObs->imuOutputs->angularRate.cast<double>();
384 gyroFound = true;
385 }
386 }
387 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_TEMP)
388 {
389 imuObs->temperature = vnObs->imuOutputs->temp;
390 }
391 }
392
393 if (accelFound && gyroFound)
394 {
395 return imuObs;
396 }
397
398 LOG_ERROR("{}: Conversion failed. Need {} acceleration and gyroscope measurements in the input data.", nameId(), _useCompensatedData ? "compensated" : "uncompensated");
399 return nullptr;
400}
401
402std::shared_ptr<const NAV::BaroPressObs> NAV::VectorNavBinaryConverter::convert2BaroPressObs(const std::shared_ptr<const VectorNavBinaryOutput>& vnObs) const // NOLINT(readability-convert-member-functions-to-static)
403{
404 auto baroPressObs = std::make_shared<BaroPressObs>();
405
406 if (vnObs->gnss1Outputs || vnObs->gnss2Outputs) // If there is no GNSS data selected in the vnSensor, Baro messages should still be sent out. The VN-100 will not provide any data otherwise.
407 {
408 if (!vnObs->timeOutputs
409 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMESTATUS)
410 || !vnObs->timeOutputs->timeStatus.dateOk()
411 || !vnObs->timeOutputs->timeStatus.timeOk()
412 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSTOW)
413 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSWEEK))
414 {
415 return nullptr;
416 }
417 baroPressObs->insTime = InsTime(InsTime_GPSweekTow(0, static_cast<int32_t>(vnObs->timeOutputs->gpsWeek), static_cast<double>(vnObs->timeOutputs->gpsTow) * 1e-9L));
418 }
419 else
420 {
421 // VN-100 vnObs->insTime is set from
422 // - 'timeSyncMaster->ppsTime + timeSyncIn' when working together with the VN-310E or
423 // - the computer time
424 baroPressObs->insTime = vnObs->insTime;
425 }
426
427 bool baroFound = false;
428 if (vnObs->imuOutputs)
429 {
430 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_PRES)
431 {
432 baroPressObs->baro_pressure = SCALE_FACTOR_KILO2HECTOPASCAL * static_cast<double>(vnObs->imuOutputs->pres);
433 baroFound = true;
434 }
435
436 // if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_TEMP)
437 // {
438 // baroPressObs->temperature = vnObs->imuOutputs->temp;
439 // }
440 }
441
442 if (baroFound)
443 {
444 return baroPressObs;
445 }
446
447 LOG_ERROR("{}: Conversion failed. No barometer pressure data found in the input data.", nameId());
448 return nullptr;
449}
450
451std::shared_ptr<const NAV::PosVelAtt> NAV::VectorNavBinaryConverter::convert2PosVelAtt(const std::shared_ptr<const VectorNavBinaryOutput>& vnObs) // NOLINT(readability-convert-member-functions-to-static)
452{
453 std::optional<Eigen::Quaterniond> n_Quat_b;
454 std::optional<Eigen::Vector3d> e_position;
455 std::optional<Eigen::Vector3d> lla_position;
456 std::optional<Eigen::Vector3d> n_velocity;
457
458 if (vnObs->attitudeOutputs)
459 {
460 if (vnObs->attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_QUATERNION)
461 {
462 n_Quat_b = vnObs->attitudeOutputs->qtn.cast<double>();
463 }
464 else if (vnObs->attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_YAWPITCHROLL)
465 {
466 Eigen::Vector3d ypr = deg2rad(vnObs->attitudeOutputs->ypr.cast<double>());
467 n_Quat_b = trafo::n_Quat_b(ypr(2), ypr(1), ypr(0));
468 }
469 else if (vnObs->attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_DCM)
470 {
471 n_Quat_b = vnObs->attitudeOutputs->dcm.cast<double>();
472 }
473 }
474
475 auto posVelAttObs = std::make_shared<PosVelAtt>();
476
478 && vnObs->insOutputs
479 && (vnObs->insOutputs->insStatus.mode() == NAV::vendor::vectornav::InsStatus::Mode::Aligning
480 || vnObs->insOutputs->insStatus.mode() == NAV::vendor::vectornav::InsStatus::Mode::Tracking))
481 {
482 if (!vnObs->timeOutputs
483 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMESTATUS)
484 || !vnObs->timeOutputs->timeStatus.dateOk()
485 || !vnObs->timeOutputs->timeStatus.timeOk()
486 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSTOW)
487 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSWEEK))
488 {
489 return nullptr;
490 }
491
492 posVelAttObs->insTime = InsTime(InsTime_GPSweekTow(0, static_cast<int32_t>(vnObs->timeOutputs->gpsWeek), static_cast<double>(vnObs->timeOutputs->gpsTow) * 1e-9L));
493
494 if (vnObs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_POSLLA)
495 {
496 lla_position = { deg2rad(vnObs->insOutputs->posLla(0)),
497 deg2rad(vnObs->insOutputs->posLla(1)),
498 vnObs->insOutputs->posLla(2) };
499 }
500 if (vnObs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_POSECEF)
501 {
502 e_position = vnObs->insOutputs->posEcef;
503 }
504
505 if (vnObs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELNED)
506 {
507 n_velocity = vnObs->insOutputs->velNed.cast<double>();
508 }
509 else if ((vnObs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELECEF)
510 && (e_position.has_value() || lla_position.has_value()))
511 {
512 Eigen::Vector3d lla = lla_position.has_value() ? lla_position.value() : trafo::ecef2lla_WGS84(e_position.value());
513 n_velocity = trafo::n_Quat_e(lla(0), lla(1)) * vnObs->insOutputs->velEcef.cast<double>();
514 }
515 else if ((vnObs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELBODY)
516 && n_Quat_b.has_value())
517 {
518 n_velocity = n_Quat_b.value() * vnObs->insOutputs->velBody.cast<double>();
519 }
520 }
521
523 && vnObs->gnss1Outputs && vnObs->gnss1Outputs->fix >= 2)
524 {
525 if (!vnObs->gnss1Outputs
526 || !vnObs->gnss1Outputs->timeInfo.status.timeOk()
527 || !vnObs->gnss1Outputs->timeInfo.status.dateOk())
528 {
529 return nullptr;
530 }
531
532 posVelAttObs->insTime = InsTime(InsTime_GPSweekTow(0, static_cast<int32_t>(vnObs->gnss1Outputs->week), static_cast<double>(vnObs->gnss1Outputs->tow) * 1e-9L));
533
534 if (!e_position.has_value() && !lla_position.has_value())
535 {
536 if (vnObs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSLLA)
537 {
538 lla_position = { deg2rad(vnObs->gnss1Outputs->posLla(0)),
539 deg2rad(vnObs->gnss1Outputs->posLla(1)),
540 vnObs->gnss1Outputs->posLla(2) };
541 }
542 if (vnObs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSECEF)
543 {
544 e_position = vnObs->gnss1Outputs->posEcef;
545 }
546 }
547
548 if (!n_velocity.has_value())
549 {
550 if (vnObs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELNED)
551 {
552 n_velocity = vnObs->gnss1Outputs->velNed.cast<double>();
553 }
554 else if ((vnObs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELECEF)
555 && (e_position.has_value() || lla_position.has_value()))
556 {
557 Eigen::Vector3d lla = lla_position.has_value() ? lla_position.value() : trafo::ecef2lla_WGS84(e_position.value());
558 n_velocity = trafo::n_Quat_e(lla(0), lla(1)) * vnObs->gnss1Outputs->velEcef.cast<double>();
559 }
560 }
561 }
563 && vnObs->gnss2Outputs && vnObs->gnss2Outputs->fix >= 2)
564 {
565 if (!vnObs->gnss2Outputs
566 || !vnObs->gnss2Outputs->timeInfo.status.timeOk()
567 || !vnObs->gnss2Outputs->timeInfo.status.dateOk())
568 {
569 return nullptr;
570 }
571
572 posVelAttObs->insTime = InsTime(InsTime_GPSweekTow(0, static_cast<int32_t>(vnObs->gnss2Outputs->week), static_cast<double>(vnObs->gnss2Outputs->tow) * 1e-9L));
573
574 if (!e_position.has_value() && !lla_position.has_value())
575 {
576 if (vnObs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSLLA)
577 {
578 lla_position = { deg2rad(vnObs->gnss2Outputs->posLla(0)),
579 deg2rad(vnObs->gnss2Outputs->posLla(1)),
580 vnObs->gnss2Outputs->posLla(2) };
581 }
582 if (vnObs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSECEF)
583 {
584 e_position = vnObs->gnss2Outputs->posEcef;
585 }
586 }
587
588 if (!n_velocity.has_value())
589 {
590 if (vnObs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELNED)
591 {
592 n_velocity = vnObs->gnss2Outputs->velNed.cast<double>();
593 }
594 else if ((vnObs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELECEF)
595 && (e_position.has_value() || lla_position.has_value()))
596 {
597 Eigen::Vector3d lla = lla_position.has_value() ? lla_position.value() : trafo::ecef2lla_WGS84(e_position.value());
598 n_velocity = trafo::n_Quat_e(lla(0), lla(1)) * vnObs->gnss2Outputs->velEcef.cast<double>();
599 }
600 }
601 }
602
603 if ((e_position.has_value() || lla_position.has_value()) && n_velocity.has_value())
604 {
605 if (e_position.has_value())
606 {
607 posVelAttObs->setPosition_e(e_position.value());
608 }
609 else
610 {
611 posVelAttObs->setPosition_lla(lla_position.value());
612 }
613 posVelAttObs->setVelocity_n(n_velocity.value());
614
615 if (!n_Quat_b.has_value())
616 {
617 LOG_DEBUG("{}: Conversion succeeded but has no attitude info.", nameId());
618 }
619 else
620 {
621 posVelAttObs->setAttitude_n_Quat_b(n_Quat_b.value());
622 }
623
624 if (_posVelAtt__init == nullptr)
625 {
626 _posVelAtt__init = posVelAttObs;
627 }
628
629 if (_forceStatic)
630 {
631 posVelAttObs->setPosition_e(_posVelAtt__init->e_position());
632 posVelAttObs->setVelocity_n(Eigen::Vector3d::Zero());
633 posVelAttObs->setAttitude_n_Quat_b(_posVelAtt__init->n_Quat_b());
634 }
635
636 return posVelAttObs;
637 }
638
639 LOG_ERROR("{}: Conversion failed. No position or velocity data found in the input data.", nameId());
640 return nullptr;
641}
642
643std::shared_ptr<const NAV::GnssObs> NAV::VectorNavBinaryConverter::convert2GnssObs(const std::shared_ptr<const VectorNavBinaryOutput>& vnObs)
644{
645 auto gnssObs = std::make_shared<GnssObs>();
646
647 if (!vnObs->gnss1Outputs
648 || !vnObs->gnss1Outputs->timeInfo.status.timeOk()
649 || !vnObs->gnss1Outputs->timeInfo.status.dateOk())
650 {
651 return nullptr;
652 }
653
654 gnssObs->insTime = InsTime(InsTime_GPSweekTow(0, static_cast<int32_t>(vnObs->gnss1Outputs->raw.week), vnObs->gnss1Outputs->raw.tow));
655
656 if (vnObs->gnss1Outputs)
657 {
658 if (vnObs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_RAWMEAS)
659 {
660 for (const auto& satRaw : vnObs->gnss1Outputs->raw.satellites)
661 {
662 bool skipMeasurement = false;
664 switch (satRaw.sys)
665 {
667 satSys = GPS;
668 break;
670 satSys = SBAS;
671 break;
673 satSys = GAL;
674 break;
676 satSys = BDS;
677 break;
679 LOG_TRACE("VectorNav SatRawElement satellite system '{}' is not supported yet. Skipping measurement.", satRaw.sys);
680 skipMeasurement = true;
681 break;
683 satSys = QZSS;
684 break;
686 satSys = GLO;
687 break;
688 default: // IRNSS not in vectorNav
689 LOG_TRACE("VectorNav SatRawElement satellite system '{}' is not supported yet. Skipping measurement.", satRaw.sys);
690 skipMeasurement = true;
691 break;
692 }
693
694 Frequency frequency = Freq_None;
695 Code code;
696 switch (SatelliteSystem_(satSys))
697 {
698 case GPS:
699 switch (satRaw.freq)
700 {
702 frequency = G01;
703 switch (satRaw.chan)
704 {
706 code = Code::G1P;
707 break;
709 code = Code::G1C;
710 break;
712 code = Code::G1Y;
713 break;
715 code = Code::G1M;
716 break;
718 code = Code::G1N;
719 break;
721 code = Code::G1S;
722 break;
724 code = Code::G1L;
725 break;
727 code = Code::G1X;
728 break;
730 code = Code::G1W;
731 break;
732 default:
733 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
734 skipMeasurement = true;
735 break;
736 }
737 break;
739 frequency = G02;
740 switch (satRaw.chan)
741 {
743 code = Code::G2P;
744 break;
746 code = Code::G2C;
747 break;
749 code = Code::G2D;
750 break;
752 code = Code::G2Y;
753 break;
755 code = Code::G2M;
756 break;
758 code = Code::G2N;
759 break;
761 code = Code::G2S;
762 break;
764 code = Code::G2L;
765 break;
767 code = Code::G2X;
768 break;
770 code = Code::G2W;
771 break;
772 default:
773 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
774 skipMeasurement = true;
775 break;
776 }
777 break;
779 frequency = G05;
780 switch (satRaw.chan)
781 {
783 code = Code::G5I;
784 break;
786 code = Code::G5Q;
787 break;
789 code = Code::G5X;
790 break;
791 default:
792 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
793 skipMeasurement = true;
794 break;
795 }
796 break;
797 default:
798 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq);
799 skipMeasurement = true;
800 break;
801 }
802 break;
803 case SBAS:
804 switch (satRaw.freq)
805 {
807 frequency = S01;
808 switch (satRaw.chan)
809 {
811 code = Code::S1C;
812 break;
813 default:
814 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
815 skipMeasurement = true;
816 break;
817 }
818 break;
820 frequency = S05;
821 switch (satRaw.chan)
822 {
824 code = Code::S5I;
825 break;
827 code = Code::S5Q;
828 break;
830 code = Code::S5X;
831 break;
832 default:
833 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
834 skipMeasurement = true;
835 break;
836 }
837 break;
838 default:
839 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq);
840 skipMeasurement = true;
841 break;
842 }
843 break;
844 case GAL:
845 switch (satRaw.freq)
846 {
848 frequency = E01;
849 switch (satRaw.chan)
850 {
852 code = Code::E1C;
853 break;
855 code = Code::E1A;
856 break;
858 code = Code::E1B;
859 break;
861 code = Code::E1X;
862 break;
864 code = Code::E1Z;
865 break;
866 default:
867 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
868 skipMeasurement = true;
869 break;
870 }
871 break;
873 frequency = E08;
874 switch (satRaw.chan)
875 {
877 code = Code::E8I;
878 break;
880 code = Code::E8Q;
881 break;
883 code = Code::E8X;
884 break;
885 default:
886 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
887 skipMeasurement = true;
888 break;
889 }
890 break;
892 frequency = E06;
893 switch (satRaw.chan)
894 {
896 code = Code::E6B;
897 break;
899 code = Code::E6C;
900 break;
902 code = Code::E6X;
903 break;
904 default:
905 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
906 skipMeasurement = true;
907 break;
908 }
909 break;
911 frequency = E05;
912 switch (satRaw.chan)
913 {
915 code = Code::E5I;
916 break;
918 code = Code::E5Q;
919 break;
921 code = Code::E5X;
922 break;
923 default:
924 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
925 skipMeasurement = true;
926 break;
927 }
928 break;
930 frequency = E07;
931 switch (satRaw.chan)
932 {
934 code = Code::E7I;
935 break;
937 code = Code::E7Q;
938 break;
940 code = Code::E7X;
941 break;
942 default:
943 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
944 skipMeasurement = true;
945 break;
946 }
947 break;
948 default:
949 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq);
950 skipMeasurement = true;
951 break;
952 }
953 break;
954 case BDS:
955 switch (satRaw.freq)
956 {
958 frequency = B01;
959 switch (satRaw.chan)
960 {
962 code = Code::B2I;
963 break;
965 code = Code::B2Q;
966 break;
968 code = Code::B2X;
969 break;
970 default:
971 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
972 skipMeasurement = true;
973 break;
974 }
975 break;
977 frequency = B06;
978 switch (satRaw.chan)
979 {
981 code = Code::B6A;
982 break;
984 code = Code::B6I;
985 break;
987 code = Code::B6Q;
988 break;
990 code = Code::B6X;
991 break;
992 default:
993 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
994 skipMeasurement = true;
995 break;
996 }
997 break;
999 frequency = B08;
1000 switch (satRaw.chan)
1001 {
1003 code = Code::B7I;
1004 break;
1006 code = Code::B7Q;
1007 break;
1009 code = Code::B7X;
1010 break;
1011 default:
1012 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
1013 skipMeasurement = true;
1014 break;
1015 }
1016 break;
1017 default:
1018 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq);
1019 skipMeasurement = true;
1020 break;
1021 }
1022 break;
1023 case QZSS:
1024 switch (satRaw.freq)
1025 {
1027 frequency = J01;
1028 switch (satRaw.chan)
1029 {
1031 code = Code::J1C;
1032 break;
1034 code = Code::J1S;
1035 break;
1037 code = Code::J1L;
1038 break;
1040 code = Code::J1X;
1041 break;
1042 default:
1043 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
1044 skipMeasurement = true;
1045 break;
1046 }
1047 break;
1049 frequency = J02;
1050 switch (satRaw.chan)
1051 {
1053 code = Code::J2S;
1054 break;
1056 code = Code::J2L;
1057 break;
1059 code = Code::J2X;
1060 break;
1061 default:
1062 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
1063 skipMeasurement = true;
1064 break;
1065 }
1066 break;
1068 frequency = J05;
1069 switch (satRaw.chan)
1070 {
1072 code = Code::J5I;
1073 break;
1075 code = Code::J5Q;
1076 break;
1078 code = Code::J5X;
1079 break;
1080 default:
1081 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
1082 skipMeasurement = true;
1083 break;
1084 }
1085 break;
1087 frequency = J06;
1088 switch (satRaw.chan)
1089 {
1091 code = Code::J6S;
1092 break;
1094 code = Code::J6L;
1095 break;
1097 code = Code::J6X;
1098 break;
1099 default:
1100 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
1101 skipMeasurement = true;
1102 break;
1103 }
1104 break;
1105 default:
1106 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq);
1107 skipMeasurement = true;
1108 break;
1109 }
1110 break;
1111 case GLO:
1112 switch (satRaw.freq)
1113 {
1115 frequency = R01;
1116 switch (satRaw.chan)
1117 {
1119 code = Code::R1C;
1120 break;
1122 code = Code::R1P;
1123 break;
1124 default:
1125 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
1126 skipMeasurement = true;
1127 break;
1128 }
1129 break;
1131 frequency = R02;
1132 switch (satRaw.chan)
1133 {
1135 code = Code::R2C;
1136 break;
1138 code = Code::R2P;
1139 break;
1140 default:
1141 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
1142 skipMeasurement = true;
1143 break;
1144 }
1145 break;
1146 default:
1147 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq);
1148 skipMeasurement = true;
1149 break;
1150 }
1151 break;
1152 case IRNSS: // IRNSS not in vectorNav
1153 case SatSys_None:
1154 skipMeasurement = true;
1155 break;
1156 }
1157
1158 if (skipMeasurement)
1159 {
1160 continue;
1161 }
1162
1163 (*gnssObs)(SatSigId(code, satRaw.svId)).pseudorange = { .value = satRaw.pr };
1164 (*gnssObs)(SatSigId(code, satRaw.svId)).carrierPhase = { .value = satRaw.cp };
1165 (*gnssObs)(SatSigId(code, satRaw.svId)).doppler = satRaw.dp;
1166 (*gnssObs)(SatSigId(code, satRaw.svId)).CN0 = satRaw.cno;
1167
1168 // LLI has not been implemented yet, but can be calculated from vendor::vectornav::RawMeas::SatRawElement::Flags
1169 // (*gnssObs)[{ frequency, satRaw.svId }].LLI = ...
1170 }
1171 }
1172 }
1173
1174 return gnssObs;
1175}
1176
1178{
1179 switch (value)
1180 {
1182 return "ImuObs";
1184 return "ImuObsWDelta";
1186 return "BaroPressObs";
1188 return "PosVelAtt";
1190 return "GnssObs";
1192 return "";
1193 }
1194 return "";
1195}
Barometric Pressure Storage Class.
Transformation collection.
Combo representing an enumeration.
Save/Load the Nodes.
nlohmann::json json
json namespace
The class is responsible for all time-related tasks.
Utility class for logging to console and file.
#define LOG_DEBUG
Debug information. Should not be called on functions which receive observations (spamming)
Definition Logger.hpp:67
#define LOG_ERROR
Error occurred, which stops part of the program to work, but not everything.
Definition Logger.hpp:73
#define LOG_TRACE
Detailled info to trace the execution of the program. Should not be called on functions which receive...
Definition Logger.hpp:65
constexpr double SCALE_FACTOR_KILO2HECTOPASCAL
Scale factor to kPa to hPa.
Converts VectorNavBinaryOutput.
static std::string type()
Returns the type of the data class.
Enumerate for GNSS Codes.
Definition Code.hpp:89
@ E6B
GAL E6 - Data.
Definition Code.hpp:128
@ G2P
GPS L2 - P-code (unencrypted)
Definition Code.hpp:110
@ G2C
GPS L2 - C/A-code.
Definition Code.hpp:105
@ B7I
BeiDou B2b (BDS-2) - B2I(OS)
Definition Code.hpp:166
@ R1C
GLO L1 - C/A-code.
Definition Code.hpp:139
@ J2L
QZSS L2 - L2C-code (long)
Definition Code.hpp:182
@ G1L
GPS L1 - L1C-P (pilot)
Definition Code.hpp:98
@ G2D
GPS L2 - Semi-codeless P(Y) tracking (L1 C/A + (P2-P1))
Definition Code.hpp:106
@ B6Q
BeiDou B3 - B3Q.
Definition Code.hpp:163
@ J6L
QZSS L6 - L6P LEX signal (long)
Definition Code.hpp:191
@ E7I
GAL E5b - Data.
Definition Code.hpp:132
@ E5Q
GAL E5a - Pilot.
Definition Code.hpp:125
@ S1C
SBAS L1 - C/A-code.
Definition Code.hpp:205
@ S5Q
SBAS L5 - Pilot.
Definition Code.hpp:207
@ G1Y
GPS L1 - Y-code (with decryption)
Definition Code.hpp:102
@ G1X
GPS L1 - L1C-(D+P) (combined)
Definition Code.hpp:99
@ E1B
GAL E1 - OS (data)
Definition Code.hpp:120
@ G1M
GPS L1 - M-code.
Definition Code.hpp:103
@ J5I
QZSS L5 - Data.
Definition Code.hpp:184
@ G1N
GPS L1 - codeless.
Definition Code.hpp:104
@ G2X
GPS L2 - L2C(M+L) (combined)
Definition Code.hpp:109
@ J6X
QZSS L6 - L6(D+P) LEX signal (combined)
Definition Code.hpp:192
@ E6X
GAL E6 - Combined (B+C)
Definition Code.hpp:130
@ J1L
QZSS L1 - L1C (pilot)
Definition Code.hpp:178
@ J1S
QZSS L1 - L1C (data)
Definition Code.hpp:177
@ J1X
QZSS L1 - L1C (combined)
Definition Code.hpp:179
@ E8X
GAL E5(a+b) - AltBOC (combined)
Definition Code.hpp:137
@ R2C
GLO L2 - C/A-code.
Definition Code.hpp:141
@ B6A
BeiDou B3 - B3A.
Definition Code.hpp:165
@ G2Y
GPS L2 - Y-code (with decryption)
Definition Code.hpp:112
@ G5X
GPS L5 - Combined.
Definition Code.hpp:117
@ E5I
GAL E5a - Data.
Definition Code.hpp:124
@ E1Z
GAL E1 - PRS + OS (data + pilot)
Definition Code.hpp:123
@ J1C
QZSS L1 - C/A-code.
Definition Code.hpp:176
@ J5Q
QZSS L5 - Pilot.
Definition Code.hpp:185
@ G1P
GPS L1 - P-code (unencrypted)
Definition Code.hpp:100
@ J2X
QZSS L2 - L2C-code (combined)
Definition Code.hpp:183
@ G1C
GPS L1 - C/A-code.
Definition Code.hpp:96
@ G1W
GPS L1 - Semicodeless P(Y) tracking (Z-tracking)
Definition Code.hpp:101
@ G2L
GPS L2 - L2C(L) (long)
Definition Code.hpp:108
@ R1P
GLO L1 - P-code.
Definition Code.hpp:140
@ E7X
GAL E5b - Combined.
Definition Code.hpp:134
@ B2Q
BeiDou B1-2 - B1Q.
Definition Code.hpp:157
@ J5X
QZSS L5 - Combined.
Definition Code.hpp:186
@ E8I
GAL E5(a+b) - AltBOC (data)
Definition Code.hpp:135
@ G5Q
GPS L5 - Pilot.
Definition Code.hpp:116
@ G2W
GPS L2 - Semicodeless P(Y) tracking (Z-tracking)
Definition Code.hpp:111
@ G2M
GPS L2 - M-code.
Definition Code.hpp:113
@ R2P
GLO L2 - P-code.
Definition Code.hpp:142
@ G2N
GPS L2 - codeless.
Definition Code.hpp:114
@ E1A
GAL E1 - PRS signal.
Definition Code.hpp:119
@ S5X
SBAS L5 - Combined.
Definition Code.hpp:208
@ E8Q
GAL E5(a+b) - AltBOC (pilot)
Definition Code.hpp:136
@ J6S
QZSS L6 - L6D LEX signal (short)
Definition Code.hpp:190
@ G5I
GPS L5 - Data.
Definition Code.hpp:115
@ S5I
SBAS L5 - Data.
Definition Code.hpp:206
@ B6X
BeiDou B3 - B3I, B3Q, combined.
Definition Code.hpp:164
@ B7X
BeiDou B2b (BDS-2) - B2I(OS), B2Q, combined.
Definition Code.hpp:168
@ E1X
GAL E1 - OS(B+C) (combined)
Definition Code.hpp:122
@ B2I
BeiDou B1-2 - B1I(OS)
Definition Code.hpp:156
@ E6C
GAL E6 - Pilot.
Definition Code.hpp:129
@ B7Q
BeiDou B2b (BDS-2) - B2Q.
Definition Code.hpp:167
@ G1S
GPS L1 - L1C-D (data)
Definition Code.hpp:97
@ B2X
BeiDou B1-2 - B1I(OS), B1Q, combined.
Definition Code.hpp:158
@ E7Q
GAL E5b - Pilot.
Definition Code.hpp:133
@ B6I
BeiDou B3 - B3I.
Definition Code.hpp:162
@ E1C
GAL E1 - OS (pilot)
Definition Code.hpp:121
@ G2S
GPS L2 - L2C(M) (medium)
Definition Code.hpp:107
@ E5X
GAL E5a - Combined.
Definition Code.hpp:126
@ J2S
QZSS L2 - L2C-code (medium)
Definition Code.hpp:181
Frequency definition for different satellite systems.
Definition Frequency.hpp:59
static std::string type()
Returns the type of the data class.
Definition GnssObs.hpp:151
static std::string type()
Returns the type of the data class.
static std::string type()
Returns the type of the data class.
Definition ImuObs.hpp:33
TsDeque< std::shared_ptr< const NAV::NodeData > > NodeDataQueue
Node data queue type.
Definition Pin.hpp:707
The class is responsible for all time-related tasks.
Definition InsTime.hpp:710
ImVec2 _guiConfigDefaultWindowSize
Definition Node.hpp:522
std::vector< OutputPin > outputPins
List of output pins.
Definition Node.hpp:511
Node(std::string name)
Constructor.
Definition Node.cpp:29
OutputPin * CreateOutputPin(const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier, OutputPin::PinData data=static_cast< void * >(nullptr), int idx=-1)
Create an Output Pin object.
Definition Node.cpp:278
std::string nameId() const
Node name and id.
Definition Node.cpp:323
std::string name
Name of the Node.
Definition Node.hpp:507
InputPin * CreateInputPin(const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier={}, InputPin::Callback callback=static_cast< InputPin::FlowFirableCallbackFunc >(nullptr), InputPin::FlowFirableCheckFunc firable=nullptr, int priority=0, int idx=-1)
Create an Input Pin object.
Definition Node.cpp:252
void invokeCallbacks(size_t portIndex, const std::shared_ptr< const NodeData > &data)
Calls all registered callbacks on the specified output port.
Definition Node.cpp:179
bool _hasConfig
Flag if the config window should be shown.
Definition Node.hpp:525
static std::string type()
Returns the type of the data class.
Definition PosVelAtt.hpp:29
auto extract_front()
Returns a copy of the first element in the container and removes it from the container.
Definition TsDeque.hpp:494
static std::shared_ptr< const GnssObs > convert2GnssObs(const std::shared_ptr< const VectorNavBinaryOutput > &vnObs)
Converts the VectorNavBinaryOutput to a GnssObs observation.
std::shared_ptr< const ImuObs > convert2ImuObs(const std::shared_ptr< const VectorNavBinaryOutput > &vnObs) const
Converts the VectorNavBinaryOutput to a ImuObs observation.
OutputType _outputType
The selected output type in the GUI.
std::shared_ptr< const PosVelAtt > convert2PosVelAtt(const std::shared_ptr< const VectorNavBinaryOutput > &vnObs)
Converts the VectorNavBinaryOutput to a PosVelAtt observation.
OutputType
Enum specifying the type of the output message.
void receiveObs(InputPin::NodeDataQueue &queue, size_t pinIdx)
Converts the VectorNavBinaryOutput observation to the selected message type.
static constexpr size_t OUTPUT_PORT_INDEX_CONVERTED
Flow.
static std::string category()
String representation of the Class Category.
std::shared_ptr< const PosVelAtt > _posVelAtt__init
Position, Velocity and Attitude at initialization (needed for static data)
void restore(const json &j) override
Restores the node from a json object.
static std::string typeStatic()
String representation of the Class Type.
std::shared_ptr< const ImuObsWDelta > convert2ImuObsWDelta(const std::shared_ptr< const VectorNavBinaryOutput > &vnObs) const
Converts the VectorNavBinaryOutput to a ImuObsWDelta observation.
json save() const override
Saves the node into a json object.
std::shared_ptr< const BaroPressObs > convert2BaroPressObs(const std::shared_ptr< const VectorNavBinaryOutput > &vnObs) const
Converts the VectorNavBinaryOutput to a BaroPressObs observation.
~VectorNavBinaryConverter() override
Destructor.
PosVelSource _posVelSource
The selected PosVel source in the GUI.
std::string type() const override
String representation of the Class Type.
bool _forceStatic
GUI option. If checked forces position to a static value and velocity to 0.
bool _useCompensatedData
Whether to extract the compensated data or the uncompensated.
bool initialize() override
Initialize the node.
void guiConfig() override
ImGui config window which is shown on double click.
@ PosVelSource_Gnss2
Take only GNSS2 values into account.
@ PosVelSource_Gnss1
Take only GNSS1 values into account.
@ PosVelSource_Ins
Take only INS values into account.
static std::string type()
Returns the type of the data class.
@ Aligning
INS Filter is dynamically aligning.
void ApplyChanges()
Signals that there have been changes to the flow.
bool EnumCombo(const char *label, T &enumeration, size_t startIdx=0)
Combo representing an enumeration.
Definition EnumCombo.hpp:30
Eigen::Vector3< typename Derived::Scalar > ecef2lla_WGS84(const Eigen::MatrixBase< Derived > &e_position)
Converts Earth-centered-Earth-fixed coordinates into latitude, longitude and altitude using WGS84.
Eigen::Quaternion< Scalar > n_Quat_e(const Scalar &latitude, const Scalar &longitude)
Quaternion for rotations from Earth-fixed to navigation frame.
Eigen::Quaternion< Scalar > n_Quat_b(Scalar roll, Scalar pitch, Scalar yaw)
Quaternion for rotations from body to navigation frame.
@ E07
Galileo E5b (1207.14 MHz).
Definition Frequency.hpp:34
@ J01
QZSS L1 (1575.42 MHz).
Definition Frequency.hpp:47
@ S01
SBAS L1 (1575.42 MHz).
Definition Frequency.hpp:53
@ E06
Galileo E6 (1278.75 MHz).
Definition Frequency.hpp:33
@ Freq_None
None.
Definition Frequency.hpp:27
@ R02
GLONASS, "G2" (1246 MHz).
Definition Frequency.hpp:37
@ B08
Beidou B2 (B2a + B2b) (1191.795MHz).
Definition Frequency.hpp:46
@ E01
Galileo, "E1" (1575.42 MHz).
Definition Frequency.hpp:31
@ B06
Beidou B3 (1268.52 MHz).
Definition Frequency.hpp:44
@ E05
Galileo E5a (1176.45 MHz).
Definition Frequency.hpp:32
@ S05
SBAS L5 (1176.45 MHz).
Definition Frequency.hpp:54
@ G02
GPS L2 (1227.6 MHz).
Definition Frequency.hpp:29
@ R01
GLONASS, "G1" (1602 MHZ).
Definition Frequency.hpp:36
@ G01
GPS L1 (1575.42 MHz).
Definition Frequency.hpp:28
@ B01
Beidou B1 (1575.42 MHz).
Definition Frequency.hpp:41
@ J05
QZSS L5 (1176.45 MHz).
Definition Frequency.hpp:49
@ J02
QZSS L2 (1227.6 MHz).
Definition Frequency.hpp:48
@ E08
Galileo E5 (E5a + E5b) (1191.795MHz).
Definition Frequency.hpp:35
@ J06
QZSS L6 / LEX (1278.75 MHz).
Definition Frequency.hpp:50
@ G05
GPS L5 (1176.45 MHz).
Definition Frequency.hpp:30
const char * to_string(gui::widgets::PositionWithFrame::ReferenceFrame refFrame)
Converts the enum to a string.
constexpr auto deg2rad(const T &deg)
Convert Degree to Radians.
Definition Units.hpp:21
SatelliteSystem_
Satellite System enumeration.
@ GPS
Global Positioning System.
@ QZSS
Quasi-Zenith Satellite System.
@ GLO
Globalnaja nawigazionnaja sputnikowaja sistema (GLONASS)
@ GAL
Galileo.
@ SBAS
Satellite Based Augmentation System.
@ BDS
Beidou.
@ SatSys_None
No Satellite system.
@ IRNSS
Indian Regional Navigation Satellite System.
GPS week and time of week in GPS standard time [GPST].
Definition InsTime.hpp:369
@ Flow
NodeData Trigger.
Definition Pin.hpp:52
Identifies a satellite signal (satellite frequency and number)
Satellite System type.
@ L1
L1(GPS,QZSS,SBAS), G1(GLO), E2-L1-E1(GAL), B1(BDS)
@ L_Chan
L chan (L2CGPS, L2CQZSS), P chan (GPS,QZSS)
@ BC_Chan
B+C chan (GAL), I+Q chan (GPS,GAL,QZSS,BDS), M+L chan (GPS,QZSS), D+P chan (GPS,QZSS)
@ CA_Code
C/A-code (GPS,GLO,SBAS,QZSS), C chan (GAL)
@ M_Chan
M chan (L2CGPS, L2CQZSS), D chan (GPS,QZSS)