TransformWriter.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::
17  * @author Fabian Reister ( fabian dot reister at kit dot edu )
18  * @date 2021
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 #include <mutex>
26 
29 
30 #include "interfaces.h"
31 
33 {
34 
35  /**
36  * @defgroup Component-ExampleClient ExampleClient
37  * @ingroup RobotAPI-Components
38  * A description of the component ExampleClient.
39  *
40  * @class ExampleClient
41  * @ingroup Component-ExampleClient
42  * @brief Brief description of class ExampleClient.
43  *
44  * Detailed description of class ExampleClient.
45  */
47  {
48  public:
49  TransformWriter() = default;
50  ~TransformWriter() override;
51 
52  // TransformWriterInterface
53  /// to be called in Component::onConnectComponent
54  void connect(armem::client::MemoryNameSystem& memoryNameSystem) override;
55 
56  /// to be called in Component::addPropertyDefinitions
58 
59  bool commitTransform(
60  const ::armarx::armem::robot_state::localization::Transform& transform) override;
61 
62 
63  private:
64  armem::client::Writer memoryWriter;
65  std::mutex memoryWriterMutex;
66 
67  // Properties
68  struct Properties
69  {
70  MemoryID coreSegmentID{"RobotState", "Localization"};
71  } properties;
72 
73  const std::string propertyPrefix = "mem.robot_state.";
74  };
75 
76 } // namespace armarx::armem::robot_state::client::localization
armarx::navigation::graph::coreSegmentID
const armem::MemoryID coreSegmentID
Definition: constants.h:30
armarx::armem::robot_state::client::localization::TransformWriter::~TransformWriter
~TransformWriter() override
Writer.h
interfaces.h
armarx::armem::robot_state::client::localization
Definition: interfaces.h:33
armarx::armem::MemoryID
A memory ID.
Definition: MemoryID.h:47
armarx::armem::robot_state::client::localization::TransformWriter::commitTransform
bool commitTransform(const ::armarx::armem::robot_state::localization::Transform &transform) override
Definition: TransformWriter.cpp:85
armarx::armem::robot_state::client::localization::TransformWriter
Definition: TransformWriter.h:46
armarx::armem::client::Writer
Helps a memory client sending data to a memory.
Definition: Writer.h:22
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::transform
auto transform(const Container< InputT, Alloc > &in, OutputT(*func)(InputT const &)) -> Container< OutputT, typename std::allocator_traits< Alloc >::template rebind_alloc< OutputT > >
Convenience function (with less typing) to transform a container of type InputT into the same contain...
Definition: algorithm.h:315
armarx::armem::client::MemoryNameSystem
The memory name system (MNS) client.
Definition: MemoryNameSystem.h:69
MemoryNameSystem.h
armarx::armem::robot_state::client::localization::TransformWriter::TransformWriter
TransformWriter()=default
armarx::armem::robot_state::client::localization::TransformWriter::connect
void connect(armem::client::MemoryNameSystem &memoryNameSystem) override
to be called in Component::onConnectComponent
Definition: TransformWriter.cpp:66
armarx::armem::robot_state::client::localization::TransformWriterInterface
Definition: interfaces.h:61
armarx::armem::robot_state::client::localization::TransformWriter::registerPropertyDefinitions
void registerPropertyDefinitions(armarx::PropertyDefinitionsPtr &def) override
to be called in Component::addPropertyDefinitions
Definition: TransformWriter.cpp:55