RobotStateWriter.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  * @package RobotAPI::ArmarXObjects::RobotSensorMemory
17  * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
18  * @date 2020
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 
24 #pragma once
25 
26 #include <optional>
27 
32 
36 
37 #include "RobotUnitData.h"
38 
39 
40 namespace armarx::plugins
41 {
42  class DebugObserverComponentPlugin;
43 }
44 namespace armarx::armem::server
45 {
46  class MemoryToIceAdapter;
47 }
49 {
50  class Segment;
51 }
53 {
55  {
56  public:
57 
58  void connect(armarx::plugins::DebugObserverComponentPlugin& debugObserverPlugin);
59 
61 
62 
63  /// Reads data from `dataQueue` and commits to the memory.
64  void run(float pollFrequency,
65  Queue& dataBuffer,
67  localization::Segment& localizationSegment
68  );
69 
70 
71  struct Update
72  {
75  std::vector<armem::robot_state::localization::Transform> localization;
76  };
77  Update buildUpdate(const RobotUnitData& dataQueue);
78 
79 
80  private:
81 
83  getTransform(
84  const aron::data::DictPtr& platformData,
85  const Time& timestamp) const;
86 
87 
88  public:
89 
90  struct Properties
91  {
93  };
95 
96  std::optional<DebugObserverHelper> debugObserver;
97 
98 
100 
101 
102  private:
103 
104  bool noOdometryDataLogged = false;
105 
106  bool isRunning();
107  };
108 
109 }
armarx::armem::server::robot_state::proprioception::RobotStateWriter::Queue
armarx::armem::server::robot_state::proprioception::Queue Queue
Definition: RobotStateWriter.h:60
armarx::armem::server::robot_state::proprioception::RobotStateWriter::buildUpdate
Update buildUpdate(const RobotUnitData &dataQueue)
Definition: RobotStateWriter.cpp:161
armarx::armem::server::robot_state::proprioception::RobotStateWriter::Properties::robotUnitProviderID
armem::MemoryID robotUnitProviderID
Definition: RobotStateWriter.h:92
armarx::armem::Commit
A bundle of updates to be sent to the memory.
Definition: Commit.h:89
armarx::armem::server::MemoryToIceAdapter
Helps connecting a Memory server to the Ice interface.
Definition: MemoryToIceAdapter.h:19
armarx::armem::server::robot_state::proprioception::RobotStateWriter::connect
void connect(armarx::plugins::DebugObserverComponentPlugin &debugObserverPlugin)
Definition: RobotStateWriter.cpp:47
MemoryID.h
armarx::armem::server::robot_state::proprioception::RobotStateWriter::Update::localization
std::vector< armem::robot_state::localization::Transform > localization
Definition: RobotStateWriter.h:75
armarx::armem::server::robot_state::localization::Segment
Definition: Segment.h:44
armarx::armem::server::robot_state::proprioception
Definition: forward_declarations.h:78
armarx::armem::robot_state::localization::Transform
Definition: types.h:154
armarx::armem::server::robot_state::proprioception::RobotStateWriter::Update::proprioception
armem::Commit proprioception
Definition: RobotStateWriter.h:73
armarx::armem::server::robot_state::localization
Definition: forward_declarations.h:71
armarx::memory
Brief description of class memory.
Definition: memory.h:39
armarx::armem::server::robot_state::proprioception::Queue
boost::sync_queue< RobotUnitData > Queue
Definition: RobotUnitData.h:21
armarx::armem::server::robot_state::proprioception::RobotStateWriter::debugObserver
std::optional< DebugObserverHelper > debugObserver
Definition: RobotStateWriter.h:96
armarx::armem::server::robot_state::proprioception::RobotStateWriter::properties
Properties properties
Definition: RobotStateWriter.h:94
armarx::armem::MemoryID
A memory ID.
Definition: MemoryID.h:47
armarx::plugins
This file is part of ArmarX.
Definition: DebugObserverComponentPlugin.cpp:28
RobotUnitData.h
armarx::armem::server::robot_state::proprioception::RobotStateWriter::Update::exteroception
armem::Commit exteroception
Definition: RobotStateWriter.h:74
armarx::armem::server::robot_state::proprioception::RobotUnitData
Definition: RobotUnitData.h:13
armarx::armem::server::robot_state::proprioception::RobotStateWriter::run
void run(float pollFrequency, Queue &dataBuffer, MemoryToIceAdapter &memory, localization::Segment &localizationSegment)
Reads data from dataQueue and commits to the memory.
Definition: RobotStateWriter.cpp:63
TaskUtil.h
types.h
armarx::armem::server
Definition: GraspMemory.cpp:19
Commit.h
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition: Dict.h:41
TripleBuffer.h
DebugObserverHelper.h
armarx::Logging
Base Class for all Logging classes.
Definition: Logging.h:232
IceUtil::Handle
Definition: forward_declarations.h:29
armarx::armem::server::robot_state::proprioception::RobotStateWriter::task
armarx::SimpleRunningTask ::pointer_type task
Definition: RobotStateWriter.h:99
armarx::armem::server::robot_state::proprioception::RobotStateWriter::Update
Definition: RobotStateWriter.h:71
Logging.h
armarx::armem::server::robot_state::proprioception::RobotStateWriter::Properties
Definition: RobotStateWriter.h:90
armarx::plugins::DebugObserverComponentPlugin
Brief description of class DebugObserverComponentPlugin.
Definition: DebugObserverComponentPlugin.h:48
armarx::armem::server::robot_state::proprioception::RobotStateWriter
Definition: RobotStateWriter.h:54