0.2.0
Loading...
Searching...
No Matches
SkydelNetworkStream.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
13
14#pragma once
15
17
18#include <cstdlib>
19#include <boost/asio.hpp>
20#include <thread>
21#include <string>
22#include <vector>
23
25
26namespace NAV::experimental
27{
30{
31 public:
44
46 [[nodiscard]] static std::string typeStatic();
47
49 [[nodiscard]] std::string type() const override;
50
52 [[nodiscard]] static std::string category();
53
56 void guiConfig() override;
57
59 bool resetNode() override;
60
61 private:
62 constexpr static size_t OUTPUT_PORT_INDEX_IMU_OBS = 0;
63 constexpr static size_t OUTPUT_PORT_INDEX_GNSS_OBS = 1;
64
66 bool initialize() override;
67
69 void deinitialize() override;
70
72 boost::asio::io_context _ioservice;
73
75 void do_receive();
76
78 std::thread _testThread;
79
81 constexpr static unsigned int _maxLength = 1024;
82
84 std::array<char, _maxLength> _data{};
85
87 boost::asio::ip::udp::endpoint _senderEndpoint;
89 boost::asio::ip::udp::socket _socket;
90
92 bool _stop = false;
94 bool _isStartup = true;
95
97 std::chrono::steady_clock::time_point _startPoint;
98
100 uint64_t _lastMessageTime{};
101
103 int _packageCount = 0;
104
106 int _packagesNumber = 2;
107
109 double _dataRate = 0.0;
110
112 int _startCounter = 0;
113
115 int _startNow = 20;
116};
117
118} // namespace NAV::experimental
Abstract IMU Class.
The class is responsible for all time-related tasks.
Abstract IMU Class.
Definition Imu.hpp:24
SkydelNetworkStream Sensor Class.
Definition SkydelNetworkStream.hpp:30
std::string type() const override
String representation of the Class Type.
void guiConfig() override
ImGui config window which is shown on double click.
SkydelNetworkStream & operator=(SkydelNetworkStream &&)=delete
Move assignment operator.
bool resetNode() override
Resets the node. It is guaranteed that the node is initialized when this is called.
SkydelNetworkStream(SkydelNetworkStream &&)=delete
Move constructor.
SkydelNetworkStream & operator=(const SkydelNetworkStream &)=delete
Copy assignment operator.
~SkydelNetworkStream() override
Destructor.
static std::string typeStatic()
String representation of the Class Type.
static std::string category()
String representation of the Class Category.
SkydelNetworkStream()
Default constructor.
SkydelNetworkStream(const SkydelNetworkStream &)=delete
Copy constructor.