0.5.0
Loading...
Searching...
No Matches
ImuIntegrator.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 ImuIntegrator.hpp
10/// @brief Integrates ImuObs Data
11/// @author T. Topp (topp@ins.uni-stuttgart.de)
12/// @author M. Maier (marcel.maier@ins.uni-stuttgart.de)
13/// @date 2020-05-18
14
15#pragma once
16
18
21
25
26namespace NAV
27{
28/// @brief Numerically integrates Imu data
29class ImuIntegrator : public Node
30{
31 public:
32 /// @brief Default constructor
34 /// @brief Destructor
35 ~ImuIntegrator() override;
36 /// @brief Copy constructor
37 ImuIntegrator(const ImuIntegrator&) = delete;
38 /// @brief Move constructor
40 /// @brief Copy assignment operator
42 /// @brief Move assignment operator
44
45 /// @brief String representation of the Class Type
46 [[nodiscard]] static std::string typeStatic();
47
48 /// @brief String representation of the Class Type
49 [[nodiscard]] std::string type() const override;
50
51 /// @brief String representation of the Class Category
52 [[nodiscard]] static std::string category();
53
54 /// @brief ImGui config window which is shown on double click
55 /// @attention Don't forget to set _hasConfig to true in the constructor of the node
56 void guiConfig() override;
57
58 /// @brief Saves the node into a json object
59 [[nodiscard]] json save() const override;
60
61 /// @brief Restores the node from a json object
62 /// @param[in] j Json object with the node state
63 void restore(const json& j) override;
64
65 private:
66 constexpr static size_t OUTPUT_PORT_INDEX_INERTIAL_NAV_SOL = 0; ///< @brief Flow (InertialNavSol)
67 constexpr static size_t INPUT_PORT_INDEX_IMU_OBS = 0; ///< @brief Flow (ImuObs)
68 constexpr static size_t INPUT_PORT_INDEX_POS_VEL_ATT_INIT = 1; ///< @brief Flow (PosVelAtt)
69
70 /// @brief Initialize the node
71 bool initialize() override;
72
73 /// @brief Deinitialize the node
74 void deinitialize() override;
75
76 /// @brief Receive Function for the PosVelAtt initial values
77 /// @param[in] queue Queue with all the received data messages
78 /// @param[in] pinIdx Index of the pin the data is received on
79 void recvPosVelAttInit(InputPin::NodeDataQueue& queue, size_t pinIdx);
80
81 /// @brief Receive Function
82 /// @param[in] queue Queue with all the received data messages
83 /// @param[in] pinIdx Index of the pin the data is received on
84 void recvObservation(InputPin::NodeDataQueue& queue, size_t pinIdx);
85
86 /// Wether IMU preintegration should be used
87 bool _imuPreintegration = false;
88
89 /// Resetting the preintegrator every epoch makes it behave like a normal integrator
91
92 /// @brief Inertial Integrator
94
95 /// @brief Inertial Preintegrator
97
98 /// @brief Prefer the raw acceleration measurements over the deltaVel & deltaTheta values
100
101 // ################################################################################################################
102
103 /// Last IMU measuremnt
104 std::shared_ptr<const ImuObs> _lastImuObs = nullptr;
105
106 /// Last position, velocity and attitude
107 std::shared_ptr<const PosVelAtt> _lastPosVelAtt = nullptr;
108};
109
110} // namespace NAV
nlohmann::json json
json namespace
Data storage class for one VectorNavImu observation.
Parent Class for all IMU Observations.
Inertial Measurement Integrator.
Inertial Measurement Preintegrator.
Node Class.
Position, Velocity and Attitude Storage Class.
static constexpr size_t INPUT_PORT_INDEX_POS_VEL_ATT_INIT
Flow (PosVelAtt)
std::shared_ptr< const PosVelAtt > _lastPosVelAtt
Last position, velocity and attitude.
void deinitialize() override
Deinitialize the node.
ImuIntegrator(const ImuIntegrator &)=delete
Copy constructor.
void recvObservation(InputPin::NodeDataQueue &queue, size_t pinIdx)
Receive Function.
std::shared_ptr< const ImuObs > _lastImuObs
Last IMU measuremnt.
bool _preferAccelerationOverDeltaMeasurements
Prefer the raw acceleration measurements over the deltaVel & deltaTheta values.
static std::string category()
String representation of the Class Category.
static std::string typeStatic()
String representation of the Class Type.
void restore(const json &j) override
Restores the node from a json object.
bool _imuPreintegration
Wether IMU preintegration should be used.
std::string type() const override
String representation of the Class Type.
ImuIntegrator()
Default constructor.
void guiConfig() override
ImGui config window which is shown on double click.
bool initialize() override
Initialize the node.
ImuIntegrator & operator=(ImuIntegrator &&)=delete
Move assignment operator.
~ImuIntegrator() override
Destructor.
ImuIntegrator(ImuIntegrator &&)=delete
Move constructor.
static constexpr size_t OUTPUT_PORT_INDEX_INERTIAL_NAV_SOL
Flow (InertialNavSol)
InertialPreIntegrator _inertialPreintegrator
Inertial Preintegrator.
void recvPosVelAttInit(InputPin::NodeDataQueue &queue, size_t pinIdx)
Receive Function for the PosVelAtt initial values.
json save() const override
Saves the node into a json object.
bool _resetPreintegratorEveryEpoch
Resetting the preintegrator every epoch makes it behave like a normal integrator.
InertialIntegrator _inertialIntegrator
Inertial Integrator.
ImuIntegrator & operator=(const ImuIntegrator &)=delete
Copy assignment operator.
static constexpr size_t INPUT_PORT_INDEX_IMU_OBS
Flow (ImuObs)
Inertial Measurement Integrator.
Inertial Measurement Integrator.
TsDeque< std::shared_ptr< const NAV::NodeData > > NodeDataQueue
Node data queue type.
Definition Pin.hpp:707
Node(std::string name)
Constructor.
Definition Node.cpp:30