0.4.1
Loading...
Searching...
No Matches
ImuFile.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 ImuFile.hpp
10/// @brief File Reader for Imu log files
11/// @author T. Topp (topp@ins.uni-stuttgart.de)
12/// @date 2020-03-16
13
14#pragma once
15
18
19namespace NAV
20{
21/// File Reader for Imu log files
22class ImuFile : public Imu, public FileReader
23{
24 public:
25 /// @brief Default constructor
26 ImuFile();
27 /// @brief Destructor
28 ~ImuFile() override;
29 /// @brief Copy constructor
30 ImuFile(const ImuFile&) = delete;
31 /// @brief Move constructor
32 ImuFile(ImuFile&&) = delete;
33 /// @brief Copy assignment operator
34 ImuFile& operator=(const ImuFile&) = delete;
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_IMU_OBS = 0; ///< @brief Flow (ImuObs)
63 constexpr static size_t OUTPUT_PORT_INDEX_HEADER_COLUMNS = 1; ///< @brief Object (std::vector<std::string>)
64
65 bool _withDelta = false; ///< Flag if the header has delta values
66
67 /// @brief Initialize the node
68 bool initialize() override;
69
70 /// @brief Deinitialize the node
71 void deinitialize() override;
72
73 /// @brief Polls data from the file
74 /// @return The read observation
75 [[nodiscard]] std::shared_ptr<const NodeData> pollData();
76};
77
78} // namespace NAV
Abstract File Reader class.
nlohmann::json json
json namespace
Abstract IMU Class.
FileReader(const FileReader &)=delete
Copy constructor.
ImuFile & operator=(ImuFile &&)=delete
Move assignment operator.
void restore(const json &j) override
Restores the node from a json object.
Definition ImuFile.cpp:129
ImuFile(ImuFile &&)=delete
Move constructor.
ImuFile(const ImuFile &)=delete
Copy constructor.
void deinitialize() override
Deinitialize the node.
Definition ImuFile.cpp:184
std::string type() const override
String representation of the Class Type.
Definition ImuFile.cpp:45
void guiConfig() override
ImGui config window which is shown on double click.
Definition ImuFile.cpp:55
static std::string category()
String representation of the Class Category.
Definition ImuFile.cpp:50
bool resetNode() override
Resets the node. Moves the read cursor to the start.
Definition ImuFile.cpp:191
std::shared_ptr< const NodeData > pollData()
Polls data from the file.
Definition ImuFile.cpp:198
json save() const override
Saves the node into a json object.
Definition ImuFile.cpp:117
static constexpr size_t OUTPUT_PORT_INDEX_IMU_OBS
Flow (ImuObs)
Definition ImuFile.hpp:62
bool initialize() override
Initialize the node.
Definition ImuFile.cpp:143
~ImuFile() override
Destructor.
Definition ImuFile.cpp:35
static std::string typeStatic()
String representation of the Class Type.
Definition ImuFile.cpp:40
ImuFile & operator=(const ImuFile &)=delete
Copy assignment operator.
static constexpr size_t OUTPUT_PORT_INDEX_HEADER_COLUMNS
Object (std::vector<std::string>)
Definition ImuFile.hpp:63
ImuFile()
Default constructor.
Definition ImuFile.cpp:23
bool _withDelta
Flag if the header has delta values.
Definition ImuFile.hpp:65
Imu(const Imu &)=delete
Copy constructor.