RobotUnitReader.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <map>
4 #include <memory>
5 #include <optional>
6 #include <queue>
7 #include <string>
8 
12 
13 #include <RobotAPI/interface/units/RobotUnit/RobotUnitInterface.h>
15 
16 #include "RobotUnitData.h"
17 #include "converters/ConverterInterface.h"
18 #include "../exteroception/converters/ConverterInterface.h"
19 #include "converters/ConverterRegistry.h"
20 #include "../exteroception/converters/ConverterRegistry.h"
21 
22 
23 namespace armarx::plugins
24 {
25  class RobotUnitComponentPlugin;
26  class DebugObserverComponentPlugin;
27 } // namespace armarx::plugins
28 namespace armarx
29 {
30  using RobotUnitDataStreamingReceiverPtr = std::shared_ptr<class RobotUnitDataStreamingReceiver>;
31 }
32 
33 
34 // TODO move this out of proprioception. it is now for proprioception and exteroception
36 {
38  {
39  public:
41 
43 
44 
47  const std::string& robotTypeName);
48 
49 
50  /// Reads data from `handler` and fills `dataQueue`.
51  void run(float pollFrequency, Queue& dataBuffer);
52 
53  std::optional<RobotUnitData> fetchAndConvertLatestRobotUnitData();
54 
55 
56  private:
57  /// Fetch the latest timestep and clear the robot unit buffer.
58  std::optional<RobotUnitDataStreaming::TimeStep> fetchLatestData();
59 
60 
61  public:
62  struct Properties
63  {
64  std::string sensorPrefix = "sens.*";
65  };
67 
68  std::optional<DebugObserverHelper> debugObserver;
69 
70 
71  RobotUnitDataStreaming::Config config;
73  RobotUnitDataStreaming::DataStreamingDescription description;
74 
79 
81  };
82 
83 } // namespace armarx::armem::server::robot_state::proprioception
armarx::armem::server::robot_state::proprioception::RobotUnitReader::config
RobotUnitDataStreaming::Config config
Definition: RobotUnitReader.h:71
armarx::armem::server::robot_state::exteroception::ConverterInterface
Definition: ConverterInterface.h:20
armarx::armem::server::robot_state::proprioception::RobotUnitReader
Definition: RobotUnitReader.h:37
armarx::RobotUnitDataStreamingReceiverPtr
std::shared_ptr< class RobotUnitDataStreamingReceiver > RobotUnitDataStreamingReceiverPtr
Definition: RobotUnitReader.h:30
armarx::armem::server::robot_state::proprioception::RobotUnitReader::converterExteroception
exteroception::ConverterInterface * converterExteroception
Definition: RobotUnitReader.h:78
armarx::armem::server::robot_state::proprioception::RobotUnitReader::properties
Properties properties
Definition: RobotUnitReader.h:66
armarx::armem::server::robot_state::proprioception::RobotUnitReader::converterProprioception
proprioception::ConverterInterface * converterProprioception
Definition: RobotUnitReader.h:77
armarx::armem::server::robot_state::proprioception
Definition: forward_declarations.h:78
armarx::armem::server::robot_state::proprioception::RobotUnitReader::Properties::sensorPrefix
std::string sensorPrefix
Definition: RobotUnitReader.h:64
armarx::armem::server::robot_state::proprioception::Queue
boost::sync_queue< RobotUnitData > Queue
Definition: RobotUnitData.h:21
armarx::armem::server::robot_state::proprioception::RobotUnitReader::debugObserver
std::optional< DebugObserverHelper > debugObserver
Definition: RobotUnitReader.h:68
armarx::armem::server::robot_state::proprioception::RobotUnitReader::receiver
RobotUnitDataStreamingReceiverPtr receiver
Definition: RobotUnitReader.h:72
armarx::armem::server::robot_state::exteroception::ConverterRegistry
Definition: ConverterRegistry.h:13
armarx::plugins
This file is part of ArmarX.
Definition: DebugObserverComponentPlugin.cpp:28
RobotUnitData.h
armarx::armem::server::robot_state::proprioception::ConverterInterface
Definition: ConverterInterface.h:20
armarx::armem::server::robot_state::proprioception::ConverterRegistry
Definition: ConverterRegistry.h:13
armarx::armem::server::robot_state::proprioception::RobotUnitReader::fetchAndConvertLatestRobotUnitData
std::optional< RobotUnitData > fetchAndConvertLatestRobotUnitData()
Definition: RobotUnitReader.cpp:80
armarx::armem::server::robot_state::proprioception::RobotUnitReader::Properties
Definition: RobotUnitReader.h:62
armarx::armem::server::robot_state::proprioception::RobotUnitReader::exteroceptionConverterRegistry
exteroception::ConverterRegistry exteroceptionConverterRegistry
Definition: RobotUnitReader.h:76
TaskUtil.h
armarx::plugins::RobotUnitComponentPlugin
Definition: RobotUnitComponentPlugin.h:11
armarx::armem::server::robot_state::proprioception::RobotUnitReader::Queue
armarx::armem::server::robot_state::proprioception::Queue Queue
Definition: RobotUnitReader.h:42
armarx::armem::server::robot_state::proprioception::RobotUnitReader::RobotUnitReader
RobotUnitReader()
DebugObserverHelper.h
armarx::armem::server::robot_state::proprioception::RobotUnitReader::run
void run(float pollFrequency, Queue &dataBuffer)
Reads data from handler and fills dataQueue.
Definition: RobotUnitReader.cpp:49
armarx::armem::server::robot_state::proprioception::RobotUnitReader::connect
void connect(armarx::plugins::RobotUnitComponentPlugin &robotUnitPlugin, armarx::plugins::DebugObserverComponentPlugin &debugObserverPlugin, const std::string &robotTypeName)
Definition: RobotUnitReader.cpp:19
armarx::Logging
Base Class for all Logging classes.
Definition: Logging.h:232
armarx::armem::server::robot_state::proprioception::RobotUnitReader::task
armarx::SimpleRunningTask ::pointer_type task
Definition: RobotUnitReader.h:80
IceUtil::Handle
Definition: forward_declarations.h:29
armarx::armem::server::robot_state::proprioception::RobotUnitReader::description
RobotUnitDataStreaming::DataStreamingDescription description
Definition: RobotUnitReader.h:73
Logging.h
armarx::plugins::DebugObserverComponentPlugin
Brief description of class DebugObserverComponentPlugin.
Definition: DebugObserverComponentPlugin.h:48
armarx::armem::server::robot_state::proprioception::RobotUnitReader::proprioceptionConverterRegistry
ConverterRegistry proprioceptionConverterRegistry
Definition: RobotUnitReader.h:75
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
RobotUnitComponentPlugin.h