RobotUnitReader.h
Go to the documentation of this file.
1/**
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @author Fabian Reister ( fabian dot reister at kit dot edu )
17 * @date 2022
18 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19 * GNU General Public License
20 */
21
22#pragma once
23
24
27
29#include <RobotAPI/interface/units/RobotUnit/RobotUnitInterface.h>
30
33
34namespace armarx::plugins
35{
38} // namespace armarx::plugins
39
41{
42
43 /**
44 * @brief The RobotUnitReader class. The aim of this class is to receive data from the robot unit via streaming.
45 * Once data is received, it will be added to the odometry message queue.
46 *
47 *
48 */
50 {
51 public:
54 CartographerAdapter::OdomData>& odomMessageQueue,
55 FrequencyReporter& odomDataReporter);
56
58
59 protected:
60 /**
61 * @brief Sets up the robot unit streaming channel
62 *
63 */
64 void connect();
65
66 /**
67 * @brief Reads the available data and fills the odomMessageQeueu
68 *
69 */
71
72 std::shared_ptr<
74 convert(const RobotUnitDataStreaming::TimeStep& data);
75
76
77 private:
79
80 /// reference to the message queue that will be filled when odometry data is available
81 MessageQueue<
83 odomMessageQueue;
84
85 /// logging: will allow introspection of the reliability of the received data
86 FrequencyReporter& odomDataReporter;
87
88
89 // do not change this or mysterious things will happen
90 const std::string sensorDataPrefix = "sens.Platform.relativePosition*";
91
92
94 RobotUnitDataStreaming::DataStreamingDescription description;
95
96
98
99
100 const float updatePeriodMs = 10;
101 };
102} // namespace armarx::components::cartographer_localization_and_mapping
The FrequencyReporter class.
IceUtil::Handle< PeriodicTask< T > > pointer_type
Shared pointer type for convenience.
RobotUnitReader(armarx::plugins::RobotUnitComponentPlugin &robotUnitPlugin, MessageQueue< armarx::localization_and_mapping::cartographer_adapter::CartographerAdapter::OdomData > &odomMessageQueue, FrequencyReporter &odomDataReporter)
void readRobotUnitData()
Reads the available data and fills the odomMessageQeueu.
std::shared_ptr< armarx::localization_and_mapping::cartographer_adapter::CartographerAdapter::OdomData > convert(const RobotUnitDataStreaming::TimeStep &data)
Brief description of class DebugObserverComponentPlugin.
This file is part of ArmarX.
std::shared_ptr< class RobotUnitDataStreamingReceiver > RobotUnitDataStreamingReceiverPtr