diff --git a/source/RobotAPI/libraries/armem_skills/server/segment/ComposedSkillLibrarySegment.cpp b/source/RobotAPI/libraries/armem_skills/server/segment/ComposedSkillLibrarySegment.cpp index afe20bccfcbae140bab1c6a5520979ff2cfd5457..4188998cc88740a8b88c07c64e15263e7a64251c 100644 --- a/source/RobotAPI/libraries/armem_skills/server/segment/ComposedSkillLibrarySegment.cpp +++ b/source/RobotAPI/libraries/armem_skills/server/segment/ComposedSkillLibrarySegment.cpp @@ -43,10 +43,10 @@ namespace armarx::skills::segment ComposedSkillLibraryCoreSegment::addSkill(const skills::manager::arondto::FluxioSkill& skill) { // add skills - auto provId = id().withProviderSegmentName(skill.skillProviderId.id); + armem::MemoryID provId = id().withProviderSegmentName(skill.skillProviderId.id); armem::Commit commit; - auto& entityUpdate = commit.add(); + armem::EntityUpdate& entityUpdate = commit.add(); entityUpdate.confidence = 1.0; entityUpdate.referencedTime = armem::Time::Now(); entityUpdate.sentTime = armem::Time::Now(); diff --git a/source/RobotAPI/libraries/armem_skills/server/segment/ProfileLibrarySegment.cpp b/source/RobotAPI/libraries/armem_skills/server/segment/ProfileLibrarySegment.cpp index f1d93114aa5662ce62bbbcc0619eff22884c50da..bf52ab90c205ded49e5748d2fff436a8fbfd963d 100644 --- a/source/RobotAPI/libraries/armem_skills/server/segment/ProfileLibrarySegment.cpp +++ b/source/RobotAPI/libraries/armem_skills/server/segment/ProfileLibrarySegment.cpp @@ -4,6 +4,8 @@ #include <ArmarXCore/core/time/ice_conversions.h> +#include "RobotAPI/libraries/armem/core/Commit.h" +#include "RobotAPI/libraries/armem/core/MemoryID.h" #include <RobotAPI/libraries/armem/server/MemoryToIceAdapter.h> #include <RobotAPI/libraries/armem_skills/aron_conversions.h> #include <RobotAPI/libraries/aron/converter/datatype/DatatypeConverterVisitor.h> @@ -35,19 +37,19 @@ namespace armarx::skills::segment void ProfileLibraryCoreSegment::addProfile(const skills::manager::arondto::FluxioProfile& profile) { - // // add skills - // auto provId = id().withProviderSegmentName(skill.skillProviderId.id); - - // armem::Commit commit; - // auto& entityUpdate = commit.add(); - // entityUpdate.confidence = 1.0; - // entityUpdate.referencedTime = armem::Time::Now(); - // entityUpdate.sentTime = armem::Time::Now(); - // entityUpdate.arrivedTime = armem::Time::Now(); - // entityUpdate.instancesData = {skill.toAron()}; - // entityUpdate.entityID = provId.withEntityName("ArmarBlow"); - - // // Commit data to memory and notify - // iceMemory.commit(commit); + // add profile + armem::MemoryID& provId = id(); + + armem::Commit commit; + armem::EntityUpdate& entityUpdate = commit.add(); + entityUpdate.confidence = 1.0; + entityUpdate.referencedTime = armem::Time::Now(); + entityUpdate.sentTime = armem::Time::Now(); + entityUpdate.arrivedTime = armem::Time::Now(); + entityUpdate.instancesData = {profile.toAron()}; + entityUpdate.entityID = provId.withEntityName(profile.name); + + // Commit data to memory and notify + iceMemory.commit(commit); } } // namespace armarx::skills::segment diff --git a/source/RobotAPI/libraries/armem_skills/server/segment/ProfileLibrarySegment.h b/source/RobotAPI/libraries/armem_skills/server/segment/ProfileLibrarySegment.h index a05bca90e89a4cb6037fa70ea1430587724e95e2..61c5a9fc1e34c5d42eac798ef813e8a2aa1321e1 100644 --- a/source/RobotAPI/libraries/armem_skills/server/segment/ProfileLibrarySegment.h +++ b/source/RobotAPI/libraries/armem_skills/server/segment/ProfileLibrarySegment.h @@ -29,7 +29,5 @@ namespace armarx::skills::segment void init(); void addProfile(const skills::manager::arondto::FluxioProfile& profile); - - size_t size() const; }; } // namespace armarx::skills::segment