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
27#include <ArmarXCore/interface/observers/ObserverInterface.h>
28
32
33namespace armarx::robot_state
34{
35
36 /**
37 * @defgroup Component-VirtualRobotReaderExampleClient VirtualRobotReaderExampleClient
38 * @ingroup RobotAPI-Components
39 * A description of the component VirtualRobotReaderExampleClient.
40 *
41 * @class VirtualRobotReaderExampleClient
42 * @ingroup Component-VirtualRobotReaderExampleClient
43 * @brief Brief description of class VirtualRobotReaderExampleClient.
44 *
45 * Detailed description of class VirtualRobotReaderExampleClient.
46 */
48 virtual public armarx::Component,
49 // Use the memory client plugin.
51 {
52 public:
54
55 /// @see armarx::ManagedIceObject::getDefaultName()
56 std::string getDefaultName() const override;
57
58 protected:
60
61 void onInitComponent() override;
62 void onConnectComponent() override;
63 void onDisconnectComponent() override;
64 void onExitComponent() override;
65
66
67 private:
68 void run();
69
70
71 private:
72 struct Properties
73 {
74 std::string robotName{"Armar6"};
75 float updateFrequency{10.F};
76 };
77
78 Properties properties;
79
80 // The running task which is started in onConnectComponent().
82
83 // The reader used to get the robot state.
84 template <typename T>
85 using ReaderWriterPlugin = armem::client::plugins::ReaderWriterPlugin<T>;
86
87 ReaderWriterPlugin<armem::robot_state::VirtualRobotReader>* virtualRobotReaderPlugin =
88 nullptr;
89
90 // The Simox robot model.
91 VirtualRobot::RobotPtr robot = nullptr;
92
93 // For publishing timing information.
95 };
96
97} // namespace armarx::robot_state
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition Component.h:94
IceUtil::Handle< RunningTask< T > > pointer_type
Shared pointer type for convenience.
A component plugin offering client-side access to a reader or writer and manages the lifecycle,...
void onInitComponent() override
Pure virtual hook for the subclass.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onConnectComponent() override
Pure virtual hook for the subclass.
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
plugins::ListeningPluginUser ComponentPluginUser
Definition plugins.h:10
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface > DebugObserverInterfacePrx
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.