25#include <VirtualRobot/VirtualRobot.h>
32#include <SemanticObjectRelations/RelationGraph/json.h>
33#include <SemanticObjectRelations/Shapes.h>
34#include <SemanticObjectRelations/Spatial.h>
45 "Name of the topic the DebugObserver listens to.");
48 "ice.SemanticGraphTopicName",
50 "Name of the topic on which attributed graphs are reported.");
53 "ice.GraphName",
"Spatial",
"Name to use when reporting the extracted graph.");
61 return "SegmentSpatialRelations";
69 debugDrawer.offeringTopic(*
this);
77 debugDrawer.getTopic(*
this);
96 pcl::PointCloud<PointT>::Ptr inputCloud(
new pcl::PointCloud<PointT>());
103 ARMARX_VERBOSE <<
"Timeout or error while waiting for point cloud data";
111 semrel::ShapeList shapes;
112 if (outlierRate > 0 && outlierRate < 1)
121 const semrel::ShapeMap shapeMap = semrel::toShapeMap(shapes);
122 const semrel::SpatialGraph graph = semrel::spatial::evaluateStaticRelations(shapeMap);
124 debugObserver->setDebugChannel(
127 {
"Point Cloud Size",
new armarx::Variant(
static_cast<int>(inputCloud->size()))},
TopicProxyType getTopicFromProperty(const std::string &propertyName)
Get a topic proxy whose name is specified by the given property.
void offeringTopicFromProperty(const std::string &propertyName)
Offer a topic whose name is specified by the given property.
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Property< PropertyType > getProperty(const std::string &name)
std::string getName() const
Retrieve name of object.
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
The Variant class is described here: Variants.
PointCloudProcessorPropertyDefinitions(std::string prefix)
void enableResultPointClouds(std::string resultProviderName="")
Enables visualization.
int getPointClouds(const PointCloudPtrT &pointCloudPtr)
Poll PointClouds from provider.
bool waitForPointClouds(int milliseconds=1000)
Wait for new PointClouds.
Property definitions of SegmentSpatialRelations.
SegmentSpatialRelationsPropertyDefinitions(std::string prefix)
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onExitPointCloudProcessor() override
void onConnectPointCloudProcessor() override
void onDisconnectPointCloudProcessor() override
void onInitPointCloudProcessor() override
std::string getDefaultName() const override
#define ARMARX_VERBOSE
The logging level for verbose information.
semrel::ShapeList getShapesFromSoftAABBs(const pcl::PointCloud< pcl::PointXYZL > &pointCloud, float outlierRatio)
Return the AABBs of each point cloud segment in a pointCloud.
semrel::ShapeList getShapesFromAABBs(const pcl::PointCloud< pcl::PointXYZL > &pointCloud)
Get the AABBs of each point cloud segment in pointCloud.
data::Graph toIce(const semrel::AttributedGraph &input)
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.