Skip to content
Snippets Groups Projects
Commit d8250f7c authored by Fabian Reister's avatar Fabian Reister
Browse files

RobotStateMemory: using core visu

parent 40c79e1a
No related branches found
No related tags found
2 merge requests!157armem/dev => master,!144robot state memory update
......@@ -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();
......
......@@ -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;
......
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