0.4.1
Loading...
Searching...
No Matches
PosVelAttFile.hpp
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/// @file PosVelAttFile.hpp
10/// @brief PosVelAtt File Reader
11/// @author T. Topp (topp@ins.uni-stuttgart.de)
12/// @date 2023-05-23
13
14#pragma once
15
18
19namespace NAV
20{
21/// File Reader for Imu log files
22class PosVelAttFile : public Node, public FileReader
23{
24 public:
25 /// @brief Default constructor
27 /// @brief Destructor
28 ~PosVelAttFile() override;
29 /// @brief Copy constructor
30 PosVelAttFile(const PosVelAttFile&) = delete;
31 /// @brief Move constructor
33 /// @brief Copy assignment operator
35 /// @brief Move assignment operator
37
38 /// @brief String representation of the Class Type
39 [[nodiscard]] static std::string typeStatic();
40
41 /// @brief String representation of the Class Type
42 [[nodiscard]] std::string type() const override;
43
44 /// @brief String representation of the Class Category
45 [[nodiscard]] static std::string category();
46
47 /// @brief ImGui config window which is shown on double click
48 /// @attention Don't forget to set _hasConfig to true in the constructor of the node
49 void guiConfig() override;
50
51 /// @brief Saves the node into a json object
52 [[nodiscard]] json save() const override;
53
54 /// @brief Restores the node from a json object
55 /// @param[in] j Json object with the node state
56 void restore(const json& j) override;
57
58 /// @brief Resets the node. Moves the read cursor to the start
59 bool resetNode() override;
60
61 private:
62 constexpr static size_t OUTPUT_PORT_INDEX_PVA = 0; ///< @brief Flow (PosVelAtt)
63 constexpr static size_t OUTPUT_PORT_INDEX_HEADER_COLUMNS = 1; ///< @brief Object (std::vector<std::string>)
64
65 /// @brief Data included in the file
66 enum class FileContent : uint8_t
67 {
68 Pos, ///< Position only
69 PosVel, ///< Position and Velocity
70 PosVelAtt, ///< Position, Velocity and Attitude
71 };
72
73 /// @brief Initialize the node
74 bool initialize() override;
75
76 /// @brief Deinitialize the node
77 void deinitialize() override;
78
79 /// @brief Polls data from the file
80 /// @return The read observation
81 [[nodiscard]] std::shared_ptr<const NodeData> pollData();
82
83 /// Data included in the file
85};
86
87} // namespace NAV
Abstract File Reader class.
nlohmann::json json
json namespace
Node Class.
FileReader(const FileReader &)=delete
Copy constructor.
Node(std::string name)
Constructor.
Definition Node.cpp:30
void deinitialize() override
Deinitialize the node.
bool resetNode() override
Resets the node. Moves the read cursor to the start.
PosVelAttFile & operator=(const PosVelAttFile &)=delete
Copy assignment operator.
static std::string category()
String representation of the Class Category.
FileContent
Data included in the file.
@ 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.
static constexpr size_t OUTPUT_PORT_INDEX_HEADER_COLUMNS
Object (std::vector<std::string>)
bool initialize() override
Initialize the node.
static constexpr size_t OUTPUT_PORT_INDEX_PVA
Flow (PosVelAtt)
PosVelAttFile(const PosVelAttFile &)=delete
Copy constructor.
~PosVelAttFile() override
Destructor.
PosVelAttFile & operator=(PosVelAttFile &&)=delete
Move assignment operator.
FileContent _fileContent
Data included in the file.
static std::string typeStatic()
String representation of the Class Type.
PosVelAttFile(PosVelAttFile &&)=delete
Move constructor.
PosVelAttFile()
Default constructor.
std::shared_ptr< const NodeData > pollData()
Polls data from the file.