7 #include <Eigen/Geometry>
9 #include <SimoxUtility/algorithm/get_map_keys_values.h>
10 #include <SimoxUtility/algorithm/string.h>
11 #include <VirtualRobot/XML/BaseIO.h>
25 #include <RobotAPI/libraries/GraspingUtility/aron/GraspCandidate.aron.generated.h>
31 #include <RobotAPI/libraries/armem_grasping/aron/KnownGraspCandidate.aron.generated.h>
43 defs->topic(debugObserver);
45 defs->optional(enableRemoteGui,
"remoteGui.enable",
"Enable/Disable Remote GUI");
46 defs->optional(gui.trackNewEntities,
47 "EnableTrackingOfNewEntities",
48 "Enable/Disable the automatic visual tracking of newly commited Entities");
50 defs->optional(enableVisualizeKnownGraspCandidates,
51 "p.enableVisualizeKnownGraspCandidates");
52 defs->optional(enableVisualizeKnownGraspCandidatesPreposes,
53 "p.enableVisualizeKnownGraspCandidatesPreposes");
54 defs->optional(enableVisualizeKnownGraspCandidatesApproach,
55 "p.enableVisualizeKnownGraspCandidatesApproach");
57 defs->optional(frequencyHzVisualizeKnownGraspCandidates,
58 "p.frequencyHzVisualizeKnownGraspCandidates");
79 armarx::grasping::arondto::GraspCandidate::ToAronType());
81 "BimanualGraspCandidate",
82 armarx::grasping::arondto::BimanualGraspCandidate::ToAronType());
84 "KnownGraspCandidate", armarx::armem::grasping::arondto::KnownGraspInfo::ToAronType());
86 knownGraspProviderSegment.
init();
100 taskVisuKnownGrasps =
102 taskVisuKnownGrasps->start();
108 if (taskVisuKnownGrasps)
110 taskVisuKnownGrasps->stop();
111 taskVisuKnownGrasps =
nullptr;
116 for (
auto& [_, layer] : graspVisuPerObject)
119 layer.markForDeletion();
122 arviz.
commit(simox::alg::get_values(graspVisuPerObject));
123 graspVisuPerObject.clear();
134 armem::data::CommitResult
137 std::vector<armem::MemoryID> trackedEntityIds;
139 std::unique_lock lock(gui.visualizationMutex);
140 trackedEntityIds = gui.trackedEntityIds;
143 if (!trackedEntityIds.empty())
149 if (std::find(trackedEntityIds.begin(), trackedEntityIds.end(), entityID) !=
150 trackedEntityIds.end())
153 [
this](
const auto& instance) { removeInstanceFromVisu(instance.id()); });
158 if (gui.trackNewEntities)
166 std::unique_lock lock(gui.visualizationMutex);
167 gui.trackedEntityIds.emplace_back(entityID);
168 trackedEntityIds.emplace_back(entityID);
175 gui.tab.rebuild =
true;
178 if (!trackedEntityIds.empty())
184 if (std::find(trackedEntityIds.begin(), trackedEntityIds.end(), entityID) !=
185 trackedEntityIds.end())
188 [
this](
const auto& instance) { addInstanceToVisu(instance.id()); });
199 armem::actions::data::GetActionsOutputSeq
202 using namespace armem::actions;
204 GetActionsOutputSeq outputs;
205 for (
const auto&
input : inputs)
216 std::vector<MenuEntry> actions;
222 if (std::find(gui.trackedEntityIds.begin(),
223 gui.trackedEntityIds.end(),
224 memoryID) == gui.trackedEntityIds.end())
226 actions.push_back(Action{
"track",
"Track this entity in arviz"});
231 Action{
"untrack",
"Stop tracking this entity in arviz"});
237 Action{
"track",
"Track all underlying entities in arviz"});
239 Action{
"untrack",
"Stop tracking all underlying entities in arviz"});
243 actions.push_back(Action{
"vis",
"Visualize all contained grasp candidates"});
245 Action{
"rem",
"Remove all contained grasp candidates from visualization"});
246 actions.push_back(SubMenu{
"high",
247 "Highlight all contain grasp candidates",
248 {Action{
"pink",
"in pink"},
249 Action{
"red",
"in red"},
250 Action{
"blue",
"in blue"},
251 Action{
"yellow",
"in yellow"},
252 Action{
"purple",
"in purple"}}});
253 actions.push_back(Action{
"reset",
"Reset highlight layer"});
256 outputs.push_back({menu.toIce()});
263 armem::actions::data::ExecuteActionOutputSeq
266 using namespace armem::actions;
267 ExecuteActionOutputSeq outputs;
269 for (
const auto&
input : inputs)
272 if (
input.actionPath == ActionPath{
"vis"} ||
input.actionPath == ActionPath{
"rem"})
282 std::stringstream sstream;
283 sstream <<
"Currently visualization for CoreSegment "
285 outputs.emplace_back(
false, sstream.str());
291 if (
input.actionPath == ActionPath{
"vis"})
295 else if (
input.actionPath == ActionPath{
"rem"})
303 [
this, &
input](
const auto& instance)
305 if (
input.actionPath == ActionPath{
"vis"})
307 addInstanceToVisu(instance.id());
309 else if (
input.actionPath == ActionPath{
"rem"})
311 removeInstanceFromVisu(instance.id());
318 [
this, &
input](
const auto& instance)
320 if (
input.actionPath == ActionPath{
"vis"})
322 addInstanceToVisu(instance.id());
324 else if (
input.actionPath == ActionPath{
"rem"})
326 removeInstanceFromVisu(instance.id());
333 [
this, &
input](
const auto& instance)
335 if (
input.actionPath == ActionPath{
"vis"})
337 addInstanceToVisu(instance.id());
339 else if (
input.actionPath == ActionPath{
"rem"})
341 removeInstanceFromVisu(instance.id());
347 if (
input.actionPath == ActionPath{
"rem"})
349 std::unique_lock lock(gui.visualizationMutex);
350 gui.visibleInstanceIds.clear();
352 for (std::string& layer : gui.activeLayers)
357 gui.activeLayers.clear();
359 else if (
input.actionPath == ActionPath{
"vis"})
364 .forEachInstance([
this](
const auto& instance)
365 { addInstanceToVisu(instance.id()); });
369 visualizeGraspCandidates();
370 outputs.emplace_back(
true,
"");
376 std::stringstream sstream;
378 <<
" does not refer to a valid Grasp Memory Part.";
379 outputs.emplace_back(
false, sstream.str());
382 else if (
input.actionPath == ActionPath{
"track"} ||
383 input.actionPath == ActionPath{
"untrack"})
385 std::vector<armem::MemoryID> entityIDs;
393 [&entityIDs](
const auto& entity) { entityIDs.emplace_back(entity.id()); });
400 .forEachEntity([&entityIDs](
const auto& entity)
401 { entityIDs.emplace_back(entity.id()); });
403 for (
auto& entityID : entityIDs)
405 if (
input.actionPath == ActionPath{
"track"})
409 [
this](
const auto& instance) { addInstanceToVisu(instance.id()); });
410 gui.trackedEntityIds.push_back(entityID);
412 outputs.emplace_back(
true,
"");
414 else if (
input.actionPath == ActionPath{
"untrack"})
416 auto pos = std::find(
417 gui.trackedEntityIds.begin(), gui.trackedEntityIds.end(), entityID);
418 if (pos != gui.trackedEntityIds.end())
420 gui.trackedEntityIds.erase(pos);
423 outputs.emplace_back(
true,
"");
427 else if (
input.actionPath.front() ==
"high")
431 else if (
input.actionPath == ActionPath{
"reset"})
437 std::stringstream sstream;
438 sstream <<
"Action path " <<
input.actionPath <<
" is not defined.";
439 outputs.emplace_back(
false, sstream.str());
453 gui.tab.selectAll.setLabel(
"Select All");
454 gui.tab.deselectAll.setLabel(
"Deselect All");
455 gui.tab.showUnlimitedInstances.setValue(gui.unlimitedInstances);
456 gui.tab.maxInstances.setRange(0, 1000);
457 gui.tab.maxInstances.setValue(gui.maxInstances);
483 std::vector<std::string> options =
487 options.push_back(
"<None>");
491 options.insert(options.begin(),
"<All>");
494 gui.tab.selectProvider.setOptions(options);
496 if (gui.providerIndex >= 0 &&
497 gui.providerIndex <
static_cast<int>(options.size()))
499 gui.tab.selectProvider.setIndex(gui.providerIndex);
500 gui.provider = options[gui.providerIndex];
502 root.
add(gui.tab.selectProvider,
Pos{row, 0});
507 .getCoreSegment(gui.coreSegment)
510 std::vector<MemoryID> providers;
514 std::vector<std::string> options;
516 if (gui.provider ==
"<All>")
520 .forEachProviderSegment([&providers](
const auto& provider)
521 { providers.push_back(provider.id()); });
528 for (
MemoryID& provider : providers)
530 for (std::string& entity :
531 workingMemory().getProviderSegment(provider).getEntityNames())
533 options.push_back(entity);
538 options.push_back(
"<None>");
542 options.insert(options.begin(),
"<All>");
544 gui.tab.selectEntity.setOptions(options);
545 if (gui.entityIndex >= 0 &&
546 gui.entityIndex <
static_cast<int>(options.size()))
548 gui.tab.selectEntity.setIndex(gui.entityIndex);
549 gui.entity = options[gui.entityIndex];
551 root.
add(gui.tab.selectEntity,
Pos{row, 0});
555 if (gui.entity ==
"<All>" ||
556 (gui.provider ==
"<All>" &&
559 .getCoreSegment(gui.coreSegment)
561 .hasEntity(gui.entity))
563 std::vector<MemoryID> entities;
567 std::vector<std::string> options;
568 for (
MemoryID& provider : providers)
570 if (gui.entity ==
"<All>")
573 [&entities](
auto& entity)
574 { entities.push_back(entity.id()); });
583 provider.providerSegmentName,
592 [
this, &options](
const auto& snapshot)
596 gui.timeMap[time] = snapshot.time();
597 options.push_back(time);
603 options.push_back(
"<None>");
607 options.insert(options.begin(),
"<All>");
609 gui.tab.selectSnapshot.setOptions(options);
610 if (gui.snapshotIndex >= 0 &&
611 gui.snapshotIndex <
static_cast<int>(options.size()))
613 gui.tab.selectSnapshot.setIndex(gui.snapshotIndex);
614 if (options[gui.snapshotIndex] !=
"<None>")
616 gui.snapshot = options[gui.snapshotIndex];
619 root.
add(gui.tab.selectSnapshot,
Pos{row, 0});
623 if (gui.snapshot ==
"<All>")
632 gui.timeMap.at(gui.snapshot)))
642 root.
add(
Label(
"Show all Instances"),
Pos{row, 0});
643 root.
add(gui.tab.showUnlimitedInstances,
Pos{row, 1});
645 root.
add(
Label(
"Limit for shown Instances"),
Pos{row, 0});
646 root.
add(gui.tab.maxInstances,
Pos{row, 1});
648 root.
add(gui.tab.selectAll,
Pos{row, 0});
650 root.
add(gui.tab.deselectAll,
Pos{row, 0});
652 gui.tab.checkInstances.clear();
653 std::vector<MemoryID> snapshots;
656 if (gui.snapshot ==
"<All>")
659 [&snapshots](
auto& snapshot)
660 { snapshots.push_back(snapshot.id()); });
665 gui.timeMap.at(gui.snapshot)))
670 .getSnapshot(gui.timeMap.at(gui.snapshot))
676 for (
MemoryID& snapshot : snapshots)
679 [
this, &row, &root, &instances](
const auto& instance)
681 if (gui.unlimitedInstances || instances < gui.maxInstances)
683 std::unique_lock lock(gui.visualizationMutex);
684 root.add(Label(instance.id().str()), Pos{row, 0});
685 gui.tab.checkInstances[instance.id().str()] =
687 if (std::find(gui.visibleInstanceIds.begin(),
688 gui.visibleInstanceIds.end(),
690 gui.visibleInstanceIds.end())
692 gui.tab.checkInstances.at(instance.id().str())
695 root.
add(gui.tab.checkInstances[instance.id().str()],
707 root.
add(
Label(
"Show all Instances"),
Pos{row, 0});
708 root.
add(gui.tab.showUnlimitedInstances,
Pos{row, 1});
710 root.
add(
Label(
"Limit for shown Instances"),
Pos{row, 0});
711 root.
add(gui.tab.maxInstances,
Pos{row, 1});
713 root.
add(gui.tab.selectAll,
Pos{row, 0});
715 root.
add(gui.tab.deselectAll,
Pos{row, 0});
717 gui.tab.checkInstances.clear();
722 gui.tab.checkInstances.clear();
724 std::vector<std::string> options = {
"<None>"};
726 gui.tab.selectSnapshot.setOptions(options);
730 root.
add(gui.tab.selectSnapshot,
Pos{row, 0});
732 root.
add(
Label(
"Show all Instances"),
Pos{row, 0});
733 root.
add(gui.tab.showUnlimitedInstances,
Pos{row, 1});
735 root.
add(
Label(
"Limit for shown Instances"),
Pos{row, 0});
736 root.
add(gui.tab.maxInstances,
Pos{row, 1});
738 root.
add(gui.tab.selectAll,
Pos{row, 0});
740 root.
add(gui.tab.deselectAll,
Pos{row, 0});
746 gui.tab.checkInstances.clear();
748 std::vector<std::string> options = {
"<None>"};
750 gui.tab.selectEntity.setOptions(options);
754 root.
add(gui.tab.selectEntity,
Pos{row, 0});
757 gui.tab.selectSnapshot.setOptions(options);
761 root.
add(gui.tab.selectSnapshot,
Pos{row, 0});
763 root.
add(
Label(
"Show all Instances"),
Pos{row, 0});
764 root.
add(gui.tab.showUnlimitedInstances,
Pos{row, 1});
766 root.
add(
Label(
"Limit for shown Instances"),
Pos{row, 0});
767 root.
add(gui.tab.maxInstances,
Pos{row, 1});
769 root.
add(gui.tab.selectAll,
Pos{row, 0});
771 root.
add(gui.tab.deselectAll,
Pos{row, 0});
777 gui.tab.checkInstances.clear();
779 std::vector<std::string> options = {
"<None>"};
780 gui.tab.selectProvider.setOptions(options);
784 root.
add(gui.tab.selectProvider,
Pos{row, 0});
787 gui.tab.selectEntity.setOptions(options);
791 root.
add(gui.tab.selectEntity,
Pos{row, 0});
794 gui.tab.selectSnapshot.setOptions(options);
798 root.
add(gui.tab.selectSnapshot,
Pos{row, 0});
800 root.
add(
Label(
"Show all Instances"),
Pos{row, 0});
801 root.
add(gui.tab.showUnlimitedInstances,
Pos{row, 1});
803 root.
add(
Label(
"Limit for shown Instances"),
Pos{row, 0});
804 root.
add(gui.tab.maxInstances,
Pos{row, 1});
806 root.
add(gui.tab.selectAll,
Pos{row, 0});
808 root.
add(gui.tab.deselectAll,
Pos{row, 0});
814 RemoteGui_createTab(getName(), root, &gui.tab);
815 gui.tab.rebuild =
false;
819 [](
const armarx::armem::grasping::arondto::KnownGraspSet& graspSet) -> std::string
821 ARMARX_VERBOSE <<
"Grasping with " << graspSet.robot <<
" and with the endeffector named"
822 << graspSet.endeffector;
824 if (graspSet.robot ==
"Armar6" or graspSet.robot ==
"ArmarDE" or graspSet.robot ==
"Armar7")
826 if (graspSet.endeffector ==
"TCP_R")
830 if (graspSet.endeffector ==
"TCP_L")
834 if (graspSet.endeffector ==
"Hand_R_EEF")
838 if (graspSet.endeffector ==
"Hand_L_EEF")
842 ARMARX_ERROR <<
"Unknown TCP `" << graspSet.endeffector <<
"` for robot `"
843 << graspSet.robot <<
"`!";
846 if (graspSet.robot ==
"Armar3")
848 if (graspSet.endeffector ==
"Hand R")
852 if (graspSet.endeffector ==
"Hand L")
856 ARMARX_ERROR <<
"Unknown TCP `" << graspSet.endeffector <<
"` for robot `"
857 << graspSet.robot <<
"`!";
860 ARMARX_ERROR <<
"Unknown TCP `" << graspSet.endeffector <<
"` for robot `" << graspSet.robot
862 throw std::exception();
866 armarx::armem::server::grasp::GraspMemory::visualizeKnownGraspCandidates()
868 if (not enableVisualizeKnownGraspCandidates)
875 while (not taskVisuKnownGrasps->isStopped())
879 const std::vector<robot_state::description::RobotDescription> robotDescriptions =
883 std::map<std::string, robot_state::description::RobotDescription>
885 for (
const auto& robotDescription : robotDescriptions)
887 robotDescriptionMap.emplace(robotDescription.name, robotDescription);
891 for (
const auto& robotDescription : robotDescriptions)
893 if (
robots.count(robotDescription.name) > 0)
900 if (
auto robot = VirtualRobot::RobotIO::loadRobot(
901 robotDescription.xml.toSystemPath(), VirtualRobot::BaseIO::eStructure))
903 ARMARX_INFO <<
"Loaded robot `" << robotDescription.name <<
"`";
904 robots.emplace(robotDescription.name, robot);
908 ARMARX_INFO <<
"Failed to load robot `" << robotDescription.name
909 <<
"` from file `" << robotDescription.xml.toSystemPath()
915 std::map<std::string, std::vector<armarx::armem::grasping::arondto::KnownGraspInfo>>
920 .getCoreSegment(
"KnownGraspCandidate")
922 [&graspsForObject](
const auto& entityInstance)
924 const armarx::armem::grasping::arondto::KnownGraspInfo dto =
925 armarx::armem::grasping::arondto::KnownGraspInfo::FromAron(
926 entityInstance.data());
928 const MemoryID memoryId = entityInstance.id();
931 graspsForObject[memoryId.entityName].push_back(dto);
936 for (
auto& [_, layer] : graspVisuPerObject)
943 const auto objects = getObjectPoses();
945 for (
const auto&
object : objects)
947 const std::string layerName =
object.objectID.str();
948 auto layer = arviz.layer(layerName);
951 const std::string objectClassName =
object.objectID.getClassID().str();
953 if (graspsForObject.count(objectClassName) == 0)
958 const auto& graspInfos = graspsForObject.at(objectClassName);
960 for (
const auto& graspInfo : graspInfos)
962 for (
const auto& [_, graspSet] : graspInfo.graspSets)
965 if (robotDescriptionMap.count(graspSet.robot) == 0)
970 const std::string side =
GetSide(graspSet);
971 const std::string bodyPartName = side +
"Hand";
973 const auto& robotDescription = robotDescriptionMap.at(graspSet.robot);
974 const auto& visuPart =
975 robotDescription.visualization.body_parts.at(bodyPartName);
980 for (
const auto& grasp : graspSet.grasps)
982 const std::string visuName = graspSet.robot +
"::" + graspSet.name +
983 "::" +
object.providerName +
984 "::" +
object.objectID.str() +
988 if (
robots.count(graspSet.robot) == 0)
993 const auto robot =
robots.at(graspSet.robot);
995 const auto handRootNode =
996 robot->getRobotNode(visuPart.root_node_name);
997 if (handRootNode ==
nullptr)
1000 <<
"` not available for robot `" << graspSet.robot
1005 const auto eefNode = robot->getEndEffector(graspSet.endeffector);
1006 if (eefNode ==
nullptr)
1008 ARMARX_INFO <<
"End-effector `" << graspSet.endeffector
1009 <<
"` not available for robot `" << graspSet.robot
1014 const auto tcp = eefNode->getTcp();
1017 ARMARX_INFO <<
"End-effector `" << graspSet.endeffector
1018 <<
"` does not provide a TCP";
1022 const Eigen::Isometry3f eef_T_hand_root{
1023 handRootNode->getPoseInFrame(tcp)};
1025 const Eigen::Isometry3f global_T_grasp_pose =
1026 Eigen::Isometry3f{
object.objectPoseGlobal} *
1027 Eigen::Isometry3f{grasp.pose}.inverse();
1031 viz::Robot graspHandVisu(visuName +
"_grasp");
1032 graspHandVisu.useCollisionModel()
1033 .file(visuRobotPartXML)
1035 Eigen::Isometry3f{global_T_grasp_pose * eef_T_hand_root}
1038 layer.add(graspHandVisu);
1042 if (grasp.prepose.has_value())
1044 const Eigen::Isometry3f global_T_prepose =
1045 Eigen::Isometry3f{
object.objectPoseGlobal} *
1046 Eigen::Isometry3f{grasp.prepose.value()}.inverse();
1049 if (enableVisualizeKnownGraspCandidatesPreposes)
1051 viz::Robot graspHandVisuPrepose(visuName +
"_prepose");
1052 graspHandVisuPrepose.useCollisionModel()
1053 .file(visuRobotPartXML)
1054 .pose(Eigen::Isometry3f{global_T_prepose *
1059 layer.add(graspHandVisuPrepose);
1063 if (enableVisualizeKnownGraspCandidatesApproach)
1067 .fromTo(global_T_prepose.translation(),
1068 global_T_grasp_pose.translation())
1078 graspVisuPerObject[layerName] = layer;
1081 arviz.commit(simox::alg::get_values(graspVisuPerObject));
1084 metronome.waitForNextTick();
1089 armarx::armem::server::grasp::GraspMemory::visualizeGraspCandidates()
1091 std::unique_lock lock(gui.visualizationMutex);
1093 std::map<std::string, viz::Layer> reachableLayers;
1094 std::map<std::string, viz::Layer> unreachableLayers;
1098 for (
auto& element : gui.visibleInstanceIds)
1100 std::string entityName = element.entityName;
1102 if (reachableLayers.find(entityName) == reachableLayers.end())
1104 reachableLayers[entityName] = arviz.layer(entityName +
"_reachable");
1105 unreachableLayers[entityName] = arviz.layer(entityName +
"_unreachable");
1106 gui.activeLayers.push_back(entityName);
1109 armarx::grasping::GraspCandidate candidate;
1111 armarx::grasping::arondto::GraspCandidate aronTransform;
1113 aronTransform.fromAron(workingMemory().getInstance(element).
data());
1115 fromAron(aronTransform, candidate);
1119 reachableLayers.at(entityName),
1120 unreachableLayers.at(entityName));
1124 std::vector<viz::Layer> layers;
1125 for (
auto& [entityName, layer] : reachableLayers)
1127 layers.push_back(layer);
1128 layers.push_back(unreachableLayers.at(entityName));
1130 arviz.commit(layers);
1134 armarx::armem::server::grasp::GraspMemory::addInstanceToVisu(
1137 std::unique_lock lock(gui.visualizationMutex);
1139 std::find(gui.visibleInstanceIds.begin(), gui.visibleInstanceIds.end(), instance);
1141 if (position == gui.visibleInstanceIds.end())
1143 gui.visibleInstanceIds.push_back(instance);
1148 armarx::armem::server::grasp::GraspMemory::removeInstanceFromVisu(
1151 std::unique_lock lock(gui.visualizationMutex);
1153 std::find(gui.visibleInstanceIds.begin(), gui.visibleInstanceIds.end(), instance);
1155 if (position != gui.visibleInstanceIds.end())
1157 gui.visibleInstanceIds.erase(position);
1161 std::string entityName = instance.
entityName;
1163 if (std::none_of(gui.visibleInstanceIds.begin(),
1164 gui.visibleInstanceIds.end(),
1166 { return id.entityName == entityName; }))
1168 arviz.commitDeleteLayer(entityName +
"_reachable");
1169 arviz.commitDeleteLayer(entityName +
"_unreachable");
1172 auto layerPos = std::find(gui.activeLayers.begin(), gui.activeLayers.end(), entityName);
1174 if (layerPos != gui.activeLayers.end())
1176 gui.activeLayers.erase(layerPos);
1181 GraspMemory::addToHighlightLayer(
const MemoryID&
memoryID,
const std::string color)
1185 if (color ==
"pink")
1189 else if (color ==
"red")
1193 else if (color ==
"blue")
1197 else if (color ==
"yellow")
1201 else if (color ==
"purple")
1206 viz::Layer highlightLayer = arviz.layer((
"HighlightedGrasps"));
1209 std::vector<armem::MemoryID> instances;
1217 workingMemory().getSnapshot(
memoryID).forEachInstance(
1218 [&instances](
const auto& instance) { instances.push_back(instance.id()); });
1222 workingMemory().getEntity(
memoryID).forEachInstance(
1223 [&instances](
const auto& instance) { instances.push_back(instance.id()); });
1227 workingMemory().getProviderSegment(
memoryID).forEachInstance(
1228 [&instances](
const auto& instance) { instances.push_back(instance.id()); });
1234 .getCoreSegment(
"GraspCandidate")
1235 .forEachInstance([&instances](
const auto& instance)
1236 { instances.push_back(instance.id()); });
1239 armarx::grasping::GraspCandidate candidate;
1241 armarx::grasping::arondto::GraspCandidate aronTransform;
1245 aronTransform.fromAron(workingMemory().getInstance(instance).
data());
1247 fromAron(aronTransform, candidate);
1251 hand.color(handColor);
1252 highlightLayer.
add(hand);
1255 arviz.commit(highlightLayer);
1259 GraspMemory::RemoteGui_update()
1271 if (gui.tab.selectProvider.hasValueChanged())
1273 gui.provider = gui.tab.selectProvider.getValue();
1274 gui.providerIndex = gui.tab.selectProvider.getIndex();
1275 gui.entityIndex = 0;
1276 gui.snapshotIndex = 0;
1277 gui.tab.rebuild =
true;
1280 if (gui.tab.selectEntity.hasValueChanged())
1282 gui.entity = gui.tab.selectEntity.getValue();
1283 gui.entityIndex = gui.tab.selectEntity.getIndex();
1284 gui.snapshotIndex = 0;
1285 gui.tab.rebuild =
true;
1288 if (gui.tab.selectSnapshot.hasValueChanged())
1290 gui.snapshot = gui.tab.selectSnapshot.getValue();
1291 gui.snapshotIndex = gui.tab.selectSnapshot.getIndex();
1292 gui.tab.rebuild =
true;
1295 if (gui.tab.showUnlimitedInstances.hasValueChanged())
1297 gui.unlimitedInstances = gui.tab.showUnlimitedInstances.getValue();
1298 gui.tab.rebuild =
true;
1301 if (gui.tab.maxInstances.hasValueChanged())
1303 gui.maxInstances = gui.tab.maxInstances.getValue();
1304 gui.tab.rebuild =
true;
1307 if (gui.tab.selectAll.wasClicked())
1309 for (
auto& element : gui.tab.checkInstances)
1311 element.second.setValue(
true);
1315 if (gui.tab.deselectAll.wasClicked())
1317 for (
auto& element : gui.tab.checkInstances)
1319 element.second.setValue(
false);
1323 for (
auto& element : gui.tab.checkInstances)
1325 if (element.second.hasValueChanged())
1327 if (element.second.getValue())
1338 visualizeGraspCandidates();
1340 if (gui.tab.rebuild)
1343 createRemoteGuiTab();