VirtualRobotReaderExampleClient.h
Go to the documentation of this file.
1 
2 /*
3  * This file is part of ArmarX.
4  *
5  * ArmarX is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation.
8  *
9  * ArmarX is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  *
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 <ArmarXCore/interface/observers/ObserverInterface.h>
28 
32 
33 
34 namespace armarx::robot_state
35 {
36 
37  /**
38  * @defgroup Component-VirtualRobotReaderExampleClient VirtualRobotReaderExampleClient
39  * @ingroup RobotAPI-Components
40  * A description of the component VirtualRobotReaderExampleClient.
41  *
42  * @class VirtualRobotReaderExampleClient
43  * @ingroup Component-VirtualRobotReaderExampleClient
44  * @brief Brief description of class VirtualRobotReaderExampleClient.
45  *
46  * Detailed description of class VirtualRobotReaderExampleClient.
47  */
49  virtual public armarx::Component,
50  // Use the memory client plugin.
52  {
53  public:
55 
56  /// @see armarx::ManagedIceObject::getDefaultName()
57  std::string getDefaultName() const override;
58 
59  protected:
60 
62 
63  void onInitComponent() override;
64  void onConnectComponent() override;
65  void onDisconnectComponent() override;
66  void onExitComponent() override;
67 
68 
69  private:
70 
71  void run();
72 
73 
74  private:
75 
76  struct Properties
77  {
78  std::string robotName{"Armar6"};
79  float updateFrequency{10.F};
80  };
81  Properties properties;
82 
83  // The running task which is started in onConnectComponent().
85 
86  // The reader used to get the robot state.
87  template <typename T>
89 
91  nullptr;
92 
93  // The Simox robot model.
94  VirtualRobot::RobotPtr robot = nullptr;
95 
96  // For publishing timing information.
98 
99  };
100 
101 } // namespace armarx::robot_state
armarx::armem::client::plugins::ReaderWriterPlugin
A component plugin offering client-side access to a reader or writer and manages the lifecycle,...
Definition: ReaderWriterPlugin.h:44
armarx::robot_state::VirtualRobotReaderExampleClient::onDisconnectComponent
void onDisconnectComponent() override
Hook for subclass.
Definition: VirtualRobotReaderExampleClient.cpp:54
ReaderWriterPlugin.h
armarx::robot_state::VirtualRobotReaderExampleClient::VirtualRobotReaderExampleClient
VirtualRobotReaderExampleClient()
armarx::robot_state
Definition: VirtualRobotReaderExampleClient.cpp:11
armarx::robot_state::VirtualRobotReaderExampleClient::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: VirtualRobotReaderExampleClient.cpp:42
VirtualRobotReader.h
TaskUtil.h
plugins.h
armarx::robot_state::VirtualRobotReaderExampleClient::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: VirtualRobotReaderExampleClient.cpp:37
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
armarx::robot_state::VirtualRobotReaderExampleClient::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: VirtualRobotReaderExampleClient.cpp:15
armarx::robot_state::VirtualRobotReaderExampleClient::getDefaultName
std::string getDefaultName() const override
Definition: VirtualRobotReaderExampleClient.cpp:31
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface >
armarx::robot_state::VirtualRobotReaderExampleClient::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: VirtualRobotReaderExampleClient.cpp:60
armarx::robot_state::VirtualRobotReaderExampleClient
Brief description of class VirtualRobotReaderExampleClient.
Definition: VirtualRobotReaderExampleClient.h:48
armarx::armem::client::plugins::ListeningPluginUser
A memory name system client which listens to the memory updates topic (MemoryListenerInterface).
Definition: ListeningPluginUser.h:23
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18