Component.cpp
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 wp2_skills::ArmarXObjects::bimanual_transport_skill_provider
17  * @author Meixner ( andre dot meixner at kit dot edu )
18  * @date 2023
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 
24 #include "Component.h"
25 
26 // Include headers you only need in function definitions in the .cpp.
27 
28 // #include <Eigen/Core>
29 
30 // #include <SimoxUtility/color/Color.h>
31 
33 
35 
37 {
38 
39  const std::string Component::defaultName = "bimanual_transport_skill_provider";
40 
42  {
43  addPlugin(virtualRobotReaderPlugin_);
44  addPlugin(controlClientPlugin_);
45  }
46 
49  {
51  new ::armarx::ComponentPropertyDefinitions(getConfigIdentifier());
52 
53  // Publish to a topic (passing the TopicListenerPrx).
54  // def->topic(myTopicListener);
55 
56  // Subscribe to a topic (passing the topic name).
57  // def->topic<PlatformUnitListener>("MyTopic");
58 
59  // Use (and depend on) another component (passing the ComponentInterfacePrx).
60  // def->component(myComponentProxy)
61 
62 
63  // Add a required property. (The component won't start without a value being set.)
64  def->required(properties.robotName, "p.robotName", "");
65 
66  // Add an optional property.
67  // def->optional(properties.boxLayerName, "p.box.LayerName", "Name of the box layer in ArViz.");
68  // def->optional(properties.numBoxes, "p.box.Number", "Number of boxes to draw in ArViz.");
69 
70  return def;
71  }
72 
73  void
75  {
76  // Topics and properties defined above are automagically registered.
77 
78  // Keep debug observer data until calling `sendDebugObserverBatch()`.
79  // (Requires the armarx::DebugObserverComponentPluginUser.)
80  // setDebugObserverBatchModeEnabled(true);
81  }
82 
83  void
85  {
86 
88 
89  {
90  skills::Follower::Services srv{.mns = memoryNameSystem(),
91  .controlComponentPlugin = &getControlComponentPlugin(),
92  .robotReader = virtualRobotReaderPlugin_->get()};
93 
94  skills::Follower::Parameters params{.robotName = properties.robotName};
95  addSkillFactory<skills::Follower>(srv, params);
96  }
97 
98  }
99 
100  void
102  {
103  }
104 
105  void
107  {
108  }
109 
110  std::string
112  {
113  return Component::defaultName;
114  }
115 
116  std::string
118  {
119  return Component::defaultName;
120  }
121 
122 
123 
125 
126 } // namespace armarx::control::components::bimanual_transport_skill_provider
armarx::control::components::bimanual_transport_skill_provider::Component::onInitComponent
void onInitComponent() override
Definition: Component.cpp:74
skills
This file is part of ArmarX.
armarx::armem::client::plugins::PluginUser::memoryNameSystem
MemoryNameSystem & memoryNameSystem()
Definition: PluginUser.cpp:22
armarx::control::components::bimanual_transport_skill_provider::Component::Component
Component()
Definition: Component.cpp:41
Follower.h
Component.h
armarx::control::components::bimanual_transport_skill_provider::Component::onDisconnectComponent
void onDisconnectComponent() override
Definition: Component.cpp:101
armarx::ManagedIceObject::addPlugin
PluginT * addPlugin(const std::string prefix="", ParamsT &&...params)
Definition: ManagedIceObject.h:182
armarx::control::components::bimanual_transport_skill_provider::Component
Definition: Component.h:48
armarx::control::components::bimanual_transport_skill_provider::Component::onExitComponent
void onExitComponent() override
Definition: Component.cpp:106
armarx::control::components::bimanual_transport_skill_provider
Definition: Component.cpp:36
armarx::control::components::bimanual_transport_skill_provider::Component::GetDefaultName
static std::string GetDefaultName()
Get the component's default name.
Definition: Component.cpp:117
armarx::control::client::ComponentPluginUser::getControlComponentPlugin
ComponentPlugin & getControlComponentPlugin()
Definition: ComponentPlugin.cpp:70
armarx::control::components::bimanual_transport_skill_provider::Component::createPropertyDefinitions
::armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: Component.cpp:48
armarx::control::components::bimanual_transport_skill_provider::Component::onConnectComponent
void onConnectComponent() override
Definition: Component.cpp:84
armarx::armem::client::plugins::ReaderWriterPlugin::get
T & get()
Definition: ReaderWriterPlugin.h:87
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
Decoupled.h
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::control::skills::skills::platform_follower_controller
Definition: Follower.cpp:22
armarx::control::components::bimanual_transport_skill_provider::Component::getDefaultName
std::string getDefaultName() const override
Definition: Component.cpp:111
armarx::control::components::bimanual_transport_skill_provider::ARMARX_REGISTER_COMPONENT_EXECUTABLE
ARMARX_REGISTER_COMPONENT_EXECUTABLE(Component, Component::GetDefaultName())