13 #include <VirtualRobot/ManipulationObject.h>
19 PriorKnowledgeInterfacePrx
const& priorKnowledge,
20 WorkingMemoryInterfacePrx
const& workingMemory,
29 this->robotStateComponent = robotStateComponent;
30 sharedRobot = robotStateComponent->getSynchronizedRobot();
32 objectInstancesSegment = workingMemory->getObjectInstancesSegment();
37 memoryx::EntityBaseList entities = objectInstancesSegment->getAllEntities();
38 std::vector<memoryx::ObjectInstancePtr> objectInstances;
39 for (
auto& entity : entities)
44 if (ids.empty() || ids.count(object->getId()))
46 objectInstances.push_back(
object);
51 std::vector<ObjectInstanceWrapper> result;
52 for (
auto& objectInstance : objectInstances)
54 std::string objectName = objectInstance->getName();
57 if (objectInstance->hasLocalizationTimestamp())
59 IceUtil::Time localizationTimestamp = objectInstance->getLocalizationTimestamp();
66 Eigen::Matrix4f globalPose = objectInstance->getPose()->toGlobalEigen(localRobot);
68 std::string objectClass = objectInstance->getMostProbableClass();
73 <<
" Skipping object '" << objectName <<
"'.";
78 VirtualRobot::ManipulationObjectPtr manipulationObject = entry->manipulationObject->clone(objectName);
79 manipulationObject->setGlobalPose(globalPose);
83 object.manipulationObject = manipulationObject;
84 result.push_back(
object);