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.");
49 "Name of the topic on which shapes are reported.");
51 "ice.ShapesName",
"SegmentAABBs",
"Name to use when reporting the extracted shapes.");
63 return "SegmentAABBShapesProvider";
72 debugDrawer.offeringTopic(*
this);
81 debugDrawer.getTopic(*
this);
98 pcl::PointCloud<PointT>::Ptr inputCloud(
new pcl::PointCloud<PointT>());
105 ARMARX_VERBOSE <<
"Timeout or error while waiting for point cloud data";
113 semrel::ShapeList shapes;
114 if (outlierRate > 0 && outlierRate < 1)
123 const semrel::ShapeMap shapeMap = semrel::toShapeMap(shapes);
124 const semrel::SpatialGraph graph = semrel::spatial::evaluateStaticRelations(shapeMap);
126 debugObserver->setDebugChannel(
129 {
"Point Cloud Size",
new armarx::Variant(
static_cast<int>(inputCloud->size()))},
140 for (
const auto& [
id, box] : shapeMap)
142 std::stringstream ss;
144 debugDrawer.drawBox({
getName(), ss.str()},
146 box->getOrientation(),
147 box->getAABB().extents(),
148 debugDrawer.getGlasbeyLUTColor(
int(
id), 0.5));
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)
int getPointClouds(const PointCloudPtrT &pointCloudPtr)
Poll PointClouds from provider.
bool waitForPointClouds(int milliseconds=1000)
Wait for new PointClouds.
Property definitions of SegmentAABBShapesProvider.
SegmentAABBShapesProviderPropertyDefinitions(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.