Skip to content
Snippets Groups Projects
Commit 2101d41c authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Use constants

parent f2d2cffe
No related branches found
No related tags found
1 merge request!147Human memory ids constants
......@@ -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
......@@ -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
......@@ -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
......@@ -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
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