3 #include <SimoxUtility/color/cmaps.h>
8 #include <RobotAPI/libraries/GraspingUtility/aron/GraspCandidate.aron.generated.h>
30 defs->topic(debugObserver);
32 defs->optional(memoryName,
"mem.MemoryName",
"Name of the memory to use.");
40 return "GraspProviderExample";
82 while (!task->isStopped() && i++ < 100)
86 candidate.groupNr = i;
92 bimanualCandidate.groupNr =
100 grasping::GraspCandidateSeq candidatesToWrite;
101 candidatesToWrite.push_back(
new grasping::GraspCandidate(candidate));
102 candidate.side =
"Left";
103 candidatesToWrite.push_back(
new grasping::GraspCandidate(candidate));
111 std::map<std::string, grasping::GraspCandidatePtr> candidates;
123 for (
auto& [
id, ca] : candidates)
125 ARMARX_INFO <<
"candidate with ID " <<
id <<
" has group number " << ca->groupNr;
128 std::map<std::string, grasping::BimanualGraspCandidatePtr> bimanualCandidates;
139 for (
auto& [
id, ca] : bimanualCandidates)
141 ARMARX_INFO <<
"bimanual candidate with ID " <<
id <<
" has group number "
149 grasping::GraspCandidate
152 armarx::grasping::GraspCandidate candidate = armarx::grasping::GraspCandidate();
154 candidate.approachVector = Vector3BasePtr(
toIce(zeroVector));
155 candidate.graspPose = PoseBasePtr(
toIce(identityMatrix));
156 candidate.providerName =
"Example";
157 candidate.side =
"Right";
158 candidate.robotPose = PoseBasePtr(
toIce(identityMatrix));
160 candidate.tcpPoseInHandRoot = PoseBasePtr(
toIce(identityMatrix));
163 candidate.sourceInfo =
new grasping::GraspCandidateSourceInfo();
164 candidate.sourceInfo->referenceObjectName =
"Box";
165 candidate.sourceInfo->bbox =
new grasping::BoundingBox();
166 candidate.sourceInfo->bbox->center = Vector3BasePtr(
toIce(zeroVector));
167 candidate.sourceInfo->bbox->ha1 = Vector3BasePtr(
toIce(zeroVector));
168 candidate.sourceInfo->bbox->ha2 = Vector3BasePtr(
toIce(zeroVector));
169 candidate.sourceInfo->bbox->ha3 = Vector3BasePtr(
toIce(zeroVector));
170 candidate.sourceInfo->referenceObjectPose = PoseBasePtr(
toIce(identityMatrix));
175 grasping::BimanualGraspCandidate
178 armarx::grasping::BimanualGraspCandidate bimanualCandidate =
179 armarx::grasping::BimanualGraspCandidate();
181 bimanualCandidate.approachVectorLeft = Vector3BasePtr(
toIce(zeroVector));
182 bimanualCandidate.approachVectorRight = Vector3BasePtr(
toIce(zeroVector));
185 bimanualCandidate.providerName =
"BimanualExample";
186 bimanualCandidate.robotPose = PoseBasePtr(
toIce(identityMatrix));
187 bimanualCandidate.tcpPoseInHandRootRight = PoseBasePtr(
toIce(identityMatrix));
188 bimanualCandidate.tcpPoseInHandRootLeft = PoseBasePtr(
toIce(identityMatrix));
189 bimanualCandidate.inwardsVectorLeft = Vector3BasePtr(
toIce(zeroVector));
190 bimanualCandidate.inwardsVectorRight = Vector3BasePtr(
toIce(zeroVector));
191 return bimanualCandidate;