SimpleVirtualRobot.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <VirtualRobot/VirtualRobot.h>
5 
8 
9 // #include <ArmarXGui/libraries/ArmarXGuiComponentPlugins/LightweightRemoteGuiComponentPlugin.h>
10 
14 
15 
17 {
18 
19  /**
20  * @defgroup Component-SimpleVirtualRobot SimpleVirtualRobot
21  * @ingroup RobotAPI-Components
22  * Simply loads a Simox robot model and commits it to the memory.
23  *
24  * @class SimpleVirtualRobot
25  * @ingroup Component-SimpleVirtualRobot
26  * @brief Brief description of class SimpleVirtualRobot.
27  *
28  * Detailed description of class SimpleVirtualRobot.
29  */
31  virtual public armarx::Component,
33  {
34  public:
36 
37  std::string getDefaultName() const override;
38 
39  protected:
41 
42  void onInitComponent() override;
43  void onConnectComponent() override;
44  void onDisconnectComponent() override;
45  void onExitComponent() override;
46 
47  void run();
48 
49 
50 
51  private:
52 
53  struct Properties
54  {
55  bool oneShot = true;
56  float updateFrequency{10.F};
57 
58  struct Robot
59  {
60  std::string name;
61  std::string package;
62  std::string path;
63 
64  std::string jointValues; // json-style map<std::string, float>
65 
66  float globalPositionX = 0;
67  float globalPositionY = 0;
68  float globalPositionYaw = 0;
69  };
70  Robot robot;
71  };
72 
73  VirtualRobot::RobotPtr loadRobot(const Properties::Robot& p) const;
74 
75 
76  private:
77  Properties properties;
78 
79 
81 
83 
85  virtualRobotWriterPlugin = nullptr;
86 
87 
88  };
89 
90 } // namespace armarx::simple_virtual_robot
armarx::simple_virtual_robot::SimpleVirtualRobot::Properties::Robot::globalPositionY
float globalPositionY
Definition: SimpleVirtualRobot.h:67
armarx::simple_virtual_robot::SimpleVirtualRobot::SimpleVirtualRobot
SimpleVirtualRobot()
Definition: SimpleVirtualRobot.cpp:37
armarx::simple_virtual_robot::SimpleVirtualRobot
Brief description of class SimpleVirtualRobot.
Definition: SimpleVirtualRobot.h:30
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
ReaderWriterPlugin.h
armarx::simple_virtual_robot::SimpleVirtualRobot::Properties::Robot::jointValues
std::string jointValues
Definition: SimpleVirtualRobot.h:64
armarx::simple_virtual_robot::SimpleVirtualRobot::Properties::Robot::package
std::string package
Definition: SimpleVirtualRobot.h:61
armarx::simple_virtual_robot
Definition: SimpleVirtualRobot.cpp:35
armarx::simple_virtual_robot::SimpleVirtualRobot::run
void run()
Definition: SimpleVirtualRobot.cpp:145
armarx::simple_virtual_robot::SimpleVirtualRobot::Properties::Robot
Definition: SimpleVirtualRobot.h:58
TaskUtil.h
plugins.h
armarx::simple_virtual_robot::SimpleVirtualRobot::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: SimpleVirtualRobot.cpp:78
armarx::simple_virtual_robot::SimpleVirtualRobot::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: SimpleVirtualRobot.cpp:73
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
VirtualRobotWriter.h
armarx::simple_virtual_robot::SimpleVirtualRobot::Properties::Robot::path
std::string path
Definition: SimpleVirtualRobot.h:62
armarx::simple_virtual_robot::SimpleVirtualRobot::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: SimpleVirtualRobot.cpp:43
armarx::simple_virtual_robot::SimpleVirtualRobot::onDisconnectComponent
void onDisconnectComponent() override
Hook for subclass.
Definition: SimpleVirtualRobot.cpp:88
armarx::simple_virtual_robot::SimpleVirtualRobot::Properties::Robot::globalPositionX
float globalPositionX
Definition: SimpleVirtualRobot.h:66
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::simple_virtual_robot::SimpleVirtualRobot::Properties::Robot::globalPositionYaw
float globalPositionYaw
Definition: SimpleVirtualRobot.h:68
armarx::simple_virtual_robot::SimpleVirtualRobot::Properties::Robot::name
std::string name
Definition: SimpleVirtualRobot.h:60
armarx::simple_virtual_robot::SimpleVirtualRobot::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: SimpleVirtualRobot.cpp:94
armarx::armem::client::plugins::ListeningPluginUser
A memory name system client which listens to the memory updates topic (MemoryListenerInterface).
Definition: ListeningPluginUser.h:23
armarx::simple_virtual_robot::SimpleVirtualRobot::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: SimpleVirtualRobot.cpp:67
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18