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

component: memory reader and writer

parent d54740e2
No related branches found
No related tags found
1 merge request!20Feature/dynamic distance to obstacle costmap
......@@ -3,7 +3,7 @@ armarx_add_component(dynamic_distance_to_obstacle_costmap_provider
ComponentInterface.ice
ICE_DEPENDENCIES
ArmarXCoreInterfaces
# RobotAPIInterfaces
RobotAPIInterfaces
# ARON_FILES
# aron/my_type.xml
SOURCES
......@@ -20,6 +20,7 @@ armarx_add_component(dynamic_distance_to_obstacle_costmap_provider
## RobotAPICore
## RobotAPIInterfaces
## RobotAPIComponentPlugins # For ArViz and other plugins.
armarx_navigation::memory
# DEPENDENCIES_LEGACY
## Add libraries that do not provide any targets but ${FOO_*} variables.
# FOO
......
......@@ -35,14 +35,14 @@
namespace armarx::navigation::components::dynamic_distance_to_obstacle_costmap_provider
{
const std::string
Component::defaultName = "dynamic_distance_to_obstacle_costmap_provider";
const std::string Component::defaultName = "dynamic_distance_to_obstacle_costmap_provider";
armarx::PropertyDefinitionsPtr
Component::createPropertyDefinitions()
{
armarx::PropertyDefinitionsPtr def = new armarx::ComponentPropertyDefinitions(getConfigIdentifier());
armarx::PropertyDefinitionsPtr def =
new armarx::ComponentPropertyDefinitions(getConfigIdentifier());
// Publish to a topic (passing the TopicListenerPrx).
// def->topic(myTopicListener);
......@@ -58,13 +58,18 @@ namespace armarx::navigation::components::dynamic_distance_to_obstacle_costmap_p
// def->required(properties.boxLayerName, "p.box.LayerName", "Name of the box layer in ArViz.");
// Add an optionalproperty.
def->optional(properties.boxLayerName, "p.box.LayerName", "Name of the box layer in ArViz.");
def->optional(
properties.boxLayerName, "p.box.LayerName", "Name of the box layer in ArViz.");
def->optional(properties.numBoxes, "p.box.Number", "Number of boxes to draw in ArViz.");
return def;
}
Component::Component() : costmapReader(memoryNameSystem()), costmapWriter(memoryNameSystem())
{
}
void
Component::onInitComponent()
{
......@@ -217,4 +222,4 @@ namespace armarx::navigation::components::dynamic_distance_to_obstacle_costmap_p
ARMARX_REGISTER_COMPONENT_EXECUTABLE(Component, Component::GetDefaultName());
} // namespace armarx::navigation::components::dynamic_distance_to_obstacle_costmap_provider
} // namespace armarx::navigation::components::dynamic_distance_to_obstacle_costmap_provider
......@@ -28,12 +28,17 @@
#include <ArmarXCore/core/Component.h>
#include "RobotAPI/libraries/armem/client/forward_declarations.h"
// #include <ArmarXCore/libraries/ArmarXCoreComponentPlugins/DebugObserverComponentPlugin.h>
// #include <ArmarXGui/libraries/ArmarXGuiComponentPlugins/LightweightRemoteGuiComponentPlugin.h>
// #include <RobotAPI/libraries/RobotAPIComponentPlugins/ArVizComponentPlugin.h>
#include <RobotAPI/libraries/armem/client.h>
#include "armarx/navigation/memory/client/costmap/Reader.h"
#include "armarx/navigation/memory/client/costmap/Writer.h"
#include <armarx/navigation/components/dynamic_distance_to_obstacle_costmap_provider/ComponentInterface.h>
......@@ -42,12 +47,16 @@ namespace armarx::navigation::components::dynamic_distance_to_obstacle_costmap_p
class Component :
virtual public armarx::Component,
virtual public armarx::navigation::components::dynamic_distance_to_obstacle_costmap_provider::ComponentInterface
virtual public armarx::navigation::components::
dynamic_distance_to_obstacle_costmap_provider::ComponentInterface
// , virtual public armarx::DebugObserverComponentPluginUser
// , virtual public armarx::LightweightRemoteGuiComponentPluginUser
// , virtual public armarx::ArVizComponentPluginUser
,
virtual public armem::ListeningClientPluginUser
{
public:
Component();
/// @see armarx::ManagedIceObject::getDefaultName()
std::string getDefaultName() const override;
......@@ -57,7 +66,6 @@ namespace armarx::navigation::components::dynamic_distance_to_obstacle_costmap_p
protected:
/// @see PropertyUser::createPropertyDefinitions()
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override;
......@@ -87,7 +95,6 @@ namespace armarx::navigation::components::dynamic_distance_to_obstacle_costmap_p
private:
// Private methods go here.
// Forward declare `Properties` if you used it before its defined.
......@@ -100,7 +107,6 @@ namespace armarx::navigation::components::dynamic_distance_to_obstacle_costmap_p
private:
static const std::string defaultName;
......@@ -139,6 +145,8 @@ namespace armarx::navigation::components::dynamic_distance_to_obstacle_costmap_p
std::mutex arvizMutex;
*/
memory::client::costmap::Reader costmapReader;
memory::client::costmap::Writer costmapWriter;
};
} // namespace armarx::navigation::components::dynamic_distance_to_obstacle_costmap_provider
} // namespace armarx::navigation::components::dynamic_distance_to_obstacle_costmap_provider
......@@ -23,11 +23,12 @@
#pragma once
#include <RobotAPI/interface/armem/client/MemoryListenerInterface.ice>
module armarx { module navigation { module components { module dynamic_distance_to_obstacle_costmap_provider
{
interface ComponentInterface
interface ComponentInterface extends armarx::armem::client::MemoryListenerInterface
{
// Define your interface here.
};
......
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