diff --git a/source/RobotAPI/libraries/armem_objects/server/attachments/Segment.cpp b/source/RobotAPI/libraries/armem_objects/server/attachments/Segment.cpp index c2b3b77ab2da1909b55a93f98ecb513643721618..7f46c9b4509c54430eb2ddca0a10426d7ceab227 100644 --- a/source/RobotAPI/libraries/armem_objects/server/attachments/Segment.cpp +++ b/source/RobotAPI/libraries/armem_objects/server/attachments/Segment.cpp @@ -52,24 +52,28 @@ namespace armarx::armem::server::obj::attachments // this->visu = std::make_unique<Visu>(arviz, *this); } - std::vector<armarx::armem::attachments::ObjectAttachment> Segment::getAttachments(const armem::Time& timestamp) const + std::vector<armarx::armem::attachment::ObjectAttachment> Segment::getAttachments(const armem::Time& timestamp) const { - std::vector<armarx::armem::attachments::ObjectAttachment> attachments; + std::vector<armarx::armem::attachment::ObjectAttachment> attachments; for (const auto& [_, provSeg] : iceMemory.workingMemory->getCoreSegment(p.coreClassSegmentName)) { for (const auto& [name, entity] : provSeg.entities()) { const auto& entityInstance = entity.getLatestSnapshot().getInstance(0); - const auto attachment = tryCast<armarx::arondto::attachment::ObjectAttachment>(entityInstance); + const auto aronAttachment = tryCast<armarx::armem::arondto::attachment::ObjectAttachment>(entityInstance); - if (not attachment) + if (not aronAttachment) { ARMARX_WARNING << "Could not convert entity instance to 'ObjectAttachment'"; continue; } ARMARX_DEBUG << "Key is " << armem::MemoryID(entity.id()); + + armarx::armem::attachment::ObjectAttachment attachment; + fromAron(*aronAttachment, attachment); + attachments.push_back(attachment); } }