6#include <IceUtil/Time.h>
8#include <SimoxUtility/algorithm/get_map_keys_values.h>
17#include <RobotAPI/libraries/armem_robot_state/aron/Robot.aron.generated.h>
18#include <RobotAPI/libraries/armem_robot_state/aron/RobotDescription.aron.generated.h>
25 memoryNameSystem(memoryNameSystem)
34 const std::string prefix = propertyPrefix;
36 def->optional(properties.memoryName, prefix +
"MemoryName");
38 def->optional(properties.coreAttachmentsSegmentName,
39 prefix +
"CoreSegment",
40 "Name of the memory core segment to use for object attachments.");
41 def->optional(properties.providerName, prefix +
"ProviderName");
48 ARMARX_IMPORTANT <<
"Writer: Waiting for memory '" << properties.memoryName <<
"' ...";
51 memoryWriter = memoryNameSystem.useWriter(properties.memoryName);
52 memoryReader = memoryNameSystem.useReader(properties.memoryName);
53 ARMARX_IMPORTANT <<
"Writer: Connected to memory '" << properties.memoryName <<
"'";
62 std::optional<armem::MemoryID>
65 std::lock_guard g{memoryWriterMutex};
68 memoryWriter.addSegment(properties.coreAttachmentsSegmentName, properties.providerName);
70 if (not result.success)
72 ARMARX_ERROR <<
"Creating core segment failed. Reason: " << result.errorMessage;
85 update.entityID = entityID;
87 arondto::attachment::ObjectAttachment aronAttachment;
90 update.instancesData = {aronAttachment.toAron()};
107 std::optional<armem::MemoryID>
110 std::lock_guard g{memoryWriterMutex};
113 memoryWriter.addSegment(properties.coreAttachmentsSegmentName, properties.providerName);
115 if (not result.success)
117 ARMARX_ERROR <<
"Creating core segment failed. Reason: " << result.errorMessage;
124 const auto entityID =
126 .withEntityName(
attachment.object.id.entityName)
130 update.entityID = entityID;
132 arondto::attachment::ArticulatedObjectAttachment aronAttachment;
135 update.instancesData = {aronAttachment.toAron()};
std::optional< armem::MemoryID > commit(const ObjectAttachment &attachment)
Writer(armem::client::MemoryNameSystem &memoryNameSystem)
void registerPropertyDefinitions(armarx::PropertyDefinitionsPtr &def)
The memory name system (MNS) client.
Indicates that a query to the Memory Name System failed.
#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_DEBUG
The logging level for output that is only interesting while debugging.
void toAron(arondto::MemoryID &dto, const MemoryID &bo)
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Result of an EntityUpdate.
An update of an entity for a specific point in time.
ArticulatedObjectAttachment describes a fixed transformation between an agent and an articulated obje...
ObjectAttachment describes a fixed transformation between an agent and an object.