0.5.1
Loading...
Searching...
No Matches
PosVelAttFile.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
9#include "PosVelAttFile.hpp"
10
11#include "util/Logger.hpp"
12#include "util/StringUtil.hpp"
13
16
17#include <Eigen/src/Core/DiagonalMatrix.h>
19
21
23 : Node(typeStatic())
24{
25 LOG_TRACE("{}: called", name);
26
27 _hasConfig = true;
28 _guiConfigDefaultWindowSize = { 488, 248 };
29
31 CreateOutputPin("Header Columns", Pin::Type::Object, { "std::vector<std::string>" }, &_headerColumns);
32}
33
38
40{
41 return "PosVelAttFile";
42}
43
44std::string NAV::PosVelAttFile::type() const
45{
46 return typeStatic();
47}
48
50{
51 return "Data Provider";
52}
53
55{
56 if (auto res = FileReader::guiConfig(".csv,.*", { ".csv" }, size_t(id), nameId()))
57 {
58 LOG_DEBUG("{}: Path changed to {}", nameId(), _path);
60 if (res == FileReader::PATH_CHANGED)
61 {
63 }
64 else
65 {
67 }
68 }
69
70 // Header info
71 if (ImGui::BeginTable(fmt::format("##PvaHeaders ({})", id.AsPointer()).c_str(), 4,
72 ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg))
73 {
74 ImGui::TableSetupColumn("Time", ImGuiTableColumnFlags_WidthFixed);
75 ImGui::TableSetupColumn("Position", ImGuiTableColumnFlags_WidthFixed);
76 ImGui::TableSetupColumn("Velocity", ImGuiTableColumnFlags_WidthFixed);
77 ImGui::TableSetupColumn("Attitude", ImGuiTableColumnFlags_WidthFixed);
78 ImGui::TableHeadersRow();
79
80 auto TextColoredIfExists = [this](int index, const std::vector<const char*>& searchTexts) {
81 ImGui::TableSetColumnIndex(index);
82 for (const auto& text : searchTexts)
83 {
84 if (std::ranges::find(_headerColumns, text) != _headerColumns.end())
85 {
86 ImGui::TextUnformatted(text);
87 return;
88 }
89 }
90
91 ImGui::TextDisabled("%s", searchTexts.front());
92 };
93
94 ImGui::TableNextRow();
95 TextColoredIfExists(0, { "GpsCycle" });
96 TextColoredIfExists(1, { "X-ECEF [m]", "Pos ECEF X [m]" });
97 TextColoredIfExists(2, { "X velocity ECEF [m/s]", "Vel ECEF X [m/s]" });
98 TextColoredIfExists(3, { "n_Quat_b w" });
99 ImGui::TableNextRow();
100 TextColoredIfExists(0, { "GpsWeek" });
101 TextColoredIfExists(1, { "Y-ECEF [m]", "Pos ECEF Y [m]" });
102 TextColoredIfExists(2, { "Y velocity ECEF [m/s]", "Vel ECEF Y [m/s]" });
103 TextColoredIfExists(3, { "n_Quat_b x" });
104 ImGui::TableNextRow();
105 TextColoredIfExists(0, { "GpsToW [s]" });
106 TextColoredIfExists(1, { "Z-ECEF [m]", "Pos ECEF Z [m]" });
107 TextColoredIfExists(2, { "Z velocity ECEF [m/s]", "Vel ECEF Z [m/s]" });
108 TextColoredIfExists(3, { "n_Quat_b y" });
109 ImGui::TableNextRow();
110 TextColoredIfExists(1, { "Latitude [deg]" });
111 TextColoredIfExists(2, { "North velocity [m/s]", "Vel N [m/s]" });
112 TextColoredIfExists(3, { "n_Quat_b z" });
113 ImGui::TableNextRow();
114 TextColoredIfExists(1, { "Longitude [deg]" });
115 TextColoredIfExists(2, { "East velocity [m/s]", "Vel E [m/s]" });
116 TextColoredIfExists(3, { "Roll [deg]" });
117 ImGui::TableNextRow();
118 TextColoredIfExists(1, { "Altitude [m]" });
119 TextColoredIfExists(2, { "Down velocity [m/s]", "Vel D [m/s]" });
120 TextColoredIfExists(3, { "Pitch [deg]" });
121 ImGui::TableNextRow();
122 TextColoredIfExists(3, { "Yaw [deg]" });
123
124 ImGui::EndTable();
125 }
126}
127
128[[nodiscard]] json NAV::PosVelAttFile::save() const
129{
130 LOG_TRACE("{}: called", nameId());
131
132 json j;
133
134 j["FileReader"] = FileReader::save();
135 j["pinType"] = outputPins[OUTPUT_PORT_INDEX_PVA].dataIdentifier;
136
137 return j;
138}
139
141{
142 LOG_TRACE("{}: called", nameId());
143
144 if (j.contains("FileReader"))
145 {
146 FileReader::restore(j.at("FileReader"));
147 }
148 if (j.contains("pinType"))
149 {
150 j.at("pinType").get_to(outputPins[OUTPUT_PORT_INDEX_PVA].dataIdentifier);
151 }
152}
153
155{
156 LOG_TRACE("{}: called", nameId());
157
159 {
160 for (auto& col : _headerColumns)
161 {
162 str::replace(col, "GpsTow [s]", "GpsToW [s]");
163 }
164
165 auto hasCol = [&](const char* text) {
166 return std::ranges::find(_headerColumns, text) != _headerColumns.end();
167 };
168
169 if (!hasCol("GpsCycle") || !hasCol("GpsWeek") || !hasCol("GpsToW [s]"))
170 {
171 LOG_ERROR("{}: A PosVelAtt File needs a time. Please add columns 'GpsCycle', 'GpsWeek' and 'GpsToW [s]'.", nameId());
172 return false;
173 }
174 if (!((hasCol("X-ECEF [m]") || hasCol("Pos ECEF X [m]"))
175 && (hasCol("Y-ECEF [m]") || hasCol("Pos ECEF Y [m]"))
176 && (hasCol("Z-ECEF [m]") || hasCol("Pos ECEF Z [m]")))
177 && !(hasCol("Latitude [deg]") && hasCol("Longitude [deg]") && hasCol("Altitude [m]")))
178 {
179 LOG_ERROR("{}: A PosVelAtt File needs a position. Please provide"
180 " either 'X-ECEF [m]', 'Y-ECEF [m]', 'Z-ECEF [m]'"
181 " or 'Latitude [deg]', 'Longitude [deg]', 'Altitude [m]'.",
182 nameId());
183 return false;
184 }
186 outputPins[OUTPUT_PORT_INDEX_PVA].dataIdentifier = std::vector{ Pos::type() };
187
188 if (((hasCol("X velocity ECEF [m/s]") || hasCol("Vel ECEF X [m/s]"))
189 && (hasCol("Y velocity ECEF [m/s]") || hasCol("Vel ECEF Y [m/s]"))
190 && (hasCol("Z velocity ECEF [m/s]") || hasCol("Vel ECEF Z [m/s]")))
191 || ((hasCol("North velocity [m/s]") || hasCol("Vel N [m/s]"))
192 && (hasCol("East velocity [m/s]") || hasCol("Vel E [m/s]"))
193 && (hasCol("Down velocity [m/s]") || hasCol("Vel D [m/s]"))))
194 {
196 outputPins[OUTPUT_PORT_INDEX_PVA].dataIdentifier = std::vector{ PosVel::type() };
197
198 if ((hasCol("n_Quat_b w") && hasCol("n_Quat_b x") && hasCol("n_Quat_b y") && hasCol("n_Quat_b z"))
199 || (hasCol("Roll [deg]") && hasCol("Pitch [deg]") && hasCol("Yaw [deg]")))
200 {
202 outputPins[OUTPUT_PORT_INDEX_PVA].dataIdentifier = std::vector{ PosVelAtt::type() };
203 }
204 }
205
206 for (auto& link : outputPins[OUTPUT_PORT_INDEX_PVA].links)
207 {
208 if (auto* pin = link.getConnectedPin())
209 {
210 outputPins[OUTPUT_PORT_INDEX_PVA].recreateLink(*pin);
211 }
212 }
213
214 return true;
215 }
216
218 return false;
219}
220
222{
223 LOG_TRACE("{}: called", nameId());
224
226}
227
229{
231
232 return true;
233}
234
235std::shared_ptr<const NAV::NodeData> NAV::PosVelAttFile::pollData()
236{
237 std::shared_ptr<Pos> obs;
238 switch (_fileContent)
239 {
240 case FileContent::Pos:
241 obs = std::make_shared<Pos>();
242 break;
244 obs = std::make_shared<PosVel>();
245 break;
247 obs = std::make_shared<PosVelAtt>();
248 break;
249 }
250
251 // Read line
252 std::string line;
253 getline(line);
254 // Remove any starting non text characters
255 line.erase(line.begin(), std::ranges::find_if(line, [](int ch) { return std::isgraph(ch); }));
256
257 if (line.empty())
258 {
259 return nullptr;
260 }
261
262 // Convert line into stream
263 std::stringstream lineStream(line);
264 std::string cell;
265
266 std::optional<uint16_t> gpsCycle = 0;
267 std::optional<uint16_t> gpsWeek;
268 std::optional<long double> gpsToW;
269 std::optional<double> e_position_x;
270 std::optional<double> e_position_y;
271 std::optional<double> e_position_z;
272 std::optional<double> e_positionStdDev_x;
273 std::optional<double> e_positionStdDev_y;
274 std::optional<double> e_positionStdDev_z;
275 std::optional<double> lla_position_x;
276 std::optional<double> lla_position_y;
277 std::optional<double> lla_position_z;
278 std::optional<double> n_positionStdDev_n;
279 std::optional<double> n_positionStdDev_e;
280 std::optional<double> n_positionStdDev_d;
281 std::optional<double> e_velocity_x;
282 std::optional<double> e_velocity_y;
283 std::optional<double> e_velocity_z;
284 std::optional<double> e_velocityStdDev_x;
285 std::optional<double> e_velocityStdDev_y;
286 std::optional<double> e_velocityStdDev_z;
287 std::optional<double> n_velocity_n;
288 std::optional<double> n_velocity_e;
289 std::optional<double> n_velocity_d;
290 std::optional<double> n_velocityStdDev_n;
291 std::optional<double> n_velocityStdDev_e;
292 std::optional<double> n_velocityStdDev_d;
293 std::optional<double> n_Quat_b_w;
294 std::optional<double> n_Quat_b_x;
295 std::optional<double> n_Quat_b_y;
296 std::optional<double> n_Quat_b_z;
297 std::optional<double> roll;
298 std::optional<double> pitch;
299 std::optional<double> yaw;
300
301 // Split line at comma
302 for (const auto& column : _headerColumns)
303 {
304 if (std::getline(lineStream, cell, ','))
305 {
306 // Remove any trailing non text characters
307 cell.erase(std::ranges::find_if(cell, [](int ch) { return std::iscntrl(ch); }), cell.end());
308 if (cell.empty())
309 {
310 continue;
311 }
312
313 if (column == "GpsCycle") { gpsCycle = static_cast<uint16_t>(std::stoul(cell)); }
314 else if (column == "GpsWeek") { gpsWeek = static_cast<uint16_t>(std::stoul(cell)); }
315 else if (column == "GpsToW [s]") { gpsToW = std::stold(cell); }
316
317 else if (column == "X-ECEF [m]" || column == "Pos ECEF X [m]") { e_position_x = std::stod(cell); }
318 else if (column == "Y-ECEF [m]" || column == "Pos ECEF Y [m]") { e_position_y = std::stod(cell); }
319 else if (column == "Z-ECEF [m]" || column == "Pos ECEF Z [m]") { e_position_z = std::stod(cell); }
320 else if (column == "X-ECEF StDev [m]") { e_positionStdDev_x = std::stod(cell); }
321 else if (column == "Y-ECEF StDev [m]") { e_positionStdDev_y = std::stod(cell); }
322 else if (column == "Z-ECEF StDev [m]") { e_positionStdDev_z = std::stod(cell); }
323
324 else if (column == "Latitude [deg]") { lla_position_x = deg2rad(std::stod(cell)); }
325 else if (column == "Longitude [deg]") { lla_position_y = deg2rad(std::stod(cell)); }
326 else if (column == "Altitude [m]") { lla_position_z = std::stod(cell); }
327 else if (column == "North StDev [m]") { n_positionStdDev_n = deg2rad(std::stod(cell)); }
328 else if (column == "East StDev [m]") { n_positionStdDev_e = deg2rad(std::stod(cell)); }
329 else if (column == "Down StDev [m]") { n_positionStdDev_d = std::stod(cell); }
330
331 else if (column == "X velocity ECEF [m/s]" || column == "Vel ECEF X [m/s]") { e_velocity_x = std::stod(cell); }
332 else if (column == "Y velocity ECEF [m/s]" || column == "Vel ECEF Y [m/s]") { e_velocity_y = std::stod(cell); }
333 else if (column == "Z velocity ECEF [m/s]" || column == "Vel ECEF Z [m/s]") { e_velocity_z = std::stod(cell); }
334 else if (column == "X velocity ECEF StdDev [m/s]") { e_velocityStdDev_x = std::stod(cell); }
335 else if (column == "Y velocity ECEF StdDev [m/s]") { e_velocityStdDev_y = std::stod(cell); }
336 else if (column == "Z velocity ECEF StdDev [m/s]") { e_velocityStdDev_z = std::stod(cell); }
337
338 else if (column == "North velocity [m/s]" || column == "Vel N [m/s]") { n_velocity_n = std::stod(cell); }
339 else if (column == "East velocity [m/s]" || column == "Vel E [m/s]") { n_velocity_e = std::stod(cell); }
340 else if (column == "Down velocity [m/s]" || column == "Vel D [m/s]") { n_velocity_d = std::stod(cell); }
341 else if (column == "North velocity StDev [m/s]") { n_velocityStdDev_n = std::stod(cell); }
342 else if (column == "East velocity StDev [m/s]") { n_velocityStdDev_e = std::stod(cell); }
343 else if (column == "Down velocity StDev [m/s]") { n_velocityStdDev_d = std::stod(cell); }
344
345 else if (column == "n_Quat_b w") { n_Quat_b_w = std::stod(cell); }
346 else if (column == "n_Quat_b x") { n_Quat_b_x = std::stod(cell); }
347 else if (column == "n_Quat_b y") { n_Quat_b_y = std::stod(cell); }
348 else if (column == "n_Quat_b z") { n_Quat_b_z = std::stod(cell); }
349
350 else if (column == "Roll [deg]") { roll = deg2rad(std::stod(cell)); }
351 else if (column == "Pitch [deg]") { pitch = deg2rad(std::stod(cell)); }
352 else if (column == "Yaw [deg]") { yaw = deg2rad(std::stod(cell)); }
353 }
354 }
355
356 if (gpsCycle.has_value() && gpsWeek.has_value() && gpsToW.has_value())
357 {
358 obs->insTime = InsTime(gpsCycle.value(), gpsWeek.value(), gpsToW.value());
359 }
360 else
361 {
362 LOG_WARN("{}: A PosVelAtt File needs a time.", nameId());
363 return nullptr;
364 }
365
367 {
368 if (e_velocity_x.has_value() && e_velocity_y.has_value() && e_velocity_z.has_value())
369 {
370 auto lla_pos = lla_position_x.has_value() && lla_position_y.has_value() && lla_position_z.has_value()
371 ? Eigen::Vector3d(*lla_position_x, *lla_position_y, *lla_position_z)
372 : trafo::ecef2lla_WGS84(Eigen::Vector3d(*e_position_x, *e_position_y, *e_position_z));
373 auto n_vel = trafo::n_Quat_e(lla_pos.x(), lla_pos.y()) * Eigen::Vector3d(*e_velocity_x, *e_velocity_y, *e_velocity_z);
374 n_velocity_n = n_vel.x();
375 n_velocity_e = n_vel.y();
376 n_velocity_d = n_vel.z();
377 }
378 else if (n_velocity_n.has_value() && n_velocity_e.has_value() && n_velocity_d.has_value())
379 {
380 auto lla_pos = lla_position_x.has_value() && lla_position_y.has_value() && lla_position_z.has_value()
381 ? Eigen::Vector3d(*lla_position_x, *lla_position_y, *lla_position_z)
382 : trafo::ecef2lla_WGS84(Eigen::Vector3d(*e_position_x, *e_position_y, *e_position_z));
383 auto e_vel = trafo::e_Quat_n(lla_pos.x(), lla_pos.y()) * Eigen::Vector3d(*e_velocity_x, *e_velocity_y, *e_velocity_z);
384 e_velocity_x = e_vel.x();
385 e_velocity_y = e_vel.y();
386 e_velocity_z = e_vel.z();
387 }
388
389 if (e_position_x.has_value() && e_position_y.has_value() && e_position_z.has_value()
390 && e_velocity_x.has_value() && e_velocity_y.has_value() && e_velocity_z.has_value())
391 {
392 if (auto posVel = std::reinterpret_pointer_cast<PosVel>(obs))
393 {
394 if (e_positionStdDev_x.has_value() && e_positionStdDev_y.has_value() && e_positionStdDev_z.has_value()
395 && e_velocityStdDev_x.has_value() && e_velocityStdDev_y.has_value() && e_velocityStdDev_z.has_value())
396 {
397 ;
398 posVel->setPosVelAndCov_e(Eigen::Vector3d{ e_position_x.value(), e_position_y.value(), e_position_z.value() },
399 Eigen::Vector3d{ e_velocity_x.value(), e_velocity_y.value(), e_velocity_z.value() },
400 (Eigen::Vector6d() << e_positionStdDev_x.value(), e_positionStdDev_y.value(), e_positionStdDev_z.value(),
401 e_velocityStdDev_x.value(), e_velocityStdDev_y.value(), e_velocityStdDev_z.value())
402 .finished()
403 .asDiagonal()
404 .toDenseMatrix());
405 }
406 else
407 {
408 posVel->setPosition_e(Eigen::Vector3d{ e_position_x.value(), e_position_y.value(), e_position_z.value() });
409 posVel->setVelocity_e(Eigen::Vector3d{ e_velocity_x.value(), e_velocity_y.value(), e_velocity_z.value() });
410 }
411 }
412 }
413 else if (lla_position_x.has_value() && lla_position_y.has_value() && lla_position_z.has_value()
414 && n_velocity_n.has_value() && n_velocity_e.has_value() && n_velocity_d.has_value())
415 {
416 if (auto posVel = std::reinterpret_pointer_cast<PosVel>(obs))
417 {
418 if (n_positionStdDev_n.has_value() && n_positionStdDev_e.has_value() && n_positionStdDev_d.has_value()
419 && n_velocityStdDev_n.has_value() && n_velocityStdDev_e.has_value() && n_velocityStdDev_d.has_value())
420 {
421 posVel->setPosVelAndCov_n(Eigen::Vector3d{ lla_position_x.value(), lla_position_y.value(), lla_position_z.value() },
422 Eigen::Vector3d{ n_velocity_n.value(), n_velocity_e.value(), n_velocity_d.value() },
423 (Eigen::Vector6d() << n_positionStdDev_n.value(), n_positionStdDev_e.value(), n_positionStdDev_d.value(),
424 n_velocityStdDev_n.value(), n_velocityStdDev_e.value(), n_velocityStdDev_d.value())
425 .finished()
426 .asDiagonal()
427 .toDenseMatrix());
428 }
429 else
430 {
431 posVel->setPosition_lla(Eigen::Vector3d{ lla_position_x.value(), lla_position_y.value(), lla_position_z.value() });
432 posVel->setVelocity_n(Eigen::Vector3d{ n_velocity_n.value(), n_velocity_e.value(), n_velocity_d.value() });
433 }
434 }
435 }
436 else
437 {
438 LOG_WARN("{}: A PosVel/PosVelAtt file needs a position and velocity.", nameId());
439 return nullptr;
440 }
441 }
442 else if (_fileContent == FileContent::Pos)
443 {
444 if (e_position_x.has_value() && e_position_y.has_value() && e_position_z.has_value())
445 {
446 if (e_positionStdDev_x.has_value() && e_positionStdDev_y.has_value() && e_positionStdDev_z.has_value())
447 {
448 obs->setPositionAndCov_e(Eigen::Vector3d{ e_position_x.value(), e_position_y.value(), e_position_z.value() },
449 Eigen::DiagonalMatrix<double, 3>{ e_positionStdDev_x.value(), e_positionStdDev_y.value(), e_positionStdDev_z.value() }.toDenseMatrix());
450 }
451 else
452 {
453 obs->setPosition_e(Eigen::Vector3d{ e_position_x.value(), e_position_y.value(), e_position_z.value() });
454 }
455 }
456 else if (lla_position_x.has_value() && lla_position_y.has_value() && lla_position_z.has_value())
457 {
458 if (n_positionStdDev_n.has_value() && n_positionStdDev_e.has_value() && n_positionStdDev_d.has_value())
459 {
460 obs->setPositionAndCov_n(Eigen::Vector3d{ lla_position_x.value(), lla_position_y.value(), lla_position_z.value() },
461 Eigen::DiagonalMatrix<double, 3>{ n_positionStdDev_n.value(), n_positionStdDev_e.value(), n_positionStdDev_d.value() }.toDenseMatrix());
462 }
463 else
464 {
465 obs->setPosition_lla(Eigen::Vector3d{ lla_position_x.value(), lla_position_y.value(), lla_position_z.value() });
466 }
467 }
468 else
469 {
470 LOG_WARN("{}: A Pos file needs a position.", nameId());
471 return nullptr;
472 }
473 }
474
476 {
477 if (n_Quat_b_w.has_value() && n_Quat_b_x.has_value() && n_Quat_b_y.has_value() && n_Quat_b_z.has_value())
478 {
479 if (auto posVelAtt = std::reinterpret_pointer_cast<PosVelAtt>(obs))
480 {
481 posVelAtt->setAttitude_n_Quat_b(Eigen::Quaterniond{ n_Quat_b_w.value(), n_Quat_b_x.value(), n_Quat_b_y.value(), n_Quat_b_z.value() });
482 }
483 }
484 else if (roll.has_value() && pitch.has_value() && yaw.has_value())
485 {
486 if (auto posVelAtt = std::reinterpret_pointer_cast<PosVelAtt>(obs))
487 {
488 posVelAtt->setAttitude_n_Quat_b(trafo::n_Quat_b(roll.value(), pitch.value(), yaw.value()));
489 }
490 }
491 }
492
494 return obs;
495}
Transformation collection.
Save/Load the Nodes.
nlohmann::json json
json namespace
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_WARN
Error occurred, but a fallback option exists and program continues to work normally.
Definition Logger.hpp:71
#define LOG_TRACE
Detailled info to trace the execution of the program. Should not be called on functions which receive...
Definition Logger.hpp:65
PosVelAtt File Reader.
Position, Velocity and Attitude Storage Class.
Utility functions for working with std::strings.
bool initialize()
Initialize the file reader.
void restore(const json &j)
Restores the node from a json object.
std::string _path
Path to the file.
@ PATH_CHANGED
The path changed and exists.
std::vector< std::string > _headerColumns
Header Columns of a CSV file.
GuiResult guiConfig(const char *vFilters, const std::vector< std::string > &extensions, size_t id, const std::string &nameId)
ImGui config.
void resetReader()
Moves the read cursor to the start.
auto & getline(std::string &str)
Reads a line from the filestream.
json save() const
Saves the node into a json object.
void deinitialize()
Deinitialize the file reader.
The class is responsible for all time-related tasks.
Definition InsTime.hpp:710
bool doDeinitialize(bool wait=false)
Asks the node worker to deinitialize the node.
Definition Node.cpp:465
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
bool doReinitialize(bool wait=false)
Asks the node worker to reinitialize the node.
Definition Node.cpp:420
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
void deinitialize() override
Deinitialize the node.
bool resetNode() override
Resets the node. Moves the read cursor to the start.
static std::string category()
String representation of the Class Category.
@ PosVel
Position and Velocity.
@ PosVelAtt
Position, Velocity and Attitude.
void guiConfig() override
ImGui config window which is shown on double click.
json save() const override
Saves the node into a json object.
void restore(const json &j) override
Restores the node from a json object.
std::string type() const override
String representation of the Class Type.
bool initialize() override
Initialize the node.
static constexpr size_t OUTPUT_PORT_INDEX_PVA
Flow (PosVelAtt)
~PosVelAttFile() override
Destructor.
FileContent _fileContent
Data included in the file.
static std::string typeStatic()
String representation of the Class Type.
PosVelAttFile()
Default constructor.
std::shared_ptr< const NodeData > pollData()
Polls data from the file.
static std::string type()
Returns the type of the data class.
Definition PosVelAtt.hpp:29
static std::string type()
Returns the type of the data class.
Definition PosVel.hpp:27
static std::string type()
Returns the type of the data class.
Definition Pos.hpp:36
Matrix< double, 6, 1 > Vector6d
Double 6x1 Eigen::Vector.
Definition Eigen.hpp:32
void ApplyChanges()
Signals that there have been changes to the flow.
static bool replace(std::string &str, const std::string &from, const std::string &to, CaseSensitivity cs=RespectCase)
Replaces the first occurrence of a search pattern with another sequence.
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 > e_Quat_n(const Scalar &latitude, const Scalar &longitude)
Quaternion for rotations from navigation to Earth-fixed frame.
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.
constexpr auto deg2rad(const T &deg)
Convert Degree to Radians.
Definition Units.hpp:21
@ Flow
NodeData Trigger.
Definition Pin.hpp:52
@ Object
Generic Object.
Definition Pin.hpp:57