0.5.1
Loading...
Searching...
No Matches
Ln200Sensor.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 Ln200Sensor.hpp
10/// @brief Litton LN-200 IMU Sensor
11/// @author M. Senger (st166640@stud.uni-stuttgart.de)
12/// @date 2025-03-18
13
14#pragma once
15
19
20namespace NAV
21{
22/// LN-200 Sensor Class
23class Ln200Sensor : public Imu, public UartSensor
24{
25 public:
26 /// @brief Default constructor
28 /// @brief Destructor
29 ~Ln200Sensor() override;
30 /// @brief Copy constructor
31 Ln200Sensor(const Ln200Sensor&) = delete;
32 /// @brief Move constructor
34 /// @brief Copy assignment operator
36 /// @brief Move assignment operator
38
39 /// @brief String representation of the Class Type
40 [[nodiscard]] static std::string typeStatic();
41
42 /// @brief String representation of the Class Type
43 [[nodiscard]] std::string type() const override;
44
45 /// @brief String representation of the Class Category
46 [[nodiscard]] static std::string category();
47
48 /// @brief ImGui config window which is shown on double click
49 /// @attention Don't forget to set _hasConfig to true in the constructor of the node
50 void guiConfig() override;
51
52 /// @brief Saves the node into a json object
53 [[nodiscard]] json save() const override;
54
55 /// @brief Restores the node from a json object
56 /// @param[in] j Json object with the node state
57 void restore(const json& j) override;
58
59 /// @brief Resets the node. It is guaranteed that the node is initialized when this is called.
60 bool resetNode() override;
61
62 private:
63 constexpr static size_t OUTPUT_PORT_INDEX_LN_OBS = 0; ///< @brief Flow (ImuObs)
64
65 /// IMU data frequency in Hz.
66 constexpr static uint8_t FREQ = 200;
67
68 /// @brief Initialize the node
69 bool initialize() override;
70
71 /// @brief Deinitialize the node
72 void deinitialize() override;
73
74 /// @brief Callback handler for notifications of new asynchronous data packets received
75 /// @param[in] userData Pointer to the data we supplied when we called registerAsyncPacketReceivedHandler
76 /// @param[in] p Encapsulation of the data packet. At this state, it has already been validated and identified as an asynchronous data message
77 /// @param[in] index Advanced usage item and can be safely ignored for now
78 static void binaryAsyncMessageReceived(void* userData, uart::protocol::Packet& p, size_t index);
79
80 /// Sensor Object
82};
83
84} // namespace NAV
nlohmann::json json
json namespace
Abstract IMU Class.
Class to read out LN-200 Sensors.
Abstract Uart Sensor Class.
Imu(const Imu &)=delete
Copy constructor.
Ln200Sensor(Ln200Sensor &&)=delete
Move constructor.
json save() const override
Saves the node into a json object.
static std::string typeStatic()
String representation of the Class Type.
static std::string category()
String representation of the Class Category.
void restore(const json &j) override
Restores the node from a json object.
Ln200Sensor(const Ln200Sensor &)=delete
Copy constructor.
Ln200Sensor()
Default constructor.
vendor::ln::Ln200UartSensor _sensor
Sensor Object.
Ln200Sensor & operator=(Ln200Sensor &&)=delete
Move assignment operator.
void guiConfig() override
ImGui config window which is shown on double click.
std::string type() const override
String representation of the Class Type.
Ln200Sensor & operator=(const Ln200Sensor &)=delete
Copy assignment operator.
bool resetNode() override
Resets the node. It is guaranteed that the node is initialized when this is called.
static constexpr size_t OUTPUT_PORT_INDEX_LN_OBS
Flow (ImuObs)
void deinitialize() override
Deinitialize the node.
~Ln200Sensor() override
Destructor.
bool initialize() override
Initialize the node.
static constexpr uint8_t FREQ
IMU data frequency in Hz.
static void binaryAsyncMessageReceived(void *userData, uart::protocol::Packet &p, size_t index)
Callback handler for notifications of new asynchronous data packets received.
UartSensor(const UartSensor &)=delete
Copy constructor.
Class to read out LN-200 Sensors.