3 #include <VirtualRobot/Grasping/GraspSet.h>
4 #include <VirtualRobot/ManipulationObject.h>
5 #include <VirtualRobot/RobotNodeSet.h>
8 #include <RobotAPI/libraries/skills/provider/SkillProxy.h>
16 grasp_object::arondto::GraspObjectAcceptedType
17 GetDefaultParameterization()
19 grasp_object::arondto::GraspObjectAcceptedType
ret;
20 ret.platformOrientationalAccuracy = 0.1;
21 ret.platformPositionalAccuracy = 10;
22 ret.tcpOrientationalAccuracy = 0.1;
23 ret.tcpPositionalAccuracy = 20;
29 SkillDescription{
"GraspObject",
33 grasp_object::arondto::GraspObjectAcceptedType::ToAronType(),
34 GetDefaultParameterization().toAron()};
52 robotReader.connect();
53 objectReader.connect();
54 graspReader.connect();
55 objectWriter.connect();
61 robotReader.getSynchronizedRobot(in.parameters.robotName,
63 VirtualRobot::RobotIO::RobotDescription::eStructure);
72 skills::visual_search::arondto::WhatCanYouSeeNowAcceptedType params;
73 params.robotName = in.parameters.robotName;
74 params.objectEntityId = in.parameters.objectEntityId;
90 auto objInstance = objectReader.queryLatestObjectInstance(in.parameters.objectEntityId);
100 auto graspInfo = graspReader.queryKnownGraspInfoByEntityName(in.parameters.objectEntityId,
111 auto kinematicChainSelection =
113 {*objInstance, *robot});
114 if (kinematicChainSelection.kinematicChainName.empty())
121 ARMARX_INFO <<
"Using kinematic chain: " << kinematicChainSelection.kinematicChainName;
129 robot->getRobotNodeSet(kinematicChainSelection.kinematicChainName)
133 if (graspSetSelection.graspSetName.empty())
135 ARMARX_ERROR <<
"No grasp info for object " << in.parameters.objectEntityId
141 ARMARX_INFO <<
"Using grasp: " << graspSetSelection.graspSetName;
149 skills::hand_control::arondto::OpenHandAcceptedType params;
150 params.kinematicChainName = kinematicChainSelection.kinematicChainName;
164 skills::grasp_object::arondto::MovePlatformForGraspAcceptedType params;
165 params.robotName = in.parameters.robotName;
166 params.orientationalAccuracy = in.parameters.platformOrientationalAccuracy;
167 params.positionalAccuracy = in.parameters.platformPositionalAccuracy;
168 params.objectEntityId = in.parameters.objectEntityId;
169 params.tcpName = kinematicChainSelection.tcpName;
182 skills::grasp_object::arondto::ExecuteGraspAcceptedType params;
183 params.robotName = in.parameters.robotName;
184 params.graspSetName = graspSetSelection.graspSetName;
185 params.objectEntityId = in.parameters.objectEntityId;
186 params.kinematicChainName = kinematicChainSelection.kinematicChainName;
187 params.orientationalAccuracy = in.parameters.tcpOrientationalAccuracy;
188 params.positionalAccuracy = in.parameters.tcpPositionalAccuracy;
201 skills::grasp_object::arondto::CloseHandAndAttachAcceptedType params;
202 params.kinematicChainName = kinematicChainSelection.kinematicChainName;
203 params.objectEntityId = in.parameters.objectEntityId;
204 params.robotName = in.parameters.robotName;
220 robot->getRobotNode(kinematicChainSelection.tcpName)->getGlobalPose();
222 auto targetTCPPoseGlobal = tcpPoseGlobal;
223 targetTCPPoseGlobal(2, 3) += 100;
225 skills::tcp_control::arondto::MoveTCPToTargetPoseAcceptedType params;
226 params.robotName = in.parameters.robotName;
227 params.kinematicChainName = kinematicChainSelection.kinematicChainName;
228 params.targetPoseGlobal = targetTCPPoseGlobal;
229 params.orientationalAccuracy = in.parameters.tcpOrientationalAccuracy;
230 params.positionalAccuracy = in.parameters.tcpPositionalAccuracy;
245 skills::joint_control::arondto::MoveJointsToPositionAcceptedType params;
246 params.robotName = in.parameters.robotName;
247 params.jointTargetTolerance = 0.03;
248 params.jointMaxSpeed = 0.75;
249 params.accelerationTime = 500;
250 params.setVelocitiesToZeroAtEnd =
true;
252 for (
const auto& j : robot->getRobotNodeSet(kinematicChainSelection.kinematicChainName)
253 ->getAllRobotNodes())
255 params.targetJointMap[j->getName()] = 0.0;
271 skills::grasp_object::arondto::MovePlatformAfterGraspAcceptedType params;
272 params.robotName = in.parameters.robotName;
273 params.orientationalAccuracy = in.parameters.platformOrientationalAccuracy;
274 params.positionalAccuracy = in.parameters.platformPositionalAccuracy;