Component.cpp
Go to the documentation of this file.
1 #include "Component.h"
2 
4 
15 
17 {
18 
21  {
23  new ::armarx::ComponentPropertyDefinitions(getConfigIdentifier());
24 
25  def->component(remote.kinematicUnit);
26  def->component(remote.leftHandUnit, "LeftHandUnit", "LeftHandUnit");
27  def->component(remote.rightHandUnit, "RightHandUnit", "RightHandUnit");
28 
29  def->required(properties.robotName, "RobotName", "Name of the robot.");
30 
31  return def;
32  }
33 
34  void
36  {
37  {
38  armarx::control::skills::config::ZeroTorque skillConfig;
39  skillConfig.robotName = properties.robotName;
40  skillBlueprints.zeroTorque = std::experimental::make_observer(
43  }
44  }
45 
46  void
48  {
50  robotStateReader.connect(memoryNameSystem());
51  ::armarx::control::client::ComponentPlugin* controlComponentPluginUser =
53  {
54  {
56  .controlComponentPluginUser = controlComponentPluginUser};
57  addSkillFactory<armarx::control::skills::skills::ExecuteTrajectory>(srv);
58  }
59  {
61  remote.kinematicUnit, robotStateReader, properties.robotName};
62  addSkillFactory<armarx::control::skills::skills::MoveJointsToPosition>(srv);
63  }
64  {
66  remote.kinematicUnit};
67  addSkillFactory<armarx::control::skills::skills::MoveJointsWithVelocity>(srv);
68  }
69  {
71  robotStateReader, properties.robotName};
72  addSkillFactory<armarx::control::skills::skills::MoveJointsToNamedConfiguration>(
73  srv);
74  }
75  {
76  armarx::control::skills::HandUnitServices srv{remote.leftHandUnit,
77  remote.rightHandUnit};
78  addSkillFactory<armarx::control::skills::skills::RelaxHand>(srv);
79  }
80  {
81  armarx::control::skills::HandUnitServices srv{remote.leftHandUnit,
82  remote.rightHandUnit};
83  addSkillFactory<armarx::control::skills::skills::ShapeHand>(srv);
84  }
85  {
86  addSkillFactory<armarx::control::skills::skills::OpenHand>();
87  }
88  {
89  addSkillFactory<armarx::control::skills::skills::CloseHand>();
90  }
91  {
93  .localRobot_ = remote.robotReaderPlugin->get().getRobotWaiting(properties.robotName),
94  .robotUnitPlugin_ = remote.robotUnitPlugin};
95  skillBlueprints.zeroTorque->connectTo(context);
96  }
97  {
99  properties.robotName, arviz, memoryNameSystem(), getTrajectoryPlayer()};
100  addSkillFactory<armarx::control::pointing::skills::PointAt>(remote);
101  }
102  // meta skills
103  {
104  addSkillFactory<armarx::control::skills::skills::meta::HomePose>();
105  addSkillFactory<armarx::control::skills::skills::meta::ZeroPose>();
106  }
107  }
108  }
109 
110  void
112  {
113  }
114 
115  void
117  {
118  }
119 
120  const std::string Component::defaultName = skills::constants::CONTROL_SKILL_PROVIDER_NAME;
121 
122  std::string
124  {
125  return Component::defaultName;
126  }
127 
128  std::string
130  {
131  return Component::defaultName;
132  }
133 
135  {
136  addPlugin(remote.robotUnitPlugin);
137  addPlugin(remote.robotReaderPlugin);
138  }
139 
141 
142 } // namespace armarx::control::components::control_skill_provider
ZeroTorque.h
armarx::armem::robot_state::VirtualRobotReader
The VirtualRobotReader class.
Definition: VirtualRobotReader.h:40
armarx::control::components::control_skill_provider::Component::onExitComponent
void onExitComponent() override
Definition: Component.cpp:116
armarx::control::components::control_skill_provider::ARMARX_REGISTER_COMPONENT_EXECUTABLE
ARMARX_REGISTER_COMPONENT_EXECUTABLE(Component, Component::GetDefaultName())
armarx::control::skills::HandUnitServices
Definition: HandUnitServices.h:17
armarx::control::skills::skills::MoveJointsWithVelocity::Services
Definition: MoveJointsWithVelocity.h:27
armarx::armem::client::plugins::PluginUser::memoryNameSystem
MemoryNameSystem & memoryNameSystem()
Definition: PluginUser.cpp:22
armarx::control::skills::skills::ZeroTorque
Definition: ZeroTorque.h:16
Component.h
armarx::control::components::control_skill_provider::Component::getDefaultName
std::string getDefaultName() const override
Definition: Component.cpp:123
armarx::control::components::control_skill_provider::Component::onDisconnectComponent
void onDisconnectComponent() override
Definition: Component.cpp:111
std::experimental::fundamentals_v2::make_observer
observer_ptr< _Tp > make_observer(_Tp *__p) noexcept
armarx::armem::robot_state::RobotReader::connect
virtual void connect(armem::client::MemoryNameSystem &memoryNameSystem)
Definition: RobotReader.cpp:48
armarx::ManagedIceObject::addPlugin
PluginT * addPlugin(const std::string prefix="", ParamsT &&...params)
Definition: ManagedIceObject.h:182
armarx::control::skills::skills::ZeroTorque::Context::localRobot_
VirtualRobot::RobotPtr localRobot_
Definition: ZeroTorque.h:24
armarx::skills::SkillWithContextBlueprint
Definition: SkillWithContextBlueprint.h:38
ExecuteTrajectory.h
armarx::control::components::control_skill_provider::Component::onConnectComponent
void onConnectComponent() override
Definition: Component.cpp:47
PointAt.h
armarx::control::components::control_skill_provider
Definition: Component.cpp:16
armarx::control::components::control_skill_provider::Component::Component
Component()
Definition: Component.cpp:134
armarx::control::skills::skills::MoveJointsToNamedConfiguration::Services
Definition: MoveJointsToNamedConfiguration.h:24
MoveJointsToNamedConfiguration.h
armarx::control::client::ComponentPlugin
Definition: ComponentPlugin.h:69
armarx::control::components::control_skill_provider::Component
Definition: Component.h:24
MoveJointsWithVelocity.h
RelaxHand.h
armarx::control::skills::skills::ExecuteTrajectory::Services
Definition: ExecuteTrajectory.h:28
armarx::TrajectoryPlayerComponentPluginUser::getTrajectoryPlayer
TrajectoryPlayerInterfacePrx getTrajectoryPlayer()
Definition: TrajectoryPlayerComponentPlugin.cpp:49
armarx::control::components::control_skill_provider::Component::GetDefaultName
static std::string GetDefaultName()
Get the component's default name.
Definition: Component.cpp:129
armarx::SkillProviderComponentPluginUser::addCustomSkillFactory
requires skills::isSkillBlueprint< FacT > FacT * addCustomSkillFactory(Args &&... args)
Definition: SkillProviderComponentPlugin.h:190
HomePose.h
ShapeHand.h
armarx::control::client::ComponentPluginUser::getControlComponentPlugin
ComponentPlugin & getControlComponentPlugin()
Definition: ComponentPlugin.cpp:70
ZeroPose.h
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
Decoupled.h
armarx::control::skills::constants::CONTROL_SKILL_PROVIDER_NAME
std::string CONTROL_SKILL_PROVIDER_NAME
Definition: constants.cpp:6
armarx::ArVizComponentPluginUser::arviz
armarx::viz::Client arviz
Definition: ArVizComponentPlugin.h:43
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::control::skills::skills::ZeroTorque::Context
Definition: ZeroTorque.h:21
armarx::control::skills::skills::MoveJointsToPosition::Services
Definition: MoveJointsToPosition.h:27
armarx::control::pointing::core::Pointing::Remote
Definition: Pointing.h:42
armarx::control::components::control_skill_provider::Component::createPropertyDefinitions
::armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: Component.cpp:20
armarx::control::skills::skills::ExecuteTrajectory::Services::controlComponentPluginUser
::armarx::control::client::ComponentPlugin * controlComponentPluginUser
Definition: ExecuteTrajectory.h:30
MoveJointsToPosition.h
armarx::control::components::control_skill_provider::Component::onInitComponent
void onInitComponent() override
Definition: Component.cpp:35