0.4.1
Loading...
Searching...
No Matches
EmlidSensor.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 EmlidSensor.hpp
10/// @brief Emlid Sensor Class
11/// @author T. Topp (topp@ins.uni-stuttgart.de)
12/// @date 2020-06-23
13
14#pragma once
15
19
20namespace NAV
21{
22/// Emlid Sensor Class
23class EmlidSensor : public Node, public UartSensor
24{
25 public:
26 /// @brief Default constructor
28 /// @brief Destructor
29 ~EmlidSensor() override;
30 /// @brief Copy constructor
31 EmlidSensor(const EmlidSensor&) = 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_EMLID_OBS = 0; ///< @brief Flow (EmlidObs)
64
65 /// @brief Initialize the node
66 bool initialize() override;
67
68 /// @brief Deinitialize the node
69 void deinitialize() override;
70
71 /// @brief Callback handler for notifications of new asynchronous data packets received
72 /// @param[in, out] userData Pointer to the data we supplied when we called registerAsyncPacketReceivedHandler
73 /// @param[in] p Encapsulation of the data packet. At this state, it has already been validated and identified as an asynchronous data message
74 /// @param[in] index Advanced usage item and can be safely ignored for now
75 static void asciiOrBinaryAsyncMessageReceived(void* userData, uart::protocol::Packet& p, size_t index);
76
77 /// Sensor Object
79};
80
81} // namespace NAV
Class to read out Emlid Sensors.
nlohmann::json json
json namespace
Node Class.
Abstract Uart Sensor Class.
bool initialize() override
Initialize the node.
EmlidSensor()
Default constructor.
std::string type() const override
String representation of the Class Type.
static std::string category()
String representation of the Class Category.
static void asciiOrBinaryAsyncMessageReceived(void *userData, uart::protocol::Packet &p, size_t index)
Callback handler for notifications of new asynchronous data packets received.
void restore(const json &j) override
Restores the node from a json object.
json save() const override
Saves the node into a json object.
bool resetNode() override
Resets the node. It is guaranteed that the node is initialized when this is called.
EmlidSensor(EmlidSensor &&)=delete
Move constructor.
EmlidSensor & operator=(EmlidSensor &&)=delete
Move assignment operator.
~EmlidSensor() override
Destructor.
static std::string typeStatic()
String representation of the Class Type.
void guiConfig() override
ImGui config window which is shown on double click.
EmlidSensor(const EmlidSensor &)=delete
Copy constructor.
EmlidSensor & operator=(const EmlidSensor &)=delete
Copy assignment operator.
vendor::emlid::EmlidUartSensor _sensor
Sensor Object.
static constexpr size_t OUTPUT_PORT_INDEX_EMLID_OBS
Flow (EmlidObs)
void deinitialize() override
Deinitialize the node.
Node(std::string name)
Constructor.
Definition Node.cpp:30
UartSensor(const UartSensor &)=delete
Copy constructor.
Class to read out Emlid Sensors.