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(const ::armarx::armem::robot_state::Transform& transform) override;
60 
61 
62  private:
63  armem::client::Writer memoryWriter;
64  std::mutex memoryWriterMutex;
65 
66  // Properties
67  struct Properties
68  {
69  MemoryID coreSegmentID{"RobotState", "Localization"};
70  } properties;
71 
72  const std::string propertyPrefix = "mem.robot_state.";
73  };
74 
75 } // namespace armarx::armem::client::robot_state::localization
armarx::armem::client::robot_state::localization::TransformWriter::registerPropertyDefinitions
void registerPropertyDefinitions(armarx::PropertyDefinitionsPtr &def) override
to be called in Component::addPropertyDefinitions
Definition: TransformWriter.cpp:55
armarx::navigation::graph::coreSegmentID
const armem::MemoryID coreSegmentID
Definition: constants.h:30
Writer.h
armarx::armem::client::robot_state::localization::TransformWriter::TransformWriter
TransformWriter()=default
armarx::armem::client::robot_state::localization::TransformWriter::connect
void connect(armem::client::MemoryNameSystem &memoryNameSystem) override
to be called in Component::onConnectComponent
Definition: TransformWriter.cpp:66
armarx::armem::client::robot_state::localization
Definition: interfaces.h:33
interfaces.h
armarx::armem::MemoryID
A memory ID.
Definition: MemoryID.h:47
armarx::armem::client::robot_state::localization::TransformWriter::~TransformWriter
~TransformWriter() override
armarx::armem::client::Writer
Helps a memory client sending data to a memory.
Definition: Writer.h:22
armarx::armem::client::robot_state::localization::TransformWriter
Definition: TransformWriter.h:46
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::client::robot_state::localization::TransformWriterInterface
Definition: interfaces.h:61
armarx::armem::client::robot_state::localization::TransformWriter::commitTransform
bool commitTransform(const ::armarx::armem::robot_state::Transform &transform) override
Definition: TransformWriter.cpp:85