Skip to content
Snippets Groups Projects
Commit 148c2cfc authored by Fabian Reister's avatar Fabian Reister
Browse files

attachments segment: getAttachments

parent 926ac924
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment