diff --git a/source/RobotAPI/components/armem/server/RobotStateMemory/RobotStateMemory.cpp b/source/RobotAPI/components/armem/server/RobotStateMemory/RobotStateMemory.cpp index 6d6981ff5c6076279d52b20d32bd0d956cbf7ec8..45855e314d5df1532ccd52e5ad5d73da3c9e2784 100644 --- a/source/RobotAPI/components/armem/server/RobotStateMemory/RobotStateMemory.cpp +++ b/source/RobotAPI/components/armem/server/RobotStateMemory/RobotStateMemory.cpp @@ -20,8 +20,9 @@ * GNU General Public License */ +#include "RobotStateMemory.h" + // STD -#include <RobotAPI/interface/units/RobotUnit/RobotUnitInterface.h> #include <algorithm> #include <iostream> #include <fstream> @@ -29,7 +30,6 @@ // Header #include "ArmarXCore/core/logging/Logging.h" #include "RobotAPI/libraries/core/Pose.h" -#include "RobotStateMemory.h" // Simox #include <SimoxUtility/algorithm/string.h> @@ -43,6 +43,8 @@ #include <RobotAPI/libraries/aron/core/navigator/data/AllNavigators.h> #include <RobotAPI/libraries/aron/core/navigator/type/AllNavigators.h> +#include <RobotAPI/libraries/armem_robot_state/server/common/Visu.h> + namespace armarx::armem::server::robot_state { RobotStateMemory::RobotStateMemory() @@ -55,13 +57,16 @@ namespace armarx::armem::server::robot_state { } + RobotStateMemory::~RobotStateMemory() = default; + + armarx::PropertyDefinitionsPtr RobotStateMemory::createPropertyDefinitions() { armarx::PropertyDefinitionsPtr defs = new ComponentPropertyDefinitions(getConfigIdentifier()); - defs->optional(robotUnitSensorPrefix, "SensorValuePrefix", "Prefix of all sensor values"); - defs->optional(robotUnitMemoryBatchSize, "RobotUnitMemoryBatchSize", "The size of the entity snapshot to send to the memory. Min is 1"); - defs->optional(robotUnitPollFrequency, "RobotUnitUpdateFrequency", "The frequency in Hz to store values. All other values get discarded. Min is 1, max is " + std::to_string(ROBOT_UNIT_MAXIMUM_FREQUENCY)); - defs->optional(robotUnitConfigPath, "robotUnitConfigPath", "Specify a configuration file to group the sensor values specifically."); + defs->optional(robotUnitSensorPrefix, "RobotUnit.SensorValuePrefix", "Prefix of all sensor values"); + defs->optional(robotUnitMemoryBatchSize, "RobotUnit.MemoryBatchSize", "The size of the entity snapshot to send to the memory. Min is 1"); + defs->optional(robotUnitPollFrequency, "RobotUnit.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)); + defs->optional(robotUnitConfigPath, "robotUnit.ConfigPath", "Specify a configuration file to group the sensor values specifically."); descriptionSegment.defineProperties(defs); proprioceptionSegment.defineProperties(defs); @@ -119,6 +124,9 @@ namespace armarx::armem::server::robot_state localizationSegment.connect(getArvizClient()); + commonVisu = std::make_unique<Visu>(getArvizClient(), descriptionSegment, proprioceptionSegment, localizationSegment); + commonVisu->init(); + cfg.loggingNames.emplace_back(robotUnitSensorPrefix); handler = make_shared<RobotUnitDataStreamingReceiver>(this, getRobotUnit(), cfg); keys = handler->getDataDescription(); diff --git a/source/RobotAPI/components/armem/server/RobotStateMemory/RobotStateMemory.h b/source/RobotAPI/components/armem/server/RobotStateMemory/RobotStateMemory.h index 6917665b57c26444fb383eee501b06e7fcad13e2..c48e44ac86f977ca8bc1780035a978e814dff30a 100644 --- a/source/RobotAPI/components/armem/server/RobotStateMemory/RobotStateMemory.h +++ b/source/RobotAPI/components/armem/server/RobotStateMemory/RobotStateMemory.h @@ -47,6 +47,8 @@ namespace armarx::armem::server::robot_state { + class Visu; + /** * @defgroup Component-RobotSensorMemory RobotSensorMemory * @ingroup RobotAPI-Components @@ -67,6 +69,8 @@ namespace armarx::armem::server::robot_state public: RobotStateMemory(); + virtual ~RobotStateMemory(); + /// @see armarx::ManagedIceObject::getDefaultName() std::string getDefaultName() const override; @@ -101,7 +105,6 @@ namespace armarx::armem::server::robot_state mutable std::recursive_mutex startStopMutex; // Core segments - // - description description::Segment descriptionSegment; @@ -112,6 +115,9 @@ namespace armarx::armem::server::robot_state // - localization localization::Segment localizationSegment; + // Joint visu for all segments => robot pose and configuration + std::unique_ptr<Visu> commonVisu; + // RobotUnit stuff RobotUnitDataStreaming::DataStreamingDescription keys; std::vector<RobotUnitDataStreaming::DataEntry> keysList;