Component.cpp
Go to the documentation of this file.
1 #include "Component.h"
2 
4 
16 
18 {
19 
22  {
24  new ::armarx::ComponentPropertyDefinitions(getConfigIdentifier());
25 
26  def->component(remote.kinematicUnit);
27  def->component(remote.leftHandUnit, "LeftHandUnit", "LeftHandUnit");
28  def->component(remote.rightHandUnit, "RightHandUnit", "RightHandUnit");
29 
30  def->required(properties.robotName, "RobotName", "Name of the robot.");
31 
32  return def;
33  }
34 
35  void
37  {
38  {
39  armarx::control::skills::config::ZeroTorque skillConfig;
40  skillConfig.robotName = properties.robotName;
41  skillBlueprints.zeroTorque = std::experimental::make_observer(
44  }
45  }
46 
47  void
49  {
51  robotStateReader.connect(memoryNameSystem());
52  ::armarx::control::client::ComponentPlugin* controlComponentPluginUser =
54  {
55  {
57  .controlComponentPluginUser = controlComponentPluginUser};
58  addSkillFactory<armarx::control::skills::skills::ExecuteTrajectory>(srv);
59  }
60  {
62  .controlComponentPluginUser = controlComponentPluginUser};
63  addSkillFactory<armarx::control::skills::skills::GuidingWithCollAvoidance>(srv);
64  }
65  {
67  remote.kinematicUnit, robotStateReader, properties.robotName};
68  addSkillFactory<armarx::control::skills::skills::MoveJointsToPosition>(srv);
69  }
70  {
72  remote.kinematicUnit};
73  addSkillFactory<armarx::control::skills::skills::MoveJointsWithVelocity>(srv);
74  }
75  {
77  robotStateReader, properties.robotName};
78  addSkillFactory<armarx::control::skills::skills::MoveJointsToNamedConfiguration>(
79  srv);
80  }
81  {
82  armarx::control::skills::HandUnitServices srv{remote.leftHandUnit,
83  remote.rightHandUnit};
84  addSkillFactory<armarx::control::skills::skills::RelaxHand>(srv);
85  }
86  {
87  armarx::control::skills::HandUnitServices srv{remote.leftHandUnit,
88  remote.rightHandUnit};
89  addSkillFactory<armarx::control::skills::skills::ShapeHand>(srv);
90  }
91  {
92  addSkillFactory<armarx::control::skills::skills::OpenHand>();
93  }
94  {
95  addSkillFactory<armarx::control::skills::skills::CloseHand>();
96  }
97  {
99  .localRobot_ =
100  remote.robotReaderPlugin->get().getRobotWaiting(properties.robotName),
101  .robotUnitPlugin_ = remote.robotUnitPlugin};
102  skillBlueprints.zeroTorque->connectTo(context);
103  }
104  {
106  properties.robotName, arviz, memoryNameSystem(), getTrajectoryPlayer()};
107  addSkillFactory<armarx::control::pointing::skills::PointAt>(remote);
108  }
109  // meta skills
110  {
111  addSkillFactory<armarx::control::skills::skills::meta::HomePose>();
112  addSkillFactory<armarx::control::skills::skills::meta::ZeroPose>();
113  }
114  }
115  }
116 
117  void
119  {
120  }
121 
122  void
124  {
125  }
126 
127  const std::string Component::defaultName = skills::constants::CONTROL_SKILL_PROVIDER_NAME;
128 
129  std::string
131  {
132  return Component::defaultName;
133  }
134 
135  std::string
137  {
138  return Component::defaultName;
139  }
140 
142  {
143  addPlugin(remote.robotUnitPlugin);
144  addPlugin(remote.robotReaderPlugin);
145  }
146 
148 
149 } // namespace armarx::control::components::control_skill_provider
ZeroTorque.h
armarx::armem::robot_state::VirtualRobotReader
The VirtualRobotReader class.
Definition: VirtualRobotReader.h:39
armarx::control::components::control_skill_provider::Component::onExitComponent
void onExitComponent() override
Definition: Component.cpp:123
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:20
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:130
armarx::control::components::control_skill_provider::Component::onDisconnectComponent
void onDisconnectComponent() override
Definition: Component.cpp:118
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:49
armarx::ManagedIceObject::addPlugin
PluginT * addPlugin(const std::string prefix="", ParamsT &&... params)
Definition: ManagedIceObject.h:186
armarx::control::skills::skills::ZeroTorque::Context::localRobot_
VirtualRobot::RobotPtr localRobot_
Definition: ZeroTorque.h:24
armarx::skills::SkillWithContextBlueprint
Definition: SkillWithContextBlueprint.h:40
ExecuteTrajectory.h
armarx::control::components::control_skill_provider::Component::onConnectComponent
void onConnectComponent() override
Definition: Component.cpp:48
PointAt.h
armarx::control::components::control_skill_provider
Definition: Component.cpp:17
armarx::control::components::control_skill_provider::Component::Component
Component()
Definition: Component.cpp:141
armarx::control::skills::skills::MoveJointsToNamedConfiguration::Services
Definition: MoveJointsToNamedConfiguration.h:24
MoveJointsToNamedConfiguration.h
armarx::control::client::ComponentPlugin
Definition: ComponentPlugin.h:68
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:52
armarx::control::components::control_skill_provider::Component::GetDefaultName
static std::string GetDefaultName()
Get the component's default name.
Definition: Component.cpp:136
armarx::SkillProviderComponentPluginUser::addCustomSkillFactory
requires skills::isSkillBlueprint< FacT > FacT * addCustomSkillFactory(Args &&... args)
Definition: SkillProviderComponentPlugin.h:181
HomePose.h
armarx::control::skills::skills::GuidingWithCollAvoidance::Services
Definition: GuidingWithCollAvoidance.h:26
ShapeHand.h
armarx::control::client::ComponentPluginUser::getControlComponentPlugin
ComponentPlugin & getControlComponentPlugin()
Definition: ComponentPlugin.cpp:68
GuidingWithCollAvoidance.h
ZeroPose.h
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:79
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:42
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:21
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:36
armarx::control::skills::skills::GuidingWithCollAvoidance::Services::controlComponentPluginUser
::armarx::control::client::ComponentPlugin * controlComponentPluginUser
Definition: GuidingWithCollAvoidance.h:28