From ce15dc0e495442e57a24daa101754320ff95bf4d Mon Sep 17 00:00:00 2001
From: Fabian Reister <fabian.reister@kit.edu>
Date: Tue, 15 Jun 2021 17:16:31 +0200
Subject: [PATCH] RobotStateMemory: memory name via property

---
 .../armem/server/RobotStateMemory/RobotStateMemory.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/source/RobotAPI/components/armem/server/RobotStateMemory/RobotStateMemory.cpp b/source/RobotAPI/components/armem/server/RobotStateMemory/RobotStateMemory.cpp
index da477a238..d020665e8 100644
--- a/source/RobotAPI/components/armem/server/RobotStateMemory/RobotStateMemory.cpp
+++ b/source/RobotAPI/components/armem/server/RobotStateMemory/RobotStateMemory.cpp
@@ -71,9 +71,15 @@ namespace armarx::armem::server::robot_state
 
     armarx::PropertyDefinitionsPtr RobotStateMemory::createPropertyDefinitions()
     {
+        armarx::PropertyDefinitionsPtr defs = new ComponentPropertyDefinitions(getConfigIdentifier());
+
+        const std::string prefix = "mem.";
+
+        workingMemory.name() = "RobotState";
+        defs->optional(workingMemory.name(), prefix + "MemoryName", "Name of this memory server.");
+
         const std::string robotUnitPrefix{sensorValuePrefix};
 
-        armarx::PropertyDefinitionsPtr defs = new ComponentPropertyDefinitions(getConfigIdentifier());
         defs->optional(robotUnitSensorPrefix, robotUnitPrefix + "SensorValuePrefix", "Prefix of all sensor values");
         defs->optional(robotUnitMemoryBatchSize, robotUnitPrefix + "MemoryBatchSize", "The size of the entity snapshot to send to the memory. Min is 1");
         defs->optional(robotUnitPollFrequency, robotUnitPrefix + "UpdateFrequency", "The frequency in Hz to store values. All other values get discarded. Min is 1, max is " + std::to_string(ROBOT_UNIT_MAXIMUM_FREQUENCY));
@@ -124,7 +130,7 @@ namespace armarx::armem::server::robot_state
 
         ArmarXDataPath::getAbsolutePath(robotUnitConfigPath, robotUnitConfigPath, includePaths);
 
-        workingMemory.name() = workingMemoryName;
+        // workingMemory.name() = workingMemoryName;
     }
 
 
-- 
GitLab