16#include <RobotAPI/interface/ArmarXObjects/ArmarXObjectsTypes.h>
17#include <RobotAPI/interface/objectpose/ObjectPoseStorageInterface.h>
29 const std::string prefix = propertyPrefix;
31 def->optional(properties.memoryName, prefix +
"MemoryName");
38 ARMARX_IMPORTANT <<
"Waiting for memory '" << properties.memoryName <<
"' ...";
42 auto r = memoryNameSystem.
useReader(properties.memoryName);
57 ARMARX_INFO <<
"Connected to Memory '" << properties.memoryName <<
"'";
66 std::map<std::string, bool>
70 std::map<std::string, bool> ret;
72 for (
const auto& [k, p] : providers)
82 const std::string& provider,
86 armarx::data::ObjectID requestObject;
89 armarx::objpose::observer::RequestObjectsInput req;
90 req.provider = provider;
91 req.request.objectIDs = {requestObject};
96 if (requestResult.results.count(requestObject))
98 return requestResult.results.at(requestObject).result.success;
103 std::optional<objpose::ObjectPose>
109 for (
const auto& pose : objectPoses)
117 if (oid == instanceId)
137 std::map<std::string, objpose::ObjectPose>
140 std::map<std::string, objpose::ObjectPose> ret;
142 for (
const auto& pose : objectPoses)
151 std::map<std::string, objpose::ObjectPose>
154 std::map<std::string, objpose::ObjectPose> ret;
156 for (
const auto& pose : objectPoses)
169 std::map<std::string, std::vector<objpose::ObjectPose>>
173 std::map<std::string, std::vector<objpose::ObjectPose>> ret;
180 for (
const auto& providerName : {
"--placeholder--"})
188 {
return objectPose.attachment.has_value(); };
190 std::vector<objpose::ObjectPose> attachedObjects = {};
196 attachedObjects.emplace_back(
obj);
201 if (not attachedObjects.empty())
204 << attachedObjects.size() <<
" attached objects";
205 ret[providerName] = attachedObjects;
A known object ID of the form "Dataset/ClassName" or "Dataset/ClassName/InstanceName".
bool equalClass(const ObjectID &rhs) const
Indicates whether dataset and class name are equal.
std::string instanceName() const
std::string str() const
Return "dataset/className" or "dataset/className/instanceName".
The memory name system (MNS) client.
Reader useReader(const MemoryID &memoryID)
Use a memory server and get a reader for it.
server::ReadingMemoryInterfacePrx readingPrx
Indicates that a query to the Memory Name System failed.
std::optional< objpose::ObjectPose > queryLatestObjectInstance(const ObjectID &instanceId)
std::map< std::string, objpose::ObjectPose > queryLatestObjectInstances()
void connect(armem::client::MemoryNameSystem &memoryNameSystem)
objpose::ObjectPoseStorageInterfacePrx getObjectPoseStorage() const
std::map< std::string, std::vector< objpose::ObjectPose > > queryAttachedObjectInstancesForProviders()
std::map< std::string, bool > requestLocalization(const ObjectID &instanceId, const armarx::core::time::Duration &until)
void registerPropertyDefinitions(armarx::PropertyDefinitionsPtr &def)
std::int64_t toMilliSeconds() const
Returns the amount of milliseconds.
#define ARMARX_INFO
The normal logging level.
#define ARMARX_IMPORTANT
The logging level for always important information, but expected behaviour (in contrast to ARMARX_WAR...
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.
#define ARMARX_VERBOSE
The logging level for verbose information.
void fromIce(const data::MemoryID &ice, MemoryID &id)
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
void toIce(std::map< IceKeyT, IceValueT > &iceMap, const boost::container::flat_map< CppKeyT, CppValueT > &cppMap)
An object pose as stored by the ObjectPoseStorage.