13 armarx::grasping::BoundingBox&
bo)
21 const armarx::grasping::BoundingBox&
bo)
32 armarx::grasping::GraspCandidateSourceInfo&
bo)
35 bo.bbox =
new BoundingBox();
42 bo.referenceObjectName = dto.referenceObjectName;
43 if (dto.referenceObjectPose)
45 bo.referenceObjectPose =
toIce(dto.referenceObjectPose.value());
48 bo.referenceObjectPose =
nullptr;
49 bo.segmentationLabelID = dto.segmentationLabelID;
54 const armarx::grasping::GraspCandidateSourceInfo&
bo)
59 dto.bbox = arondto::BoundingBox();
62 dto.referenceObjectName =
bo.referenceObjectName;
63 if (
bo.referenceObjectPose)
65 dto.referenceObjectPose =
fromIce(
bo.referenceObjectPose);
67 dto.segmentationLabelID =
bo.segmentationLabelID;
72 armarx::grasping::GraspCandidateReachabilityInfo&
bo)
75 bo = GraspCandidateReachabilityInfo(dto.reachable,
76 dto.minimumJointLimitMargin,
77 dto.jointLimitMargins,
84 const armarx::grasping::GraspCandidateReachabilityInfo&
bo)
87 dto.jointLimitMargins =
bo.jointLimitMargins;
88 dto.maxOriError =
bo.maxOriError;
89 dto.maxPosError =
bo.maxPosError;
90 dto.minimumJointLimitMargin =
bo.minimumJointLimitMargin;
91 dto.reachable =
bo.reachable;
96 armarx::grasping::GraspCandidate&
bo)
99 bo = GraspCandidate();
100 bo.graspPose =
toIce(dto.graspPose);
101 bo.robotPose =
toIce(dto.robotPose);
102 bo.tcpPoseInHandRoot = dto.tcpPoseInHandRoot ?
toIce(dto.tcpPoseInHandRoot.value()) : nullptr;
103 bo.approachVector = dto.approachVector ?
toIce(dto.approachVector.value()) : nullptr;
104 bo.sourceFrame = dto.sourceFrame;
105 bo.targetFrame = dto.targetFrame;
107 bo.graspSuccessProbability =
108 dto.graspSuccessProbability ? dto.graspSuccessProbability.value() : -1.0;
110 if (dto.executionHints)
112 bo.executionHints =
new GraspCandidateExecutionHints();
113 fromAron(dto.executionHints.value(), *
bo.executionHints);
117 bo.executionHints =
nullptr;
119 bo.groupNr = dto.groupNr ? dto.groupNr.value() : -1;
120 bo.providerName = dto.providerName;
121 if (dto.reachabilityInfo)
123 bo.reachabilityInfo =
new GraspCandidateReachabilityInfo();
124 fromAron(dto.reachabilityInfo.value(), *
bo.reachabilityInfo);
128 bo.reachabilityInfo =
nullptr;
132 bo.sourceInfo =
new GraspCandidateSourceInfo();
133 fromAron(dto.sourceInfo.value(), *
bo.sourceInfo);
137 bo.sourceInfo =
nullptr;
143 const armarx::grasping::GraspCandidate&
bo)
146 if (
bo.approachVector)
148 dto.approachVector =
fromIce(
bo.approachVector);
150 if (
bo.executionHints)
152 dto.executionHints = arondto::GraspCandidateExecutionHints();
153 toAron(dto.executionHints.value(), *
bo.executionHints);
157 dto.executionHints = std::nullopt;
160 if (
bo.graspSuccessProbability < 0 ||
bo.graspSuccessProbability > 1.0)
162 dto.graspSuccessProbability = std::nullopt;
166 dto.graspSuccessProbability =
bo.graspSuccessProbability;
170 dto.groupNr = std::nullopt;
174 dto.groupNr =
bo.groupNr;
176 toAron(dto.objectType,
bo.objectType);
177 dto.providerName =
bo.providerName;
178 if (
bo.reachabilityInfo)
180 dto.reachabilityInfo = arondto::GraspCandidateReachabilityInfo();
181 toAron(dto.reachabilityInfo.value(), *
bo.reachabilityInfo);
185 dto.reachabilityInfo = std::nullopt;
188 if (
bo.tcpPoseInHandRoot)
190 dto.tcpPoseInHandRoot =
fromIce(
bo.tcpPoseInHandRoot);
194 dto.sourceFrame =
bo.sourceFrame;
197 dto.sourceInfo = arondto::GraspCandidateSourceInfo();
198 toAron(dto.sourceInfo.value(), *
bo.sourceInfo);
202 dto.sourceInfo = std::nullopt;
204 dto.targetFrame =
bo.targetFrame;
209 armarx::grasping::BimanualGraspCandidate&
bo)
212 bo = BimanualGraspCandidate();
213 bo.graspPoseRight =
toIce(dto.graspPoseRight);
214 bo.graspPoseLeft =
toIce(dto.graspPoseLeft);
215 bo.robotPose =
toIce(dto.robotPose);
216 bo.tcpPoseInHandRootRight =
217 dto.tcpPoseInHandRootRight ?
toIce(dto.tcpPoseInHandRootRight.value()) : nullptr;
218 bo.tcpPoseInHandRootLeft =
219 dto.tcpPoseInHandRootLeft ?
toIce(dto.tcpPoseInHandRootLeft.value()) : nullptr;
220 bo.approachVectorRight =
221 dto.approachVectorRight ?
toIce(dto.approachVectorRight.value()) : nullptr;
222 bo.approachVectorLeft =
223 dto.approachVectorLeft ?
toIce(dto.approachVectorLeft.value()) : nullptr;
224 bo.inwardsVectorRight =
toIce(dto.inwardsVectorRight);
225 bo.inwardsVectorLeft =
toIce(dto.inwardsVectorLeft);
226 bo.sourceFrame = dto.sourceFrame;
227 bo.targetFrame = dto.targetFrame;
229 if (dto.executionHintsRight)
231 bo.executionHintsRight =
new GraspCandidateExecutionHints();
232 fromAron(dto.executionHintsRight.value(), *
bo.executionHintsRight);
236 bo.executionHintsRight =
nullptr;
238 if (dto.executionHintsLeft)
240 bo.executionHintsLeft =
new GraspCandidateExecutionHints();
241 fromAron(dto.executionHintsLeft.value(), *
bo.executionHintsLeft);
245 bo.executionHintsLeft =
nullptr;
247 bo.groupNr = dto.groupNr ? dto.groupNr.value() : -1;
248 bo.providerName = dto.providerName;
249 if (dto.reachabilityInfoRight)
251 bo.reachabilityInfoRight =
new GraspCandidateReachabilityInfo();
252 fromAron(dto.reachabilityInfoRight.value(), *
bo.reachabilityInfoRight);
256 bo.reachabilityInfoRight =
nullptr;
258 if (dto.reachabilityInfoLeft)
260 bo.reachabilityInfoLeft =
new GraspCandidateReachabilityInfo();
261 fromAron(dto.reachabilityInfoLeft.value(), *
bo.reachabilityInfoLeft);
265 bo.reachabilityInfoLeft =
nullptr;
269 bo.sourceInfo =
new GraspCandidateSourceInfo();
270 fromAron(dto.sourceInfo.value(), *
bo.sourceInfo);
274 bo.sourceInfo =
nullptr;
276 bo.graspName = dto.graspName;
281 const armarx::grasping::BimanualGraspCandidate&
bo)
283 if (
bo.tcpPoseInHandRootRight)
285 dto.tcpPoseInHandRootRight =
fromIce(
bo.tcpPoseInHandRootRight);
287 if (
bo.tcpPoseInHandRootLeft)
289 dto.tcpPoseInHandRootLeft =
fromIce(
bo.tcpPoseInHandRootLeft);
291 if (
bo.approachVectorRight)
293 dto.approachVectorRight =
fromIce(
bo.approachVectorRight);
295 if (
bo.approachVectorLeft)
297 dto.approachVectorLeft =
fromIce(
bo.approachVectorLeft);
299 if (
bo.executionHintsRight)
301 dto.executionHintsRight = arondto::GraspCandidateExecutionHints();
302 toAron(dto.executionHintsRight.value(), *
bo.executionHintsRight);
306 dto.executionHintsRight = std::nullopt;
308 if (
bo.executionHintsLeft)
310 dto.executionHintsLeft = arondto::GraspCandidateExecutionHints();
311 toAron(dto.executionHintsLeft.value(), *
bo.executionHintsLeft);
315 dto.executionHintsLeft = std::nullopt;
317 dto.graspPoseRight =
fromIce(
bo.graspPoseRight);
318 dto.graspPoseLeft =
fromIce(
bo.graspPoseLeft);
321 dto.groupNr = std::nullopt;
325 dto.groupNr =
bo.groupNr;
327 toAron(dto.objectType,
bo.objectType);
328 dto.providerName =
bo.providerName;
329 if (
bo.reachabilityInfoRight)
331 dto.reachabilityInfoRight = arondto::GraspCandidateReachabilityInfo();
332 toAron(dto.reachabilityInfoRight.value(), *
bo.reachabilityInfoRight);
336 dto.reachabilityInfoRight = std::nullopt;
338 if (
bo.reachabilityInfoLeft)
340 dto.reachabilityInfoLeft = arondto::GraspCandidateReachabilityInfo();
341 toAron(dto.reachabilityInfoLeft.value(), *
bo.reachabilityInfoLeft);
345 dto.reachabilityInfoLeft = std::nullopt;
348 dto.sourceFrame =
bo.sourceFrame;
351 dto.sourceInfo = arondto::GraspCandidateSourceInfo();
352 toAron(dto.sourceInfo.value(), *
bo.sourceInfo);
356 dto.sourceInfo = std::nullopt;
358 dto.targetFrame =
bo.targetFrame;
359 dto.inwardsVectorRight =
fromIce(
bo.inwardsVectorRight);
360 dto.inwardsVectorLeft =
fromIce(
bo.inwardsVectorLeft);
361 dto.graspName =
bo.graspName;
366 armarx::grasping::GraspCandidateExecutionHints&
bo)
368 bo = GraspCandidateExecutionHints();
371 bo.graspTrajectoryName = dto.graspTrajectoryName;
376 const armarx::grasping::GraspCandidateExecutionHints&
bo)
380 dto.graspTrajectoryName =
bo.graspTrajectoryName;
385 armarx::grasping::ApproachType&
bo)
389 case arondto::ApproachType::AnyApproach:
390 bo = ApproachType::AnyApproach;
392 case arondto::ApproachType::TopApproach:
393 bo = ApproachType::TopApproach;
395 case arondto::ApproachType::SideApproach:
396 bo = ApproachType::SideApproach;
404 const armarx::grasping::ApproachType&
bo)
408 case ApproachType::AnyApproach:
409 dto.value = arondto::ApproachType::AnyApproach;
411 case ApproachType::TopApproach:
412 dto.value = arondto::ApproachType::TopApproach;
414 case ApproachType::SideApproach:
415 dto.value = arondto::ApproachType::SideApproach;
423 armarx::grasping::ApertureType&
bo)
427 case arondto::ApertureType::AnyAperture:
428 bo = ApertureType::AnyAperture;
430 case arondto::ApertureType::OpenAperture:
431 bo = ApertureType::OpenAperture;
433 case arondto::ApertureType::PreshapedAperture:
434 bo = ApertureType::PreshapedAperture;
442 const armarx::grasping::ApertureType&
bo)
446 case ApertureType::AnyAperture:
447 dto.value = arondto::ApertureType::AnyAperture;
449 case ApertureType::OpenAperture:
450 dto.value = arondto::ApertureType::OpenAperture;
452 case ApertureType::PreshapedAperture:
453 dto.value = arondto::ApertureType::PreshapedAperture;