45 workingMemoryProxy = getProxy<WorkingMemoryInterfacePrx>(
"WorkingMemory");
46 objectInstancesProxy = workingMemoryProxy->getObjectInstancesSegment();
51 return "OnTablePredicateProvider";
56 return PredicateInfo {
"ontable", 1};
61 PredicateInstanceList returnPIList;
75 std::vector<TableDef> tables;
76 tables.push_back(TableDef {
"table1", Eigen::Vector3f(-600, 600, 900), Eigen::Vector3f(600, 1500, 1400)});
77 tables.push_back(TableDef {
"table2", Eigen::Vector3f(-600, -1500, 900), Eigen::Vector3f(600, -600, 1400)});
81 EntityIdList objectIds = objectInstancesProxy->getAllEntityIds();
83 for (std::string
id : objectIds)
85 EntityRefBasePtr entityBase = objectInstancesProxy->getEntityRefById(
id);
86 const ObjectInstancePtr object = ObjectInstancePtr::dynamicCast(entityBase->getEntity());
90 ARMARX_WARNING <<
"Something went wrong when getting the object with id " <<
id <<
" from working memory";
94 for (TableDef table : tables)
97 auto pos =
object->getPosition();
100 if (pos->x > table.min[0] && pos->y > table.min[1] && pos->z > table.
min[2]
101 && pos->x < table.max[0] && pos->y < table.max[1] && pos->z < table.max[2])