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 <<
" found! ";
140 ARMARX_INFO <<
"Using grasp: " << graspSetSelection.graspSetName;
148 skills::hand_control::arondto::OpenHandAcceptedType params;
149 params.kinematicChainName = kinematicChainSelection.kinematicChainName;
163 skills::grasp_object::arondto::MovePlatformForGraspAcceptedType params;
164 params.robotName = in.parameters.robotName;
165 params.orientationalAccuracy = in.parameters.platformOrientationalAccuracy;
166 params.positionalAccuracy = in.parameters.platformPositionalAccuracy;
167 params.objectEntityId = in.parameters.objectEntityId;
168 params.tcpName = kinematicChainSelection.tcpName;
181 skills::grasp_object::arondto::ExecuteGraspAcceptedType params;
182 params.robotName = in.parameters.robotName;
183 params.graspSetName = graspSetSelection.graspSetName;
184 params.objectEntityId = in.parameters.objectEntityId;
185 params.kinematicChainName = kinematicChainSelection.kinematicChainName;
186 params.orientationalAccuracy = in.parameters.tcpOrientationalAccuracy;
187 params.positionalAccuracy = in.parameters.tcpPositionalAccuracy;
200 skills::grasp_object::arondto::CloseHandAndAttachAcceptedType params;
201 params.kinematicChainName = kinematicChainSelection.kinematicChainName;
202 params.objectEntityId = in.parameters.objectEntityId;
203 params.robotName = in.parameters.robotName;
219 robot->getRobotNode(kinematicChainSelection.tcpName)->getGlobalPose();
221 auto targetTCPPoseGlobal = tcpPoseGlobal;
222 targetTCPPoseGlobal(2, 3) += 100;
224 skills::tcp_control::arondto::MoveTCPToTargetPoseAcceptedType params;
225 params.robotName = in.parameters.robotName;
226 params.kinematicChainName = kinematicChainSelection.kinematicChainName;
227 params.targetPoseGlobal = targetTCPPoseGlobal;
228 params.orientationalAccuracy = in.parameters.tcpOrientationalAccuracy;
229 params.positionalAccuracy = in.parameters.tcpPositionalAccuracy;
244 skills::joint_control::arondto::MoveJointsToPositionAcceptedType params;
245 params.robotName = in.parameters.robotName;
246 params.jointTargetTolerance = 0.03;
247 params.jointMaxSpeed = 0.75;
248 params.accelerationTime = 500;
249 params.setVelocitiesToZeroAtEnd =
true;
251 for (
const auto& j : robot->getRobotNodeSet(kinematicChainSelection.kinematicChainName)
252 ->getAllRobotNodes())
254 params.targetJointMap[j->getName()] = 0.0;
270 skills::grasp_object::arondto::MovePlatformAfterGraspAcceptedType params;
271 params.robotName = in.parameters.robotName;
272 params.orientationalAccuracy = in.parameters.platformOrientationalAccuracy;
273 params.positionalAccuracy = in.parameters.platformPositionalAccuracy;