23#ifndef _ARMARX_COMPONENT_ActiveVision_TabletopSegmentation_H
24#define _ARMARX_COMPONENT_ActiveVision_TabletopSegmentation_H
27#include <pcl/ModelCoefficients.h>
28#include <pcl/common/angles.h>
29#include <pcl/filters/extract_indices.h>
30#include <pcl/filters/passthrough.h>
31#include <pcl/point_types.h>
32#include <pcl/segmentation/extract_clusters.h>
33#include <pcl/segmentation/extract_polygonal_prism_data.h>
34#include <pcl/segmentation/sac_segmentation.h>
35#include <pcl/surface/convex_hull.h>
38#include <ArmarXCore/interface/observers/ObserverInterface.h>
39#include <ArmarXCore/interface/observers/RequestableService.h>
41#include <ArmarXGui/interface/RemoteGuiInterface.h>
44#include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
47#include <VisionX/interface/components/TabletopSegmentationInterface.h>
55 ServiceProvider(
const std::string& serviceName,
const std::function<
void(
int)>& callback);
58 void requestService(
const std::string&, Ice::Int relativeTimeoutMs,
const Ice::Current&);
66 std::string serviceName;
67 std::function<void(
int)> callback;
72 typedef pcl::PointXYZRGBA
PointT;
88 "Name of the topic the DebugObserver listens on");
90 "DebugDrawerTopicName",
"DebugDrawerUpdates",
"Name of the DebugDrawerTopic");
92 "RemoteGuiName",
"RemoteGuiProvider",
"Name of the remote gui provider");
95 "If enabled the component runs always. Otherwise only "
96 "when requested via the requestable service interface.",
100 "DistanceThreshold", 20.0,
"The distance threshold for the plane.");
104 "The eps angle (in rad) for the plane perpendicular to the z-axis. If zero the "
105 "perpendicular constraint is removed.");
109 "If enabled the points from the tabletop plane will be "
110 "added as a separate cluster.");
114 "ClusterTolerance", 20.0,
"the tolerance used for euclidean cluster extraction.");
120 "HeightMax", 500.0,
"The maximum distance to the plane.");
137 virtual public visionx::TabletopSegmentationInterface,
147 return "TabletopSegmentation";
183 visionx::TabletopSegmentationPlanePtr
getTablePlane(
const Ice::Current&)
override;
186 void extractEuclideanClusters(
const pcl::PointCloud<PointT>::ConstPtr& inputCloud,
187 const pcl::PointCloud<PointL>::Ptr& resultCloud);
196 RemoteGuiInterfacePrx remoteGui;
199 pcl::SACSegmentation<PointT> seg;
201 bool includeTabletopPlane;
202 pcl::EuclideanClusterExtraction<PointT> ec;
204 pcl::ExtractIndices<PointT> extract;
206 pcl::ExtractPolygonalPrismData<PointT> prism;
207 pcl::ConvexHull<PointT> hull;
210 IceUtil::Time nextTimeoutAbs;
212 std::mutex tablePlaneMutex;
213 visionx::TabletopSegmentationPlanePtr tablePlane;
216 std::mutex prop_mutex;
218 float prop_DistanceThreshold = 20.0;
219 float prop_EpsAngle = pcl::deg2rad(10.0);
221 float prop_ClusterTolerance = 20.0;
222 int prop_MinClusterSize = 100;
223 int prop_MaxClusterSize = 25000;
225 float prop_HeightMin = 0.0;
226 float prop_HeightMax = 500.0;
228 bool prop_IncludeTabletopPlane =
false;
229 bool prop_CalculatePlane =
true;
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)
IceUtil::Handle< RunningTask< T > > pointer_type
Shared pointer type for convenience.
void setServiceConfig(const std::string &, const StringVariantBaseMap &, const Ice::Current &)
ServiceProvider(const std::string &serviceName, const std::function< void(int)> &callback)
void requestService(const std::string &, Ice::Int relativeTimeoutMs, const Ice::Current &)
TabletopSegmentationPropertyDefinitions(std::string prefix)
Brief description of class TabletopSegmentation.
visionx::TabletopSegmentationPlanePtr getTablePlane(const Ice::Current &) override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onExitPointCloudProcessor() override
void onConnectPointCloudProcessor() override
void onDisconnectPointCloudProcessor() override
void onInitPointCloudProcessor() override
std::string getDefaultName() const override
Properties of PointCloudProcessor.
PointCloudProcessorPropertyDefinitions(std::string prefix)
The PointCloudProcessor class provides an interface for access to PointCloudProviders via Ice and sha...
This file offers overloads of toIce() and fromIce() functions for STL container types.
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface > DebugObserverInterfacePrx
std::map< std::string, VariantBasePtr > StringVariantBaseMap
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
IceUtil::Handle< ServiceProvider > ServiceProviderPtr
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface > DebugDrawerInterfacePrx