0.3.0
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
18namespace nm = NAV::NodeManager;
20
22
25
26/// @brief Scale factor to kPa to hPa
27constexpr double SCALE_FACTOR_KILO2HECTOPASCAL = 10;
28
40
45
47{
48 return "VectorNavBinaryConverter";
49}
50
52{
53 return typeStatic();
54}
55
57{
58 return "Converter";
59}
60
62{
63 if (gui::widgets::EnumCombo(fmt::format("Output Type##{}", size_t(id)).c_str(), _outputType))
64 {
65 LOG_DEBUG("{}: Output Type changed to {}", nameId(), to_string(_outputType));
67 {
70 }
72 {
75 }
77 {
80 }
82 {
85 }
87 {
90 }
91
92 for (auto& link : outputPins.front().links)
93 {
94 if (auto* connectedPin = link.getConnectedPin())
95 {
96 outputPins.front().recreateLink(*connectedPin);
97 }
98 }
99
101 }
103 {
104 if (ImGui::Checkbox(fmt::format("Use compensated data##{}", size_t(id)).c_str(), &_useCompensatedData))
105 {
106 LOG_DEBUG("{}: _useCompensatedData changed to {}", nameId(), _useCompensatedData);
108 }
109 }
111 {
112 if (auto posVelSource = static_cast<int>(_posVelSource);
113 ImGui::Combo(fmt::format("Data Source##{}", size_t(id)).c_str(), &posVelSource, "Best\0INS\0GNSS 1\0GNSS 2\0\0"))
114 {
115 _posVelSource = static_cast<decltype(_posVelSource)>(posVelSource);
116 LOG_DEBUG("{}: _posVelSource changed to {}", nameId(), fmt::underlying(_posVelSource));
118 }
119 if (ImGui::Checkbox(fmt::format("Force static##{}", size_t(id)).c_str(), &_forceStatic))
120 {
121 LOG_DEBUG("{}: _forceStatic changed to {}", nameId(), _forceStatic);
123 }
124 }
125}
126
128{
129 LOG_TRACE("{}: called", nameId());
130
131 json j;
132
133 j["outputType"] = _outputType;
134 j["posVelSource"] = _posVelSource;
135 j["forceStatic"] = _forceStatic;
136 j["useCompensatedData"] = _useCompensatedData;
137
138 return j;
139}
140
142{
143 LOG_TRACE("{}: called", nameId());
144
145 if (j.contains("outputType"))
146 {
147 j.at("outputType").get_to(_outputType);
148
149 if (!outputPins.empty())
150 {
152 {
155 }
157 {
160 }
162 {
165 }
167 {
170 }
172 {
175 }
176 }
177 }
178 if (j.contains("posVelSource"))
179 {
180 j.at("posVelSource").get_to(_posVelSource);
181 }
182 if (j.contains("forceStatic"))
183 {
184 _forceStatic = j.at("forceStatic");
185 }
186 if (j.contains("useCompensatedData"))
187 {
188 _useCompensatedData = j.at("useCompensatedData");
189 }
190}
191
193{
194 LOG_TRACE("{}: called", nameId());
195
196 _posVelAtt__init = nullptr;
197
198 return true;
199}
200
202{
203 auto vnObs = std::static_pointer_cast<const VectorNavBinaryOutput>(queue.extract_front());
204
205 std::shared_ptr<const NodeData> convertedData = nullptr;
206
208 {
209 convertedData = convert2ImuObsWDelta(vnObs);
210 }
212 {
213 convertedData = convert2ImuObs(vnObs);
214 }
216 {
217 convertedData = convert2BaroPressObs(vnObs);
218 }
220 {
221 convertedData = convert2PosVelAtt(vnObs);
222 }
224 {
225 convertedData = convert2GnssObs(vnObs);
226 }
227
228 if (convertedData)
229 {
231 }
232}
233
234std::shared_ptr<const NAV::ImuObsWDelta> NAV::VectorNavBinaryConverter::convert2ImuObsWDelta(const std::shared_ptr<const VectorNavBinaryOutput>& vnObs) const // NOLINT(readability-convert-member-functions-to-static)
235{
236 auto imuObs = std::make_shared<ImuObsWDelta>(vnObs->imuPos);
237
238 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.
239 {
240 if (!vnObs->timeOutputs
241 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMESTATUS)
242 || !vnObs->timeOutputs->timeStatus.dateOk()
243 || !vnObs->timeOutputs->timeStatus.timeOk()
244 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSTOW)
245 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSWEEK))
246 {
247 return nullptr;
248 }
249 imuObs->insTime = InsTime(InsTime_GPSweekTow(0, static_cast<int32_t>(vnObs->timeOutputs->gpsWeek), static_cast<double>(vnObs->timeOutputs->gpsTow) * 1e-9L));
250 }
251 else
252 {
253 // VN-100 vnObs->insTime is set from
254 // - 'timeSyncMaster->ppsTime + timeSyncIn' when working together with the VN-310E or
255 // - the computer time
256 imuObs->insTime = vnObs->insTime;
257 }
258
259 bool accelFound = false;
260 bool gyroFound = false;
261 bool dThetaFound = false;
262 bool dVelFound = false;
263 if (vnObs->imuOutputs)
264 {
266 {
267 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPMAG)
268 {
269 imuObs->p_magneticField = vnObs->imuOutputs->uncompMag.cast<double>();
270 }
271 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPACCEL)
272 {
273 imuObs->p_acceleration = vnObs->imuOutputs->uncompAccel.cast<double>();
274 accelFound = true;
275 }
276 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPGYRO)
277 {
278 imuObs->p_angularRate = vnObs->imuOutputs->uncompGyro.cast<double>();
279 gyroFound = true;
280 }
281 }
282 else
283 {
284 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_MAG)
285 {
286 imuObs->p_magneticField = vnObs->imuOutputs->mag.cast<double>();
287 }
288 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_ACCEL)
289 {
290 imuObs->p_acceleration = vnObs->imuOutputs->accel.cast<double>();
291 accelFound = true;
292 }
293 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_ANGULARRATE)
294 {
295 imuObs->p_angularRate = vnObs->imuOutputs->angularRate.cast<double>();
296 gyroFound = true;
297 }
298 }
299 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_TEMP)
300 {
301 imuObs->temperature = vnObs->imuOutputs->temp;
302 }
303 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_DELTATHETA)
304 {
305 imuObs->dtime = vnObs->imuOutputs->deltaTime;
306 imuObs->dtheta = deg2rad(vnObs->imuOutputs->deltaTheta.cast<double>());
307 dThetaFound = true;
308 }
309 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_DELTAVEL)
310 {
311 imuObs->dvel = vnObs->imuOutputs->deltaV.cast<double>();
312 dVelFound = true;
313 }
314 }
315
316 if (accelFound && gyroFound && dThetaFound && dVelFound)
317 {
318 return imuObs;
319 }
320
321 LOG_ERROR("{}: Conversion failed. Need {} acceleration and gyroscope measurements and deltaTheta and deltaVel in the input data.",
322 nameId(), _useCompensatedData ? "compensated" : "uncompensated");
323 return nullptr;
324}
325
326std::shared_ptr<const NAV::ImuObs> NAV::VectorNavBinaryConverter::convert2ImuObs(const std::shared_ptr<const VectorNavBinaryOutput>& vnObs) const // NOLINT(readability-convert-member-functions-to-static)
327{
328 auto imuObs = std::make_shared<ImuObs>(vnObs->imuPos);
329
330 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.
331 {
332 if (!vnObs->timeOutputs
333 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMESTATUS)
334 || !vnObs->timeOutputs->timeStatus.dateOk()
335 || !vnObs->timeOutputs->timeStatus.timeOk()
336 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSTOW)
337 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSWEEK))
338 {
339 return nullptr;
340 }
341 imuObs->insTime = InsTime(InsTime_GPSweekTow(0, static_cast<int32_t>(vnObs->timeOutputs->gpsWeek), static_cast<double>(vnObs->timeOutputs->gpsTow) * 1e-9L));
342 }
343 else
344 {
345 // VN-100 vnObs->insTime is set from
346 // - 'timeSyncMaster->ppsTime + timeSyncIn' when working together with the VN-310E or
347 // - the computer time
348 imuObs->insTime = vnObs->insTime;
349 }
350
351 bool accelFound = false;
352 bool gyroFound = false;
353 if (vnObs->imuOutputs)
354 {
356 {
357 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPMAG)
358 {
359 imuObs->p_magneticField = vnObs->imuOutputs->uncompMag.cast<double>();
360 }
361 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPACCEL)
362 {
363 imuObs->p_acceleration = vnObs->imuOutputs->uncompAccel.cast<double>();
364 accelFound = true;
365 }
366 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_UNCOMPGYRO)
367 {
368 imuObs->p_angularRate = vnObs->imuOutputs->uncompGyro.cast<double>();
369 gyroFound = true;
370 }
371 }
372 else
373 {
374 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_MAG)
375 {
376 imuObs->p_magneticField = vnObs->imuOutputs->mag.cast<double>();
377 }
378 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_ACCEL)
379 {
380 imuObs->p_acceleration = vnObs->imuOutputs->accel.cast<double>();
381 accelFound = true;
382 }
383 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_ANGULARRATE)
384 {
385 imuObs->p_angularRate = vnObs->imuOutputs->angularRate.cast<double>();
386 gyroFound = true;
387 }
388 }
389 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_TEMP)
390 {
391 imuObs->temperature = vnObs->imuOutputs->temp;
392 }
393 }
394
395 if (accelFound && gyroFound)
396 {
397 return imuObs;
398 }
399
400 LOG_ERROR("{}: Conversion failed. Need {} acceleration and gyroscope measurements in the input data.", nameId(), _useCompensatedData ? "compensated" : "uncompensated");
401 return nullptr;
402}
403
404std::shared_ptr<const NAV::BaroPressObs> NAV::VectorNavBinaryConverter::convert2BaroPressObs(const std::shared_ptr<const VectorNavBinaryOutput>& vnObs) const // NOLINT(readability-convert-member-functions-to-static)
405{
406 auto baroPressObs = std::make_shared<BaroPressObs>();
407
408 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.
409 {
410 if (!vnObs->timeOutputs
411 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMESTATUS)
412 || !vnObs->timeOutputs->timeStatus.dateOk()
413 || !vnObs->timeOutputs->timeStatus.timeOk()
414 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSTOW)
415 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSWEEK))
416 {
417 return nullptr;
418 }
419 baroPressObs->insTime = InsTime(InsTime_GPSweekTow(0, static_cast<int32_t>(vnObs->timeOutputs->gpsWeek), static_cast<double>(vnObs->timeOutputs->gpsTow) * 1e-9L));
420 }
421 else
422 {
423 // VN-100 vnObs->insTime is set from
424 // - 'timeSyncMaster->ppsTime + timeSyncIn' when working together with the VN-310E or
425 // - the computer time
426 baroPressObs->insTime = vnObs->insTime;
427 }
428
429 bool baroFound = false;
430 if (vnObs->imuOutputs)
431 {
432 if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_PRES)
433 {
434 baroPressObs->baro_pressure = SCALE_FACTOR_KILO2HECTOPASCAL * static_cast<double>(vnObs->imuOutputs->pres);
435 baroFound = true;
436 }
437
438 // if (vnObs->imuOutputs->imuField & vn::protocol::uart::ImuGroup::IMUGROUP_TEMP)
439 // {
440 // baroPressObs->temperature = vnObs->imuOutputs->temp;
441 // }
442 }
443
444 if (baroFound)
445 {
446 return baroPressObs;
447 }
448
449 LOG_ERROR("{}: Conversion failed. No barometer pressure data found in the input data.", nameId());
450 return nullptr;
451}
452
453std::shared_ptr<const NAV::PosVelAtt> NAV::VectorNavBinaryConverter::convert2PosVelAtt(const std::shared_ptr<const VectorNavBinaryOutput>& vnObs) // NOLINT(readability-convert-member-functions-to-static)
454{
455 std::optional<Eigen::Quaterniond> n_Quat_b;
456 std::optional<Eigen::Vector3d> e_position;
457 std::optional<Eigen::Vector3d> lla_position;
458 std::optional<Eigen::Vector3d> n_velocity;
459
460 if (vnObs->attitudeOutputs)
461 {
462 if (vnObs->attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_QUATERNION)
463 {
464 n_Quat_b = vnObs->attitudeOutputs->qtn.cast<double>();
465 }
466 else if (vnObs->attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_YAWPITCHROLL)
467 {
468 Eigen::Vector3d ypr = deg2rad(vnObs->attitudeOutputs->ypr.cast<double>());
469 n_Quat_b = trafo::n_Quat_b(ypr(2), ypr(1), ypr(0));
470 }
471 else if (vnObs->attitudeOutputs->attitudeField & vn::protocol::uart::AttitudeGroup::ATTITUDEGROUP_DCM)
472 {
473 n_Quat_b = vnObs->attitudeOutputs->dcm.cast<double>();
474 }
475 }
476
477 auto posVelAttObs = std::make_shared<PosVelAtt>();
478
480 && vnObs->insOutputs
481 && (vnObs->insOutputs->insStatus.mode() == NAV::vendor::vectornav::InsStatus::Mode::Aligning
482 || vnObs->insOutputs->insStatus.mode() == NAV::vendor::vectornav::InsStatus::Mode::Tracking))
483 {
484 if (!vnObs->timeOutputs
485 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_TIMESTATUS)
486 || !vnObs->timeOutputs->timeStatus.dateOk()
487 || !vnObs->timeOutputs->timeStatus.timeOk()
488 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSTOW)
489 || !(vnObs->timeOutputs->timeField & vn::protocol::uart::TimeGroup::TIMEGROUP_GPSWEEK))
490 {
491 return nullptr;
492 }
493
494 posVelAttObs->insTime = InsTime(InsTime_GPSweekTow(0, static_cast<int32_t>(vnObs->timeOutputs->gpsWeek), static_cast<double>(vnObs->timeOutputs->gpsTow) * 1e-9L));
495
496 if (vnObs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_POSLLA)
497 {
498 lla_position = { deg2rad(vnObs->insOutputs->posLla(0)),
499 deg2rad(vnObs->insOutputs->posLla(1)),
500 vnObs->insOutputs->posLla(2) };
501 }
502 if (vnObs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_POSECEF)
503 {
504 e_position = vnObs->insOutputs->posEcef;
505 }
506
507 if (vnObs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELNED)
508 {
509 n_velocity = vnObs->insOutputs->velNed.cast<double>();
510 }
511 else if ((vnObs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELECEF)
512 && (e_position.has_value() || lla_position.has_value()))
513 {
514 Eigen::Vector3d lla = lla_position.has_value() ? lla_position.value() : trafo::ecef2lla_WGS84(e_position.value());
515 n_velocity = trafo::n_Quat_e(lla(0), lla(1)) * vnObs->insOutputs->velEcef.cast<double>();
516 }
517 else if ((vnObs->insOutputs->insField & vn::protocol::uart::InsGroup::INSGROUP_VELBODY)
518 && n_Quat_b.has_value())
519 {
520 n_velocity = n_Quat_b.value() * vnObs->insOutputs->velBody.cast<double>();
521 }
522 }
523
525 && vnObs->gnss1Outputs && vnObs->gnss1Outputs->fix >= 2)
526 {
527 if (!vnObs->gnss1Outputs
528 || !vnObs->gnss1Outputs->timeInfo.status.timeOk()
529 || !vnObs->gnss1Outputs->timeInfo.status.dateOk())
530 {
531 return nullptr;
532 }
533
534 posVelAttObs->insTime = InsTime(InsTime_GPSweekTow(0, static_cast<int32_t>(vnObs->gnss1Outputs->week), static_cast<double>(vnObs->gnss1Outputs->tow) * 1e-9L));
535
536 if (!e_position.has_value() && !lla_position.has_value())
537 {
538 if (vnObs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSLLA)
539 {
540 lla_position = { deg2rad(vnObs->gnss1Outputs->posLla(0)),
541 deg2rad(vnObs->gnss1Outputs->posLla(1)),
542 vnObs->gnss1Outputs->posLla(2) };
543 }
544 if (vnObs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSECEF)
545 {
546 e_position = vnObs->gnss1Outputs->posEcef;
547 }
548 }
549
550 if (!n_velocity.has_value())
551 {
552 if (vnObs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELNED)
553 {
554 n_velocity = vnObs->gnss1Outputs->velNed.cast<double>();
555 }
556 else if ((vnObs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELECEF)
557 && (e_position.has_value() || lla_position.has_value()))
558 {
559 Eigen::Vector3d lla = lla_position.has_value() ? lla_position.value() : trafo::ecef2lla_WGS84(e_position.value());
560 n_velocity = trafo::n_Quat_e(lla(0), lla(1)) * vnObs->gnss1Outputs->velEcef.cast<double>();
561 }
562 }
563 }
565 && vnObs->gnss2Outputs && vnObs->gnss2Outputs->fix >= 2)
566 {
567 if (!vnObs->gnss2Outputs
568 || !vnObs->gnss2Outputs->timeInfo.status.timeOk()
569 || !vnObs->gnss2Outputs->timeInfo.status.dateOk())
570 {
571 return nullptr;
572 }
573
574 posVelAttObs->insTime = InsTime(InsTime_GPSweekTow(0, static_cast<int32_t>(vnObs->gnss2Outputs->week), static_cast<double>(vnObs->gnss2Outputs->tow) * 1e-9L));
575
576 if (!e_position.has_value() && !lla_position.has_value())
577 {
578 if (vnObs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSLLA)
579 {
580 lla_position = { deg2rad(vnObs->gnss2Outputs->posLla(0)),
581 deg2rad(vnObs->gnss2Outputs->posLla(1)),
582 vnObs->gnss2Outputs->posLla(2) };
583 }
584 if (vnObs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_POSECEF)
585 {
586 e_position = vnObs->gnss2Outputs->posEcef;
587 }
588 }
589
590 if (!n_velocity.has_value())
591 {
592 if (vnObs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELNED)
593 {
594 n_velocity = vnObs->gnss2Outputs->velNed.cast<double>();
595 }
596 else if ((vnObs->gnss2Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_VELECEF)
597 && (e_position.has_value() || lla_position.has_value()))
598 {
599 Eigen::Vector3d lla = lla_position.has_value() ? lla_position.value() : trafo::ecef2lla_WGS84(e_position.value());
600 n_velocity = trafo::n_Quat_e(lla(0), lla(1)) * vnObs->gnss2Outputs->velEcef.cast<double>();
601 }
602 }
603 }
604
605 if ((e_position.has_value() || lla_position.has_value()) && n_velocity.has_value())
606 {
607 if (e_position.has_value())
608 {
609 posVelAttObs->setPosition_e(e_position.value());
610 }
611 else
612 {
613 posVelAttObs->setPosition_lla(lla_position.value());
614 }
615 posVelAttObs->setVelocity_n(n_velocity.value());
616
617 if (!n_Quat_b.has_value())
618 {
619 LOG_DEBUG("{}: Conversion succeeded but has no attitude info.", nameId());
620 }
621 else
622 {
623 posVelAttObs->setAttitude_n_Quat_b(n_Quat_b.value());
624 }
625
626 if (_posVelAtt__init == nullptr)
627 {
628 _posVelAtt__init = posVelAttObs;
629 }
630
631 if (_forceStatic)
632 {
633 posVelAttObs->setPosition_e(_posVelAtt__init->e_position());
634 posVelAttObs->setVelocity_n(Eigen::Vector3d::Zero());
635 posVelAttObs->setAttitude_n_Quat_b(_posVelAtt__init->n_Quat_b());
636 }
637
638 return posVelAttObs;
639 }
640
641 LOG_ERROR("{}: Conversion failed. No position or velocity data found in the input data.", nameId());
642 return nullptr;
643}
644
645std::shared_ptr<const NAV::GnssObs> NAV::VectorNavBinaryConverter::convert2GnssObs(const std::shared_ptr<const VectorNavBinaryOutput>& vnObs)
646{
647 auto gnssObs = std::make_shared<GnssObs>();
648
649 if (!vnObs->gnss1Outputs
650 || !vnObs->gnss1Outputs->timeInfo.status.timeOk()
651 || !vnObs->gnss1Outputs->timeInfo.status.dateOk())
652 {
653 return nullptr;
654 }
655
656 gnssObs->insTime = InsTime(InsTime_GPSweekTow(0, static_cast<int32_t>(vnObs->gnss1Outputs->raw.week), vnObs->gnss1Outputs->raw.tow));
657
658 if (vnObs->gnss1Outputs)
659 {
660 if (vnObs->gnss1Outputs->gnssField & vn::protocol::uart::GpsGroup::GPSGROUP_RAWMEAS)
661 {
662 for (const auto& satRaw : vnObs->gnss1Outputs->raw.satellites)
663 {
664 bool skipMeasurement = false;
666 switch (satRaw.sys)
667 {
669 satSys = GPS;
670 break;
672 satSys = SBAS;
673 break;
675 satSys = GAL;
676 break;
678 satSys = BDS;
679 break;
681 LOG_TRACE("VectorNav SatRawElement satellite system '{}' is not supported yet. Skipping measurement.", satRaw.sys);
682 skipMeasurement = true;
683 break;
685 satSys = QZSS;
686 break;
688 satSys = GLO;
689 break;
690 default: // IRNSS not in vectorNav
691 LOG_TRACE("VectorNav SatRawElement satellite system '{}' is not supported yet. Skipping measurement.", satRaw.sys);
692 skipMeasurement = true;
693 break;
694 }
695
696 Frequency frequency = Freq_None;
697 Code code;
698 switch (SatelliteSystem_(satSys))
699 {
700 case GPS:
701 switch (satRaw.freq)
702 {
704 frequency = G01;
705 switch (satRaw.chan)
706 {
708 code = Code::G1P;
709 break;
711 code = Code::G1C;
712 break;
714 code = Code::G1Y;
715 break;
717 code = Code::G1M;
718 break;
720 code = Code::G1N;
721 break;
723 code = Code::G1S;
724 break;
726 code = Code::G1L;
727 break;
729 code = Code::G1X;
730 break;
732 code = Code::G1W;
733 break;
734 default:
735 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
736 skipMeasurement = true;
737 break;
738 }
739 break;
741 frequency = G02;
742 switch (satRaw.chan)
743 {
745 code = Code::G2P;
746 break;
748 code = Code::G2C;
749 break;
751 code = Code::G2D;
752 break;
754 code = Code::G2Y;
755 break;
757 code = Code::G2M;
758 break;
760 code = Code::G2N;
761 break;
763 code = Code::G2S;
764 break;
766 code = Code::G2L;
767 break;
769 code = Code::G2X;
770 break;
772 code = Code::G2W;
773 break;
774 default:
775 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
776 skipMeasurement = true;
777 break;
778 }
779 break;
781 frequency = G05;
782 switch (satRaw.chan)
783 {
785 code = Code::G5I;
786 break;
788 code = Code::G5Q;
789 break;
791 code = Code::G5X;
792 break;
793 default:
794 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
795 skipMeasurement = true;
796 break;
797 }
798 break;
799 default:
800 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq);
801 skipMeasurement = true;
802 break;
803 }
804 break;
805 case SBAS:
806 switch (satRaw.freq)
807 {
809 frequency = S01;
810 switch (satRaw.chan)
811 {
813 code = Code::S1C;
814 break;
815 default:
816 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
817 skipMeasurement = true;
818 break;
819 }
820 break;
822 frequency = S05;
823 switch (satRaw.chan)
824 {
826 code = Code::S5I;
827 break;
829 code = Code::S5Q;
830 break;
832 code = Code::S5X;
833 break;
834 default:
835 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
836 skipMeasurement = true;
837 break;
838 }
839 break;
840 default:
841 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq);
842 skipMeasurement = true;
843 break;
844 }
845 break;
846 case GAL:
847 switch (satRaw.freq)
848 {
850 frequency = E01;
851 switch (satRaw.chan)
852 {
854 code = Code::E1C;
855 break;
857 code = Code::E1A;
858 break;
860 code = Code::E1B;
861 break;
863 code = Code::E1X;
864 break;
866 code = Code::E1Z;
867 break;
868 default:
869 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
870 skipMeasurement = true;
871 break;
872 }
873 break;
875 frequency = E08;
876 switch (satRaw.chan)
877 {
879 code = Code::E8I;
880 break;
882 code = Code::E8Q;
883 break;
885 code = Code::E8X;
886 break;
887 default:
888 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
889 skipMeasurement = true;
890 break;
891 }
892 break;
894 frequency = E06;
895 switch (satRaw.chan)
896 {
898 code = Code::E6B;
899 break;
901 code = Code::E6C;
902 break;
904 code = Code::E6X;
905 break;
906 default:
907 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
908 skipMeasurement = true;
909 break;
910 }
911 break;
913 frequency = E05;
914 switch (satRaw.chan)
915 {
917 code = Code::E5I;
918 break;
920 code = Code::E5Q;
921 break;
923 code = Code::E5X;
924 break;
925 default:
926 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
927 skipMeasurement = true;
928 break;
929 }
930 break;
932 frequency = E07;
933 switch (satRaw.chan)
934 {
936 code = Code::E7I;
937 break;
939 code = Code::E7Q;
940 break;
942 code = Code::E7X;
943 break;
944 default:
945 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
946 skipMeasurement = true;
947 break;
948 }
949 break;
950 default:
951 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq);
952 skipMeasurement = true;
953 break;
954 }
955 break;
956 case BDS:
957 switch (satRaw.freq)
958 {
960 frequency = B01;
961 switch (satRaw.chan)
962 {
964 code = Code::B2I;
965 break;
967 code = Code::B2Q;
968 break;
970 code = Code::B2X;
971 break;
972 default:
973 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
974 skipMeasurement = true;
975 break;
976 }
977 break;
979 frequency = B06;
980 switch (satRaw.chan)
981 {
983 code = Code::B6A;
984 break;
986 code = Code::B6I;
987 break;
989 code = Code::B6Q;
990 break;
992 code = Code::B6X;
993 break;
994 default:
995 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
996 skipMeasurement = true;
997 break;
998 }
999 break;
1001 frequency = B08;
1002 switch (satRaw.chan)
1003 {
1005 code = Code::B7I;
1006 break;
1008 code = Code::B7Q;
1009 break;
1011 code = Code::B7X;
1012 break;
1013 default:
1014 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
1015 skipMeasurement = true;
1016 break;
1017 }
1018 break;
1019 default:
1020 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq);
1021 skipMeasurement = true;
1022 break;
1023 }
1024 break;
1025 case QZSS:
1026 switch (satRaw.freq)
1027 {
1029 frequency = J01;
1030 switch (satRaw.chan)
1031 {
1033 code = Code::J1C;
1034 break;
1036 code = Code::J1S;
1037 break;
1039 code = Code::J1L;
1040 break;
1042 code = Code::J1X;
1043 break;
1044 default:
1045 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
1046 skipMeasurement = true;
1047 break;
1048 }
1049 break;
1051 frequency = J02;
1052 switch (satRaw.chan)
1053 {
1055 code = Code::J2S;
1056 break;
1058 code = Code::J2L;
1059 break;
1061 code = Code::J2X;
1062 break;
1063 default:
1064 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
1065 skipMeasurement = true;
1066 break;
1067 }
1068 break;
1070 frequency = J05;
1071 switch (satRaw.chan)
1072 {
1074 code = Code::J5I;
1075 break;
1077 code = Code::J5Q;
1078 break;
1080 code = Code::J5X;
1081 break;
1082 default:
1083 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
1084 skipMeasurement = true;
1085 break;
1086 }
1087 break;
1089 frequency = J06;
1090 switch (satRaw.chan)
1091 {
1093 code = Code::J6S;
1094 break;
1096 code = Code::J6L;
1097 break;
1099 code = Code::J6X;
1100 break;
1101 default:
1102 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
1103 skipMeasurement = true;
1104 break;
1105 }
1106 break;
1107 default:
1108 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq);
1109 skipMeasurement = true;
1110 break;
1111 }
1112 break;
1113 case GLO:
1114 switch (satRaw.freq)
1115 {
1117 frequency = R01;
1118 switch (satRaw.chan)
1119 {
1121 code = Code::R1C;
1122 break;
1124 code = Code::R1P;
1125 break;
1126 default:
1127 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
1128 skipMeasurement = true;
1129 break;
1130 }
1131 break;
1133 frequency = R02;
1134 switch (satRaw.chan)
1135 {
1137 code = Code::R2C;
1138 break;
1140 code = Code::R2P;
1141 break;
1142 default:
1143 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' channel '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq, satRaw.chan);
1144 skipMeasurement = true;
1145 break;
1146 }
1147 break;
1148 default:
1149 LOG_TRACE("VectorNav SatRawElement satellite system '{}' frequency '{}' is not supported yet. Skipping measurement.", satRaw.sys, satRaw.freq);
1150 skipMeasurement = true;
1151 break;
1152 }
1153 break;
1154 case IRNSS: // IRNSS not in vectorNav
1155 case SatSys_None:
1156 skipMeasurement = true;
1157 break;
1158 }
1159
1160 if (skipMeasurement)
1161 {
1162 continue;
1163 }
1164
1165 (*gnssObs)(SatSigId(code, satRaw.svId)).pseudorange = { .value = satRaw.pr };
1166 (*gnssObs)(SatSigId(code, satRaw.svId)).carrierPhase = { .value = satRaw.cp };
1167 (*gnssObs)(SatSigId(code, satRaw.svId)).doppler = satRaw.dp;
1168 (*gnssObs)(SatSigId(code, satRaw.svId)).CN0 = satRaw.cno;
1169
1170 // LLI has not been implemented yet, but can be calculated from vendor::vectornav::RawMeas::SatRawElement::Flags
1171 // (*gnssObs)[{ frequency, satRaw.svId }].LLI = ...
1172 }
1173 }
1174 }
1175
1176 return gnssObs;
1177}
1178
1180{
1181 switch (value)
1182 {
1184 return "ImuObs";
1186 return "ImuObsWDelta";
1188 return "BaroPressObs";
1190 return "PosVelAtt";
1192 return "GnssObs";
1194 return "";
1195 }
1196 return "";
1197}
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
Manages all Nodes.
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:150
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:410
std::vector< OutputPin > outputPins
List of output pins.
Definition Node.hpp:399
Node(std::string name)
Constructor.
Definition Node.cpp:30
std::string nameId() const
Node name and id.
Definition Node.cpp:253
std::string name
Name of the Node.
Definition Node.hpp:395
void invokeCallbacks(size_t portIndex, const std::shared_ptr< const NodeData > &data)
Calls all registered callbacks on the specified output port.
Definition Node.cpp:180
bool _hasConfig
Flag if the config window should be shown.
Definition Node.hpp:413
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.
OutputPin * CreateOutputPin(Node *node, 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.
InputPin * CreateInputPin(Node *node, 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.
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)