INSTINCT Code Coverage Report


Directory: src/
File: NodeRegistry.cpp
Date: 2025-06-02 15:19:59
Exec Total Coverage
Lines: 152 200 76.0%
Functions: 85 87 97.7%
Branches: 178 562 31.7%

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 "NodeRegistry.hpp"
10
11 #include "util/Logger.hpp"
12
13 #include "internal/Node/Node.hpp"
14 #include "NodeData/NodeData.hpp"
15
16 #include <string>
17
18 /* -------------------------------------------------------------------------------------------------------- */
19 /* Private Members */
20 /* -------------------------------------------------------------------------------------------------------- */
21
22 namespace NAV::NodeRegistry
23 {
24 namespace
25 {
26
27 /// List of all registered nodes.
28 /// Key: category, Value: Nodes
29 std::map<std::string, std::vector<NodeInfo>> _registeredNodes;
30
31 /// List of all registered node data types.
32 /// Key: NodeData.type(), Value: parentTypes()
33 std::map<std::string, std::vector<std::string>> _registeredNodeDataTypes;
34
35 /* -------------------------------------------------------------------------------------------------------- */
36 /* Private Function Declarations */
37 /* -------------------------------------------------------------------------------------------------------- */
38
39 /// @brief Registers a Node with the NodeManager
40 /// @tparam T Node Class to register
41 template<std::derived_from<Node> T>
42 12544 void registerNodeType()
43 {
44 12544 NodeInfo info;
45 12884 info.constructor = []() { return new T(); }; // NOLINT(cppcoreguidelines-owning-memory)
46
1/2
✓ Branch 1 taken 6272 times.
✗ Branch 2 not taken.
12544 info.type = T::typeStatic();
47
48
1/2
✓ Branch 1 taken 6272 times.
✗ Branch 2 not taken.
12544 T obj;
49
2/2
✓ Branch 5 taken 4368 times.
✓ Branch 6 taken 6272 times.
21280 for (const InputPin& pin : obj.inputPins)
50 {
51
1/2
✓ Branch 1 taken 4368 times.
✗ Branch 2 not taken.
8736 info.pinInfoList.emplace_back(pin.kind, pin.type, pin.dataIdentifier);
52 }
53
2/2
✓ Branch 5 taken 6384 times.
✓ Branch 6 taken 6272 times.
25312 for (const OutputPin& pin : obj.outputPins)
54 {
55
1/2
✓ Branch 1 taken 6384 times.
✗ Branch 2 not taken.
12768 info.pinInfoList.emplace_back(pin.kind, pin.type, pin.dataIdentifier);
56 }
57
58
3/6
✓ Branch 1 taken 6272 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 6272 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 6272 times.
✗ Branch 8 not taken.
12544 _registeredNodes[T::category()].push_back(info);
59 12544 }
60
61 /// @brief Register a NodeData with the NodeManager
62 /// @tparam T NodeData Class to register
63 template<std::derived_from<NodeData> T>
64 4928 void registerNodeDataType()
65 {
66
5/8
✓ Branch 1 taken 2352 times.
✓ Branch 2 taken 112 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2352 times.
✓ Branch 5 taken 112 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 2352 times.
✗ Branch 8 not taken.
4928 _registeredNodeDataTypes[T::type()] = T::parentTypes();
67 4928 }
68
69 } // namespace
70 } // namespace NAV::NodeRegistry
71
72 /* -------------------------------------------------------------------------------------------------------- */
73 /* Function Definitions */
74 /* -------------------------------------------------------------------------------------------------------- */
75
76 bool NAV::NodeRegistry::NodeInfo::hasCompatiblePin(const Pin* pin) const
77 {
78 if (pin == nullptr)
79 {
80 return true;
81 }
82
83 Pin::Kind searchPinKind = pin->kind == Pin::Kind::Input ? Pin::Kind::Output : Pin::Kind::Input;
84 for (const auto& pinInfo : this->pinInfoList)
85 {
86 const std::vector<std::string>& startPinDataIdentifier = pin->kind == Pin::Kind::Input ? pinInfo.dataIdentifier : pin->dataIdentifier;
87 const std::vector<std::string>& endPinDataIdentifier = pin->kind == Pin::Kind::Input ? pin->dataIdentifier : pinInfo.dataIdentifier;
88 const std::string& startPinParentNodeType = pin->kind == Pin::Kind::Input ? this->type : pin->parentNode->type();
89
90 if (pinInfo.kind == searchPinKind && pinInfo.type == pin->type)
91 {
92 if ((pinInfo.type == Pin::Type::Flow
93 && NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(startPinDataIdentifier, endPinDataIdentifier))
94 || (pinInfo.type == Pin::Type::Delegate
95 && std::ranges::find(endPinDataIdentifier, startPinParentNodeType) != endPinDataIdentifier.end())
96 || ((pinInfo.type == Pin::Type::Object || pinInfo.type == Pin::Type::Matrix) // NOLINT(misc-redundant-expression) - false positive warning
97 && Pin::dataIdentifierHaveCommon(startPinDataIdentifier, endPinDataIdentifier))
98 || pinInfo.type == Pin::Type::Bool || pinInfo.type == Pin::Type::Int || pinInfo.type == Pin::Type::Float || pinInfo.type == Pin::Type::String)
99 {
100 return true;
101 }
102 }
103 }
104
105 return false;
106 }
107
108 340 const std::map<std::string, std::vector<NAV::NodeRegistry::NodeInfo>>& NAV::NodeRegistry::RegisteredNodes()
109 {
110 340 return _registeredNodes;
111 }
112
113 66333057 bool NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(const std::vector<std::string>& childTypes, const std::vector<std::string>& parentTypes)
114 {
115
2/2
✓ Branch 5 taken 66328412 times.
✓ Branch 6 taken 65695603 times.
132019567 for (const auto& childType : childTypes)
116 {
117
2/2
✓ Branch 5 taken 66333744 times.
✓ Branch 6 taken 65686510 times.
131821906 for (const auto& parentType : parentTypes)
118 {
119
2/2
✓ Branch 1 taken 640069 times.
✓ Branch 2 taken 65693904 times.
66332642 if (childType == parentType)
120 {
121 640201 return true;
122 }
123
2/2
✓ Branch 7 taken 1444089981 times.
✓ Branch 8 taken 65489199 times.
1509591769 for (const auto& [dataType, parentTypes] : _registeredNodeDataTypes)
124 {
125
2/2
✓ Branch 1 taken 65694366 times.
✓ Branch 2 taken 1378202253 times.
1443572654 if (dataType == childType)
126 {
127
2/2
✓ Branch 5 taken 60091895 times.
✓ Branch 6 taken 65695612 times.
125791007 for (const auto& parentTypeOfChild : parentTypes)
128 {
129
9/16
✓ Branch 1 taken 60098465 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 60098788 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 60100369 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 60099110 times.
✓ Branch 11 taken 60097193 times.
✓ Branch 14 taken 60097702 times.
✓ Branch 15 taken 60096773 times.
✓ Branch 17 taken 132 times.
✓ Branch 18 taken 60096641 times.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
360586005 if (NodeDataTypeAnyIsChildOf({ parentTypeOfChild }, { parentType }))
130 {
131 132 return true;
132 }
133 }
134 }
135 }
136 }
137 }
138
139 65695603 return false;
140 120198153 }
141
142 12 std::vector<std::string> NAV::NodeRegistry::GetParentNodeDataTypes(const std::string& type)
143 {
144 12 std::vector<std::string> returnTypes;
145
2/4
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
12 if (_registeredNodeDataTypes.contains(type))
146 {
147
1/2
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
12 const auto& parentTypes = _registeredNodeDataTypes.at(type);
148
149 // Add all the immediate parents
150
2/2
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 4 times.
12 if (!parentTypes.empty())
151 {
152
1/2
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
8 returnTypes.insert(returnTypes.end(), parentTypes.begin(), parentTypes.end());
153 }
154
155 // Add parents of parents
156
2/2
✓ Branch 5 taken 10 times.
✓ Branch 6 taken 12 times.
22 for (const auto& parentType : parentTypes)
157 {
158
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
10 auto parentParentTypes = GetParentNodeDataTypes(parentType);
159
2/2
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 4 times.
10 if (!parentParentTypes.empty())
160 {
161
1/2
✓ Branch 5 taken 6 times.
✗ Branch 6 not taken.
6 returnTypes.insert(returnTypes.end(), parentParentTypes.begin(), parentParentTypes.end());
162 }
163 10 }
164 }
165
166 12 return returnTypes;
167 }
168
169 // Utility
170 #include "Nodes/Utility/Combiner.hpp"
171 #include "Nodes/Utility/Demo.hpp"
172 #include "Nodes/Utility/GroupBox.hpp"
173 #include "Nodes/Utility/Merger.hpp"
174 #include "Nodes/Utility/Terminator.hpp"
175 #include "Nodes/Utility/TimeWindow.hpp"
176 // Converter
177 #include "Nodes/Converter/GNSS/RtklibPosConverter.hpp"
178 #include "Nodes/Converter/GNSS/UartPacketConverter.hpp"
179 #include "Nodes/Converter/GNSS/UbloxGnssObsConverter.hpp"
180 #include "Nodes/Converter/GNSS/UbloxGnssOrbitCollector.hpp"
181 #include "Nodes/Converter/IMU/VectorNavBinaryConverter.hpp"
182 // Data Link
183 #if __linux__ || __APPLE__
184 #include "Nodes/DataLink/mavlinkSend.hpp"
185 #endif
186 #include "Nodes/DataLink/udpSend.hpp"
187 #include "Nodes/DataLink/udpRecv.hpp"
188 // Data Logger
189 #include "Nodes/DataLogger/General/CsvLogger.hpp"
190 #include "Nodes/DataLogger/General/KmlLogger.hpp"
191 #include "Nodes/DataLogger/General/MatrixLogger.hpp"
192 #include "Nodes/DataLogger/GNSS/RinexObsLogger.hpp"
193 #include "Nodes/DataLogger/GNSS/UartDataLogger.hpp"
194 #include "Nodes/DataLogger/IMU/VectorNavDataLogger.hpp"
195 #include "Nodes/DataLogger/WiFi/WiFiObsLogger.hpp"
196 // Data Processor
197 #include "Nodes/DataProcessor/ErrorModel/AllanDeviation.hpp"
198 #include "Nodes/DataProcessor/ErrorModel/ErrorModel.hpp"
199 #include "Nodes/DataProcessor/GNSS/GnssAnalyzer.hpp"
200 #include "Nodes/DataProcessor/GNSS/SinglePointPositioning.hpp"
201 #include "Nodes/DataProcessor/Integrator/ImuIntegrator.hpp"
202 #include "Nodes/DataProcessor/KalmanFilter/LooselyCoupledKF.hpp"
203 #include "Nodes/DataProcessor/SensorCombiner/ImuFusion.hpp"
204 #include "Nodes/DataProcessor/WiFi/WiFiPositioning.hpp"
205 #include "Nodes/DataProcessor/Filter/LowPassFilter.hpp"
206 #include "Nodes/DataProcessor/Barometer/PressToHgt.hpp"
207 // Data Provider
208 #include "Nodes/DataProvider/CSV/CsvFile.hpp"
209 #include "Nodes/DataProvider/GNSS/FileReader/RinexNavFile.hpp"
210 #include "Nodes/DataProvider/GNSS/FileReader/RinexObsFile.hpp"
211 #include "Nodes/DataProvider/GNSS/FileReader/EmlidFile.hpp"
212 #include "Nodes/DataProvider/GNSS/FileReader/RtklibPosFile.hpp"
213 #include "Nodes/DataProvider/GNSS/FileReader/NmeaFile.hpp"
214 #include "Nodes/DataProvider/GNSS/FileReader/UbloxFile.hpp"
215 #include "Nodes/DataProvider/GNSS/Sensors/EmlidSensor.hpp"
216 #include "Nodes/DataProvider/GNSS/Sensors/UbloxSensor.hpp"
217 #include "Nodes/DataProvider/IMU/FileReader/ImuFile.hpp"
218 #include "Nodes/DataProvider/IMU/FileReader/KvhFile.hpp"
219 #include "Nodes/DataProvider/IMU/FileReader/VectorNavFile.hpp"
220 #include "Nodes/DataProvider/IMU/Sensors/KvhSensor.hpp"
221 #include "Nodes/DataProvider/IMU/Sensors/Navio2Sensor.hpp"
222 #include "Nodes/DataProvider/IMU/Sensors/VectorNavSensor.hpp"
223 #include "Nodes/DataProvider/IMU/FileReader/UlogFile.hpp"
224 #include "Nodes/DataProvider/State/PosVelAttFile.hpp"
225 #include "Nodes/DataProvider/IMU/FileReader/MultiImuFile.hpp"
226 #include "Nodes/DataProvider/WiFi/Sensors/EspressifSensor.hpp"
227 #include "Nodes/DataProvider/WiFi/Sensors/ArubaSensor.hpp"
228 #include "Nodes/DataProvider/WiFi/FileReader/WiFiObsFile.hpp"
229 // Data Simulator
230 #include "Nodes/DataProvider/IMU/Simulators/ImuSimulator.hpp"
231 #include "Nodes/DataProvider/Barometer/Simulators/BaroSimulator.hpp"
232 // Plotting
233 #include "Nodes/Plotting/Plot.hpp"
234 // State
235 #include "Nodes/State/PosVelAttInitializer.hpp"
236 // Experimental
237 #include "Nodes/Experimental/DataProcessor/ARMA.hpp"
238 #include "Nodes/Experimental/DataProvider/IMU/NetworkStream/SkydelNetworkStream.hpp"
239 #include "Nodes/Experimental/Simple/Delay.hpp"
240
241 112 void NAV::NodeRegistry::RegisterNodeTypes()
242 {
243 LOG_TRACE("called");
244
245 112 Node::_autostartWorker = false;
246
247 // Utility
248 112 registerNodeType<Combiner>();
249 112 registerNodeType<Demo>();
250 112 registerNodeType<GroupBox>();
251 112 registerNodeType<Merger>();
252 112 registerNodeType<Terminator>();
253 112 registerNodeType<TimeWindow>();
254 // Converter
255 112 registerNodeType<RtklibPosConverter>();
256 112 registerNodeType<UartPacketConverter>();
257 112 registerNodeType<UbloxGnssObsConverter>();
258 112 registerNodeType<UbloxGnssOrbitCollector>();
259 112 registerNodeType<VectorNavBinaryConverter>();
260 // Data Link
261 #if __linux__ || __APPLE__
262 112 registerNodeType<MavlinkSend>();
263 #endif
264 112 registerNodeType<UdpSend>();
265 112 registerNodeType<UdpRecv>();
266 // Data Logger
267 112 registerNodeType<CsvLogger>();
268 112 registerNodeType<KmlLogger>();
269 112 registerNodeType<MatrixLogger>();
270 112 registerNodeType<RinexObsLogger>();
271 112 registerNodeType<UartDataLogger>();
272 112 registerNodeType<VectorNavDataLogger>();
273 112 registerNodeType<WiFiObsLogger>();
274 // Data Processor
275 112 registerNodeType<AllanDeviation>();
276 112 registerNodeType<ErrorModel>();
277 112 registerNodeType<GnssAnalyzer>();
278 112 registerNodeType<SinglePointPositioning>();
279 112 registerNodeType<ImuIntegrator>();
280 112 registerNodeType<LooselyCoupledKF>();
281 112 registerNodeType<LowPassFilter>();
282 112 registerNodeType<PressToHgt>();
283 112 registerNodeType<ImuFusion>();
284 112 registerNodeType<WiFiPositioning>();
285 // Data Provider
286 112 registerNodeType<CsvFile>();
287 112 registerNodeType<RinexNavFile>();
288 112 registerNodeType<RinexObsFile>();
289 112 registerNodeType<EmlidFile>();
290 112 registerNodeType<RtklibPosFile>();
291 112 registerNodeType<NmeaFile>();
292 112 registerNodeType<UbloxFile>();
293 112 registerNodeType<EmlidSensor>();
294 112 registerNodeType<UbloxSensor>();
295 112 registerNodeType<ImuFile>();
296 112 registerNodeType<KvhFile>();
297 112 registerNodeType<VectorNavFile>();
298 112 registerNodeType<KvhSensor>();
299 112 registerNodeType<Navio2Sensor>();
300 112 registerNodeType<VectorNavSensor>();
301 112 registerNodeType<UlogFile>();
302 112 registerNodeType<PosVelAttFile>();
303 112 registerNodeType<MultiImuFile>();
304 112 registerNodeType<EspressifSensor>();
305 112 registerNodeType<ArubaSensor>();
306 112 registerNodeType<WiFiObsFile>();
307 // Data Simulator
308 112 registerNodeType<ImuSimulator>();
309 112 registerNodeType<BaroSimulator>();
310 // Experimental
311 // registerNodeType<NAV::experimental::ARMA>();
312 // registerNodeType<NAV::experimental::SkydelNetworkStream>();
313 // registerNodeType<NAV::experimental::Delay>();
314 // Plotting
315 112 registerNodeType<Plot>();
316 // State
317 112 registerNodeType<PosVelAttInitializer>();
318
319 112 Node::_autostartWorker = true;
320 112 }
321
322 #include "NodeData/General/DynamicData.hpp"
323 #include "NodeData/General/StringObs.hpp"
324 #include "NodeData/GNSS/EmlidObs.hpp"
325 #include "NodeData/GNSS/GnssCombination.hpp"
326 #include "NodeData/GNSS/GnssObs.hpp"
327 #include "NodeData/GNSS/RtklibPosObs.hpp"
328 #include "NodeData/GNSS/SppSolution.hpp"
329 #include "NodeData/GNSS/UbloxObs.hpp"
330 #include "NodeData/IMU/ImuObs.hpp"
331 #include "NodeData/IMU/ImuObsSimulated.hpp"
332 #include "NodeData/IMU/ImuObsWDelta.hpp"
333 #include "NodeData/IMU/KvhObs.hpp"
334 #include "NodeData/IMU/VectorNavBinaryOutput.hpp"
335 #include "NodeData/State/InsGnssLCKFSolution.hpp"
336 #include "NodeData/State/InsGnssTCKFSolution.hpp"
337 #include "NodeData/State/Pos.hpp"
338 #include "NodeData/State/PosVel.hpp"
339 #include "NodeData/State/PosVelAtt.hpp"
340 #include "NodeData/Baro/BaroPressObs.hpp"
341 #include "NodeData/Baro/BaroHgt.hpp"
342
343 #include "NodeData/WiFi/WiFiObs.hpp"
344 #include "NodeData/WiFi/WiFiPositioningSolution.hpp"
345
346 112 void NAV::NodeRegistry::RegisterNodeDataTypes()
347 {
348 112 registerNodeDataType<NodeData>();
349 // General
350 112 registerNodeDataType<DynamicData>();
351 112 registerNodeDataType<StringObs>();
352 // GNSS
353 112 registerNodeDataType<EmlidObs>();
354 112 registerNodeDataType<GnssCombination>();
355 112 registerNodeDataType<GnssObs>();
356 112 registerNodeDataType<RtklibPosObs>();
357 112 registerNodeDataType<SppSolution>();
358 112 registerNodeDataType<UbloxObs>();
359 // IMU
360 112 registerNodeDataType<ImuObs>();
361 112 registerNodeDataType<ImuObsSimulated>();
362 112 registerNodeDataType<ImuObsWDelta>();
363 112 registerNodeDataType<KvhObs>();
364 112 registerNodeDataType<VectorNavBinaryOutput>();
365 // State
366 112 registerNodeDataType<InsGnssLCKFSolution>();
367 112 registerNodeDataType<Pos>();
368 112 registerNodeDataType<PosVel>();
369 112 registerNodeDataType<PosVelAtt>();
370 // WiFi
371 112 registerNodeDataType<WiFiObs>();
372 112 registerNodeDataType<WiFiPositioningSolution>();
373 // Barometer
374 112 registerNodeDataType<BaroPressObs>();
375 112 registerNodeDataType<BaroHgt>();
376 112 }
377
378 581373 std::vector<std::string> NAV::NodeRegistry::GetStaticDataDescriptors(const std::vector<std::string>& dataIdentifier)
379 {
380 // ATTENTION: Entries need to be in correct inheritance order (deepest inheritance first)
381
382 // NodeData
383
6/10
✓ Branch 1 taken 581373 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581373 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581373 times.
✓ Branch 8 taken 581373 times.
✓ Branch 10 taken 1 times.
✓ Branch 11 taken 581372 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744119 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { DynamicData::type() })) { return DynamicData::GetStaticDataDescriptors(); }
384
5/10
✓ Branch 1 taken 581372 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581372 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581372 times.
✓ Branch 8 taken 581372 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 581372 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744116 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { StringObs::type() })) { return StringObs::GetStaticDataDescriptors(); }
385
5/10
✓ Branch 1 taken 581372 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581372 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581372 times.
✓ Branch 8 taken 581372 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 581372 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744116 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { GnssCombination::type() })) { return GnssCombination::GetStaticDataDescriptors(); }
386
5/10
✓ Branch 1 taken 581372 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581372 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581372 times.
✓ Branch 8 taken 581372 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 581372 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744116 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { GnssObs::type() })) { return GnssObs::GetStaticDataDescriptors(); }
387
6/10
✓ Branch 1 taken 581372 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581372 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581372 times.
✓ Branch 8 taken 581372 times.
✓ Branch 10 taken 6 times.
✓ Branch 11 taken 581366 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744116 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { VectorNavBinaryOutput::type() })) { return VectorNavBinaryOutput::GetStaticDataDescriptors(); }
388
5/10
✓ Branch 1 taken 581366 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581366 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581366 times.
✓ Branch 8 taken 581366 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 581366 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744098 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { EmlidObs::type() })) { return EmlidObs::GetStaticDataDescriptors(); }
389
5/10
✓ Branch 1 taken 581366 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581366 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581366 times.
✓ Branch 8 taken 581366 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 581366 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744098 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { UbloxObs::type() })) { return UbloxObs::GetStaticDataDescriptors(); }
390
5/10
✓ Branch 1 taken 581366 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581366 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581366 times.
✓ Branch 8 taken 581366 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 581366 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744098 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { WiFiObs::type() })) { return WiFiObs::GetStaticDataDescriptors(); }
391 // Pos
392
5/10
✓ Branch 1 taken 581366 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581366 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581366 times.
✓ Branch 8 taken 581366 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 581366 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744098 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { InsGnssTCKFSolution::type() })) { return InsGnssTCKFSolution::GetStaticDataDescriptors(); }
393
6/10
✓ Branch 1 taken 581366 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581366 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581366 times.
✓ Branch 8 taken 581366 times.
✓ Branch 10 taken 290676 times.
✓ Branch 11 taken 290690 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744098 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { InsGnssLCKFSolution::type() })) { return InsGnssLCKFSolution::GetStaticDataDescriptors(); }
394
6/10
✓ Branch 1 taken 290690 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 290690 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 290690 times.
✓ Branch 8 taken 290690 times.
✓ Branch 10 taken 290670 times.
✓ Branch 11 taken 20 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
872070 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { PosVelAtt::type() })) { return PosVelAtt::GetStaticDataDescriptors(); }
395
6/10
✓ Branch 1 taken 20 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 20 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 20 times.
✓ Branch 8 taken 20 times.
✓ Branch 10 taken 1 times.
✓ Branch 11 taken 19 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
60 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { SppSolution::type() })) { return SppSolution::GetStaticDataDescriptors(); }
396
6/10
✓ Branch 1 taken 19 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 19 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 19 times.
✓ Branch 8 taken 19 times.
✓ Branch 10 taken 7 times.
✓ Branch 11 taken 12 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
57 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { RtklibPosObs::type() })) { return RtklibPosObs::GetStaticDataDescriptors(); }
397
5/10
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 12 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 12 times.
✓ Branch 8 taken 12 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 12 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
36 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { WiFiPositioningSolution::type() })) { return WiFiPositioningSolution::GetStaticDataDescriptors(); }
398
5/10
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 12 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 12 times.
✓ Branch 8 taken 12 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 12 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
36 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { PosVel::type() })) { return PosVel::GetStaticDataDescriptors(); }
399
5/10
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 12 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 12 times.
✓ Branch 8 taken 12 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 12 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
36 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { Pos::type() })) { return Pos::GetStaticDataDescriptors(); }
400 // ImuObs
401
6/10
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 12 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 12 times.
✓ Branch 8 taken 12 times.
✓ Branch 10 taken 4 times.
✓ Branch 11 taken 8 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
36 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { ImuObsSimulated::type() })) { return ImuObsSimulated::GetStaticDataDescriptors(); }
402
5/10
✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✓ Branch 8 taken 8 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 8 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
24 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { ImuObsWDelta::type() })) { return ImuObsWDelta::GetStaticDataDescriptors(); }
403
5/10
✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✓ Branch 8 taken 8 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 8 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
24 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { KvhObs::type() })) { return KvhObs::GetStaticDataDescriptors(); }
404
5/10
✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✓ Branch 8 taken 8 times.
✓ Branch 10 taken 8 times.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
24 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { ImuObs::type() })) { return ImuObs::GetStaticDataDescriptors(); }
405 // Barometer
406 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { BaroPressObs::type() })) { return BaroPressObs::GetStaticDataDescriptors(); }
407 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { BaroHgt::type() })) { return BaroHgt::GetStaticDataDescriptors(); }
408
409 return {};
410 6104492 }
411
412 69 bool NAV::NodeRegistry::TypeHasDynamicData(const std::string& type)
413 {
414
0/2
✗ Branch 1 not taken.
✗ Branch 2 not taken.
69 return type == DynamicData::type()
415
3/8
✓ Branch 1 taken 68 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 68 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 69 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
137 || type == GnssCombination::type()
416
4/8
✓ Branch 1 taken 68 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 68 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 68 times.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
137 || type == GnssObs::type()
417
5/8
✓ Branch 1 taken 68 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 67 times.
✓ Branch 5 taken 1 times.
✓ Branch 7 taken 68 times.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
137 || type == SppSolution::type()
418
10/14
✓ Branch 1 taken 69 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 68 times.
✓ Branch 5 taken 1 times.
✓ Branch 7 taken 67 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 6 times.
✓ Branch 11 taken 61 times.
✓ Branch 12 taken 67 times.
✓ Branch 13 taken 2 times.
✓ Branch 15 taken 68 times.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
206 || type == VectorNavBinaryOutput::type();
419 }
420
421 std::shared_ptr<NAV::NodeData> NAV::NodeRegistry::CopyNodeData(const std::shared_ptr<const NodeData>& nodeData)
422 {
423 if (nodeData == nullptr) { return nullptr; }
424
425 // General
426 if (nodeData->getType() == DynamicData::type()) { return std::make_shared<DynamicData>(*std::static_pointer_cast<const DynamicData>(nodeData)); }
427 if (nodeData->getType() == StringObs::type()) { return std::make_shared<StringObs>(*std::static_pointer_cast<const StringObs>(nodeData)); }
428 // GNSS
429 if (nodeData->getType() == EmlidObs::type()) { return std::make_shared<EmlidObs>(*std::static_pointer_cast<const EmlidObs>(nodeData)); }
430 if (nodeData->getType() == GnssCombination::type()) { return std::make_shared<GnssCombination>(*std::static_pointer_cast<const GnssCombination>(nodeData)); }
431 if (nodeData->getType() == GnssObs::type()) { return std::make_shared<GnssObs>(*std::static_pointer_cast<const GnssObs>(nodeData)); }
432 if (nodeData->getType() == RtklibPosObs::type()) { return std::make_shared<RtklibPosObs>(*std::static_pointer_cast<const RtklibPosObs>(nodeData)); }
433 if (nodeData->getType() == SppSolution::type()) { return std::make_shared<SppSolution>(*std::static_pointer_cast<const SppSolution>(nodeData)); }
434 if (nodeData->getType() == UbloxObs::type()) { return std::make_shared<UbloxObs>(*std::static_pointer_cast<const UbloxObs>(nodeData)); }
435 // IMU
436 if (nodeData->getType() == ImuObs::type()) { return std::make_shared<ImuObs>(*std::static_pointer_cast<const ImuObs>(nodeData)); }
437 if (nodeData->getType() == ImuObsSimulated::type()) { return std::make_shared<ImuObsSimulated>(*std::static_pointer_cast<const ImuObsSimulated>(nodeData)); }
438 if (nodeData->getType() == ImuObsWDelta::type()) { return std::make_shared<ImuObsWDelta>(*std::static_pointer_cast<const ImuObsWDelta>(nodeData)); }
439 if (nodeData->getType() == KvhObs::type()) { return std::make_shared<KvhObs>(*std::static_pointer_cast<const KvhObs>(nodeData)); }
440 if (nodeData->getType() == VectorNavBinaryOutput::type()) { return std::make_shared<VectorNavBinaryOutput>(*std::static_pointer_cast<const VectorNavBinaryOutput>(nodeData)); }
441 // State
442 if (nodeData->getType() == InsGnssLCKFSolution::type()) { return std::make_shared<InsGnssLCKFSolution>(*std::static_pointer_cast<const InsGnssLCKFSolution>(nodeData)); }
443 if (nodeData->getType() == InsGnssTCKFSolution::type()) { return std::make_shared<InsGnssTCKFSolution>(*std::static_pointer_cast<const InsGnssTCKFSolution>(nodeData)); }
444 if (nodeData->getType() == Pos::type()) { return std::make_shared<Pos>(*std::static_pointer_cast<const Pos>(nodeData)); }
445 if (nodeData->getType() == PosVel::type()) { return std::make_shared<PosVel>(*std::static_pointer_cast<const PosVel>(nodeData)); }
446 if (nodeData->getType() == PosVelAtt::type()) { return std::make_shared<PosVelAtt>(*std::static_pointer_cast<const PosVelAtt>(nodeData)); }
447 // WiFi
448 if (nodeData->getType() == WiFiObs::type()) { return std::make_shared<WiFiObs>(*std::static_pointer_cast<const WiFiObs>(nodeData)); }
449 if (nodeData->getType() == WiFiPositioningSolution::type()) { return std::make_shared<WiFiPositioningSolution>(*std::static_pointer_cast<const WiFiPositioningSolution>(nodeData)); }
450 // Barometer
451 if (nodeData->getType() == BaroPressObs::type()) { return std::make_shared<BaroPressObs>(*std::static_pointer_cast<const BaroPressObs>(nodeData)); }
452 if (nodeData->getType() == BaroHgt::type()) { return std::make_shared<BaroHgt>(*std::static_pointer_cast<const BaroHgt>(nodeData)); }
453
454 return nullptr;
455 }
456