diff --git a/source/VisionX/libraries/armem_human/server/PersonInstanceSegment.cpp b/source/VisionX/libraries/armem_human/server/PersonInstanceSegment.cpp index 7e3403b154751d679158e0b93bd88017e9d2e3c8..e17b20ba36b9b31cddd08cf490e038c141dc624b 100644 --- a/source/VisionX/libraries/armem_human/server/PersonInstanceSegment.cpp +++ b/source/VisionX/libraries/armem_human/server/PersonInstanceSegment.cpp @@ -25,23 +25,25 @@ #include <ArmarXCore/core/application/properties/PropertyDefinitionContainer.h> #include <VisionX/libraries/armem_human/aron/PersonInstance.aron.generated.h> - +#include <VisionX/libraries/armem_human/memory_ids.h> namespace armarx::armem::server::human { - const std::string PersonInstanceSegment::CORE_SEGMENT_NAME = "PersonInstance"; + const std::string PersonInstanceSegment::CORE_SEGMENT_NAME = + armarx::human::PersonInstanceCoreSegmentID.coreSegmentName; PersonInstanceSegment::PersonInstanceSegment(armem::server::MemoryToIceAdapter& iceMemory) : - Base(iceMemory, CORE_SEGMENT_NAME, - armarx::human::arondto::PersonInstance::ToAronType(), 32) + Base(iceMemory, CORE_SEGMENT_NAME, armarx::human::arondto::PersonInstance::ToAronType(), 32) { } - void PersonInstanceSegment::defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string& prefix) + void + PersonInstanceSegment::defineProperties(armarx::PropertyDefinitionsPtr defs, + const std::string& prefix) { Base::defineProperties(defs, prefix); } -} +} // namespace armarx::armem::server::human diff --git a/source/VisionX/libraries/armem_human/server/PoseSegment.cpp b/source/VisionX/libraries/armem_human/server/PoseSegment.cpp index 607e043fa242bee0f044124ca00d16d57fbfcbe4..3b4d6f5ccad100ef0c5f1de0ba6eaf98493d862a 100644 --- a/source/VisionX/libraries/armem_human/server/PoseSegment.cpp +++ b/source/VisionX/libraries/armem_human/server/PoseSegment.cpp @@ -25,22 +25,25 @@ #include <ArmarXCore/core/application/properties/PropertyDefinitionContainer.h> #include <VisionX/libraries/armem_human/aron/BODY_25Pose.aron.generated.h> +#include <VisionX/libraries/armem_human/memory_ids.h> namespace armarx::armem::server::human { - const std::string PoseSegment::CORE_SEGMENT_NAME = "Pose"; + const std::string PoseSegment::CORE_SEGMENT_NAME = + armarx::human::PoseCoreSegmentID.coreSegmentName; PoseSegment::PoseSegment(armem::server::MemoryToIceAdapter& iceMemory) : - Base(iceMemory, CORE_SEGMENT_NAME, - armarx::human::arondto::Body25Pose3D::ToAronType(), 256) + Base(iceMemory, CORE_SEGMENT_NAME, armarx::human::arondto::Body25Pose3D::ToAronType(), 256) { } - void PoseSegment::defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string& prefix) + void + PoseSegment::defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string& prefix) { Base::defineProperties(defs, prefix); } -} + +} // namespace armarx::armem::server::human diff --git a/source/VisionX/libraries/armem_human/server/face_recognition/Segment.cpp b/source/VisionX/libraries/armem_human/server/face_recognition/Segment.cpp index f2c805f13628233dc71e888746c70c460a7fb3b1..b220f8add04ffda69e093d0dc754fb85974cf879 100644 --- a/source/VisionX/libraries/armem_human/server/face_recognition/Segment.cpp +++ b/source/VisionX/libraries/armem_human/server/face_recognition/Segment.cpp @@ -25,30 +25,36 @@ #include <ArmarXCore/core/application/properties/PropertyDefinitionContainer.h> #include <VisionX/libraries/armem_human/aron/FaceRecognition.aron.generated.h> +#include <VisionX/libraries/armem_human/memory_ids.h> namespace armarx::armem::server::human::facerecog { - const std::string Segment::CORE_SEGMENT_NAME = "FaceRecognition"; + const std::string Segment::CORE_SEGMENT_NAME = + armarx::human::FaceRecognitionCoreSegmentID.coreSegmentName; Segment::Segment(armem::server::MemoryToIceAdapter& iceMemory) : - Base(iceMemory, CORE_SEGMENT_NAME, - armarx::human::arondto::FaceRecognition::ToAronType(), 64) + Base(iceMemory, + CORE_SEGMENT_NAME, + armarx::human::arondto::FaceRecognition::ToAronType(), + 64) { } - void Segment::defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string& prefix) + void + Segment::defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string& prefix) { Base::defineProperties(defs, prefix); } - void Segment::init() + void + Segment::init() { Base::init(); } -} +} // namespace armarx::armem::server::human::facerecog diff --git a/source/VisionX/libraries/armem_human/server/profile/Segment.cpp b/source/VisionX/libraries/armem_human/server/profile/Segment.cpp index 6d35f7f32bb821d8c5afc9c06629f7d72f16327e..c373c9b3c0fde0b89a0997bc8d506d20aa728b7d 100644 --- a/source/VisionX/libraries/armem_human/server/profile/Segment.cpp +++ b/source/VisionX/libraries/armem_human/server/profile/Segment.cpp @@ -24,47 +24,52 @@ #include <ArmarXCore/core/application/properties/PropertyDefinitionContainer.h> +#include <RobotAPI/libraries/armem/server/MemoryToIceAdapter.h> + #include <VisionX/libraries/armem_human/aron/Profile.aron.generated.h> +#include <VisionX/libraries/armem_human/memory_ids.h> #include "Finder.h" -#include <RobotAPI/libraries/armem/server/MemoryToIceAdapter.h> - namespace fs = std::filesystem; namespace armarx::armem::server::human::profile { - const std::string Segment::CORE_SEGMENT_NAME = "Profile"; + const std::string Segment::CORE_SEGMENT_NAME = + armarx::human::ProfileCoreSegmentID.coreSegmentName; + using Profile = armarx::human::arondto::Profile; Segment::Segment(armem::server::MemoryToIceAdapter& iceMemory) : - Base(iceMemory, CORE_SEGMENT_NAME, - armarx::human::arondto::Profile::ToAronType(), 64) + Base(iceMemory, CORE_SEGMENT_NAME, armarx::human::arondto::Profile::ToAronType(), 64) { } - Segment::Properties::PriorKnowledge::PriorKnowledge() : - packageName(Finder::DefaultPackageName) + Segment::Properties::PriorKnowledge::PriorKnowledge() : packageName(Finder::DefaultPackageName) { } - void Segment::defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string& prefix) + void + Segment::defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string& prefix) { Base::defineProperties(defs, prefix); - defs->optional(properties.priorKnowledge.load, prefix + "pk.load", + defs->optional(properties.priorKnowledge.load, + prefix + "pk.load", "Load profiles from prior knowledge on startup."); - defs->optional(properties.priorKnowledge.packageName, prefix + "pk.packageName", + defs->optional(properties.priorKnowledge.packageName, + prefix + "pk.packageName", "ArmarX package to load human profiles from."); } - void Segment::init() + void + Segment::init() { Base::init(); @@ -75,13 +80,15 @@ namespace armarx::armem::server::human::profile } - void Segment::loadPriorKnowledge() + void + Segment::loadPriorKnowledge() { loadPriorKnowledge(Finder::DefaultPackageName); } - void Segment::loadPriorKnowledge(const std::string& dataPackageName) + void + Segment::loadPriorKnowledge(const std::string& dataPackageName) { const armem::Time now = armem::Time::Now(); @@ -95,15 +102,16 @@ namespace armarx::armem::server::human::profile if (std::optional<Profile> profile = info.loadProfile()) { armem::EntityUpdate& update = commit.add(); - update.entityID = getCoreSegment().id() - .withProviderSegmentName(dataPackageName) - .withEntityName(info.id()); + update.entityID = getCoreSegment() + .id() + .withProviderSegmentName(dataPackageName) + .withEntityName(info.id()); update.timeCreated = update.timeSent = update.timeArrived = now; - update.instancesData = { profile->toAron() }; + update.instancesData = {profile->toAron()}; } } iceMemory.commit(commit); } -} +} // namespace armarx::armem::server::human::profile