SegmentRansacShapeExtractor.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package VisionX::ArmarXObjects::SegmentRansacShapeExtractor
17 * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
18 * @date 2019
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25#include <pcl/point_types.h>
26
29#include <ArmarXCore/interface/observers/ObserverInterface.h>
30
32
34#include <VisionX/interface/components/SegmentRansacShapeExtractor.h>
35#include <VisionX/interface/libraries/SemanticObjectRelations/ShapesTopic.h>
36
37#include <SemanticObjectRelations/ShapeExtraction/ShapeExtraction.h>
38
39namespace visionx
40{
41
42 /**
43 * @class SegmentRansacShapeExtractorPropertyDefinitions
44 * @brief Property definitions of `SegmentRansacShapeExtractor`.
45 */
52
53 /**
54 * @defgroup Component-SegmentRansacShapeExtractor SegmentRansacShapeExtractor
55 * @ingroup VisionX-Components
56 * A description of the component SegmentRansacShapeExtractor.
57 *
58 * @class SegmentRansacShapeExtractor
59 * @ingroup Component-SegmentRansacShapeExtractor
60 * @brief Brief description of class SegmentRansacShapeExtractor.
61 *
62 * Detailed description of class SegmentRansacShapeExtractor.
63 */
65 virtual public visionx::PointCloudProcessor,
66 virtual public visionx::SegmentRansacShapeExtractorInterface
67 {
68 /// The used point type.
69 using PointT = pcl::PointXYZRGBL;
70
71 public:
72 /// @see armarx::ManagedIceObject::getDefaultName()
73 std::string getDefaultName() const override;
74
75
76 // SegmentRansacShapeExtractorInterface interface
77 armarx::semantic::data::ShapeList
78 extractShapes(const Ice::Current& = Ice::emptyCurrent) override;
79 armarx::semantic::data::ShapeList
80 getExtractedShapes(const Ice::Current& = Ice::emptyCurrent) override;
81
82
83 protected:
84 /// @see visionx::PointCloudProcessor::onInitPointCloudProcessor()
85 void onInitPointCloudProcessor() override;
86
87 /// @see visionx::PointCloudProcessor::onConnectPointCloudProcessor()
88 void onConnectPointCloudProcessor() override;
89
90 /// @see visionx::PointCloudProcessor::onDisconnectPointCloudProcessor()
91 void onDisconnectPointCloudProcessor() override;
92
93 /// @see visionx::PointCloudProcessor::onExitPointCloudProcessor()
94 void onExitPointCloudProcessor() override;
95
96
97 /// @see visionx::PointCloudProcessor::process()
98 void process() override;
99
100
101 /// @see PropertyUser::createPropertyDefinitions()
103
104
105 private:
106 // INPUT
107
108 std::mutex inputPointCloudMutex;
109
110 /// The latest received point cloud.
111 pcl::PointCloud<pcl::PointXYZRGBL>::Ptr inputPointCloud;
112
113
114 // PROCESSING
115
116 /// Locked while process is running.
117 std::mutex extractionMutex;
118
119 /// The shape extraction.
120 semrel::ShapeExtraction shapeExtraction;
121
123
124 // RESULT
125
126 struct ExtractedShapes
127 {
128
129 /// Protects `extractedShapes` and `extractedShapesIce`.
130 std::mutex mutex;
131
132 /// The result of the latest processed point cloud.
133 semrel::ShapeList shapes;
134
135 /// Serialized version of `shapes`. Is kept up to date.
136 armarx::semantic::data::ShapeList shapesIce;
137 };
138
139 ExtractedShapes extractedShapes;
140
141
142 // ICE
143
145 armarx::DebugDrawerTopic debugDrawer;
146
147 std::string shapesName;
148 armarx::semantic::ShapesTopicPrx shapesTopic;
149 };
150} // namespace visionx
The DebugDrawerTopic wraps a DebugDrawerInterfacePrx and provides a more useful interface than the Ic...
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
IceUtil::Handle< RunningTask< T > > pointer_type
Shared pointer type for convenience.
The PointCloudProcessor class provides an interface for access to PointCloudProviders via Ice and sha...
Brief description of class SegmentRansacShapeExtractor.
armarx::semantic::data::ShapeList getExtractedShapes(const Ice::Current &=Ice::emptyCurrent) override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
armarx::semantic::data::ShapeList extractShapes(const Ice::Current &=Ice::emptyCurrent) override
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface > DebugObserverInterfacePrx
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
ArmarX headers.