MaskRCNNPointCloudObjectLocalizer.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package VisionX::ArmarXObjects::MaskRCNNPointCloudObjectLocalizer
19 * @author Markus Grotz ( markus dot grotz at kit dot edu )
20 * @date 2015
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24
25#pragma once
26
27
28#include <Eigen/Core>
29
32#include <ArmarXCore/interface/observers/RequestableService.h>
33
34#include <RobotAPI/interface/core/PoseBase.h>
35#include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
37
40#include <VisionX/interface/components/SimpleLocation.h>
41
43#include <MemoryX/interface/core/ProbabilityMeasures.h>
44
45#pragma GCC diagnostic push
46#pragma GCC diagnostic ignored "-Wpedantic"
47//#include <pcl/point_types.h>
48
49//#include <pcl/common/transforms.h>
50
51//#include <pcl/io/pcd_io.h>
52
53//#include <pcl/filters/filter.h>
54//#include <pcl/filters/passthrough.h>
55//#include <pcl/filters/approximate_voxel_grid.h>
56
57//#include <pcl/features/normal_3d.h>
58//#include <pcl/features/normal_3d_omp.h>
59//#include <pcl/features/fpfh_omp.h>
60//#include <pcl/features/shot_omp.h>
61//#include <pcl/search/kdtree.h>
62//#include <pcl/kdtree/kdtree_flann.h>
63
64//#include <pcl/registration/icp.h>
65//#include <pcl/registration/gicp6d.h>
66
67//#include <pcl/correspondence.h>
68#include <pcl/recognition/cg/geometric_consistency.h>
69#pragma GCC diagnostic pop
70
71#include <limits>
72
73namespace visionx
74{
75
76
77 typedef pcl::PointXYZRGBA PointT;
78 typedef pcl::PointXYZRGBL PointL;
79 typedef pcl::FPFHSignature33 PointD;
80
81 //typedef pcl::SHOT352 PointD;
82
83 /**
84 * @class MaskRCNNPointCloudObjectLocalizerPropertyDefinitions
85 * @brief
86 */
89 {
90 public:
93 {
95 "agentName",
96 "Armar6",
97 "Name of the agent for which the sensor values are provided");
99 "sourceNodeName",
100 "DepthCamera",
101 "the robot node to use as source coordinate system for the captured point clouds");
103 "ObjectNameIdMap",
104 "spraybottle:1;screwdriver:2;torch:3;cloth:4;cutter:5;pliers:6;brush:7",
105 "map between object names and mask rcnn names",
107 defineOptionalProperty<uint32_t>("BackgroundLabelId",
108 0,
109 "Label in the pointcloud for the plane or background.",
111
113 "DebugDrawerTopic", "DebugDrawerUpdates", "Name of the DebugDrawerTopic");
114 }
115 };
116
117 /**
118
119 http://pointclouds.org/documentation/tutorials/global_hypothesis_verification.php
120 * @class MaskRCNNPointCloudObjectLocalizer
121 *
122 * @ingroup VisionX-Components
123 * @brief A brief description
124 *
125 *
126 * Detailed Description
127 */
129 virtual public armarx::SimpleLocationInterface,
130 virtual public PointCloudProcessor
131 {
132 public:
133 /**
134 * @see armarx::ManagedIceObject::getDefaultName()
135 */
136 std::string
137 getDefaultName() const override
138 {
139 return "MaskRCNNPointCloudObjectLocalizer";
140 }
141
142 void getLocation(armarx::FramedOrientationBasePtr& orientation,
143 armarx::FramedPositionBasePtr& position,
144 const Ice::Current& c = ::Ice::Current()) override;
145
146 memoryx::ObjectLocalizationResultList
147 localizeObjectClasses(const memoryx::ObjectClassNameList& objectClassNames,
148 const Ice::Current& c = ::Ice::Current()) override;
149
150 protected:
151 /**
152 * @see visionx::PointCloudProcessor::onInitPointCloudProcessor()
153 */
154 void onInitPointCloudProcessor() override;
155
156 /**
157 * @see visionx::PointCloudProcessor::onConnectPointCloudProcessor()
158 */
159 void onConnectPointCloudProcessor() override;
160
161 /**
162 * @see visionx::PointCloudProcessor::onDisconnectPointCloudProcessor()
163 */
164 void onDisconnectPointCloudProcessor() override;
165
166 /**
167 * @see visionx::PointCloudProcessor::onExitPointCloudProcessor()
168 */
169 void onExitPointCloudProcessor() override;
170
171 /**
172 * @see visionx::PointCloudProcessor::process()
173 */
174 void process() override;
175
176 /**
177 * @see PropertyUser::createPropertyDefinitions()
178 */
180
181
182 private:
183 std::mutex pointCloudMutex;
184
185
186 std::string agentName;
187
188 std::string providerName;
189 std::string sourceNodeName;
190
191
192 std::mutex localizeMutex;
193
194
195 armarx::DebugDrawerInterfacePrx debugDrawerPrx;
196 armarx::RequestableServiceListenerInterfacePrx serviceTopic;
197 };
198} // namespace visionx
constexpr T c
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)
http://pointclouds.org/documentation/tutorials/global_hypothesis_verification.php
void getLocation(armarx::FramedOrientationBasePtr &orientation, armarx::FramedPositionBasePtr &position, const Ice::Current &c=::Ice::Current()) override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
memoryx::ObjectLocalizationResultList localizeObjectClasses(const memoryx::ObjectClassNameList &objectClassNames, const Ice::Current &c=::Ice::Current()) override
The PointCloudProcessor class provides an interface for access to PointCloudProviders via Ice and sha...
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface > DebugDrawerInterfacePrx
ArmarX headers.
pcl::FPFHSignature33 PointD