INSTINCT Code Coverage Report


Directory: src/
File: Nodes/Converter/GNSS/RtklibPosConverter.cpp
Date: 2025-11-25 23:34:18
Exec Total Coverage
Lines: 12 24 50.0%
Functions: 4 7 57.1%
Branches: 12 34 35.3%

Line Branch Exec Source
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
9 #include "RtklibPosConverter.hpp"
10
11 #include "util/Logger.hpp"
12
13 #include "internal/FlowManager.hpp"
14
15 #include "NodeData/State/PosVel.hpp"
16 #include "NodeData/GNSS/RtklibPosObs.hpp"
17
18 114 NAV::RtklibPosConverter::RtklibPosConverter()
19
2/4
✓ Branch 1 taken 114 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 114 times.
✗ Branch 5 not taken.
114 : Node(typeStatic())
20 {
21 LOG_TRACE("{}: called", name);
22 114 _hasConfig = false;
23
24
4/8
✓ Branch 2 taken 114 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 114 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 114 times.
✓ Branch 10 taken 114 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
456 CreateOutputPin("PosVel", Pin::Type::Flow, { NAV::PosVel::type() });
25
26
4/8
✓ Branch 1 taken 114 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 114 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 114 times.
✓ Branch 9 taken 114 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
342 CreateInputPin("RtklibPosObs", Pin::Type::Flow, { NAV::RtklibPosObs::type() }, &RtklibPosConverter::receiveObs);
27 342 }
28
29 228 NAV::RtklibPosConverter::~RtklibPosConverter()
30 {
31 LOG_TRACE("{}: called", nameId());
32 228 }
33
34 228 std::string NAV::RtklibPosConverter::typeStatic()
35 {
36
1/2
✓ Branch 1 taken 228 times.
✗ Branch 2 not taken.
456 return "RtklibPosConverter";
37 }
38
39 std::string NAV::RtklibPosConverter::type() const
40 {
41 return typeStatic();
42 }
43
44 114 std::string NAV::RtklibPosConverter::category()
45 {
46
1/2
✓ Branch 1 taken 114 times.
✗ Branch 2 not taken.
228 return "Converter";
47 }
48
49 bool NAV::RtklibPosConverter::initialize()
50 {
51 LOG_TRACE("{}: called", nameId());
52
53 return true;
54 }
55
56 void NAV::RtklibPosConverter::receiveObs(NAV::InputPin::NodeDataQueue& queue, size_t /* pinIdx */)
57 {
58 auto rtklibPosObs = std::static_pointer_cast<const RtklibPosObs>(queue.extract_front());
59
60 auto posVelObs = std::make_shared<PosVel>();
61
62 posVelObs->insTime = rtklibPosObs->insTime;
63 posVelObs->setPosition_e(rtklibPosObs->e_position());
64 posVelObs->setVelocity_e(rtklibPosObs->e_velocity());
65
66 invokeCallbacks(OUTPUT_PORT_INDEX_POSVEL, posVelObs);
67 }
68