Go to the documentation of this file.
25 #include <VirtualRobot/VirtualRobot.h>
32 #include <SemanticObjectRelations/RelationGraph/json.h>
33 #include <SemanticObjectRelations/Shapes.h>
34 #include <SemanticObjectRelations/Spatial.h>
43 defineOptionalProperty<std::string>(
"ice.DebugObserverName",
45 "Name of the topic the DebugObserver listens to.");
47 defineOptionalProperty<std::string>(
48 "ice.SemanticGraphTopicName",
50 "Name of the topic on which attributed graphs are reported.");
52 defineOptionalProperty<std::string>(
53 "ice.GraphName",
"Spatial",
"Name to use when reporting the extracted graph.");
55 defineOptionalProperty<float>(
"aabb.OutlierRate", 0.01f,
"Allowed outliers for AABBs.");
61 return "SegmentSpatialRelations";
79 enableResultPointClouds<PointT>();
96 pcl::PointCloud<PointT>::Ptr inputCloud(
new pcl::PointCloud<PointT>());
103 ARMARX_VERBOSE <<
"Timeout or error while waiting for point cloud data";
109 const float outlierRate = getProperty<float>(
"aabb.OutlierRate");
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()))},
133 const std::string graphName = getProperty<std::string>(
"ice.GraphName");
The Variant class is described here: Variants.
void offeringTopic(ManagedIceObject &component, const std::string &topicNameOverride="") const
Call offeringTopic([topicName]) on the given component.
semrel::ShapeList getShapesFromSoftAABBs(const pcl::PointCloud< pcl::PointXYZL > &pointCloud, float outlierRatio)
Return the AABBs of each point cloud segment in a pointCloud.
Property definitions of SegmentSpatialRelations.
void onDisconnectPointCloudProcessor() override
void onExitPointCloudProcessor() override
void offeringTopicFromProperty(const std::string &propertyName)
Offer a topic whose name is specified by the given property.
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)
std::string getDefaultName() const override
TopicProxyType getTopicFromProperty(const std::string &propertyName)
Get a topic proxy whose name is specified by the given property.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
bool waitForPointClouds(int milliseconds=1000)
Wait for new PointClouds.
void onConnectPointCloudProcessor() override
Properties of PointCloudProcessor.
int getPointClouds(const PointCloudPtrT &pointCloudPtr)
Poll PointClouds from provider.
SegmentSpatialRelationsPropertyDefinitions(std::string prefix)
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
void onInitPointCloudProcessor() override
std::string getName() const
Retrieve name of object.
DebugDrawerInterfacePrx getTopic() const
Get the topic.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
MiscLib::Vector< std::pair< MiscLib::RefCountPtr< PrimitiveShape >, size_t > > shapes