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 
35 #include <RobotAPI/interface/core/PoseBase.h>
37 
38 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
39 
40 #include <MemoryX/interface/core/ProbabilityMeasures.h>
42 
45 #include <VisionX/interface/components/SimpleLocation.h>
46 
47 #pragma GCC diagnostic push
48 #pragma GCC diagnostic ignored "-Wpedantic"
49 //#include <pcl/point_types.h>
50 
51 //#include <pcl/common/transforms.h>
52 
53 //#include <pcl/io/pcd_io.h>
54 
55 //#include <pcl/filters/filter.h>
56 //#include <pcl/filters/passthrough.h>
57 //#include <pcl/filters/approximate_voxel_grid.h>
58 
59 //#include <pcl/features/normal_3d.h>
60 //#include <pcl/features/normal_3d_omp.h>
61 //#include <pcl/features/fpfh_omp.h>
62 //#include <pcl/features/shot_omp.h>
63 //#include <pcl/search/kdtree.h>
64 //#include <pcl/kdtree/kdtree_flann.h>
65 
66 //#include <pcl/registration/icp.h>
67 //#include <pcl/registration/gicp6d.h>
68 
69 //#include <pcl/correspondence.h>
70 #include <pcl/recognition/cg/geometric_consistency.h>
71 #pragma GCC diagnostic pop
72 
73 #include <limits>
74 
75 namespace visionx
76 {
77 
78 
79  typedef pcl::PointXYZRGBA PointT;
80  typedef pcl::PointXYZRGBL PointL;
81  typedef pcl::FPFHSignature33 PointD;
82  //typedef pcl::SHOT352 PointD;
83 
84  /**
85  * @class MaskRCNNPointCloudObjectLocalizerPropertyDefinitions
86  * @brief
87  */
90  {
91  public:
94  {
95  defineOptionalProperty<std::string>("agentName", "Armar6", "Name of the agent for which the sensor values are provided");
96  defineOptionalProperty<std::string>("sourceNodeName", "DepthCamera", "the robot node to use as source coordinate system for the captured point clouds");
97  defineOptionalProperty<std::string>("ObjectNameIdMap", "spraybottle:1;screwdriver:2;torch:3;cloth:4;cutter:5;pliers:6;brush:7", "map between object names and mask rcnn names", armarx::PropertyDefinitionBase::eModifiable);
98  defineOptionalProperty<uint32_t>("BackgroundLabelId", 0, "Label in the pointcloud for the plane or background.", armarx::PropertyDefinitionBase::eModifiable);
99 
100  defineOptionalProperty<std::string>("DebugDrawerTopic", "DebugDrawerUpdates", "Name of the DebugDrawerTopic");
101 
102  }
103  };
104 
105  /**
106 
107  http://pointclouds.org/documentation/tutorials/global_hypothesis_verification.php
108  * @class MaskRCNNPointCloudObjectLocalizer
109  *
110  * @ingroup VisionX-Components
111  * @brief A brief description
112  *
113  *
114  * Detailed Description
115  */
117  virtual public armarx::SimpleLocationInterface,
118  virtual public PointCloudProcessor
119  {
120  public:
121  /**
122  * @see armarx::ManagedIceObject::getDefaultName()
123  */
124  std::string getDefaultName() const override
125  {
126  return "MaskRCNNPointCloudObjectLocalizer";
127  }
128 
129 
130  void getLocation(armarx::FramedOrientationBasePtr& orientation, armarx::FramedPositionBasePtr& position, const Ice::Current& c = ::Ice::Current()) override;
131 
132  memoryx::ObjectLocalizationResultList localizeObjectClasses(const memoryx::ObjectClassNameList& objectClassNames, const Ice::Current& c = ::Ice::Current()) override;
133 
134  protected:
135  /**
136  * @see visionx::PointCloudProcessor::onInitPointCloudProcessor()
137  */
138  void onInitPointCloudProcessor() override;
139 
140  /**
141  * @see visionx::PointCloudProcessor::onConnectPointCloudProcessor()
142  */
143  void onConnectPointCloudProcessor() override;
144 
145  /**
146  * @see visionx::PointCloudProcessor::onDisconnectPointCloudProcessor()
147  */
148  void onDisconnectPointCloudProcessor() override;
149 
150  /**
151  * @see visionx::PointCloudProcessor::onExitPointCloudProcessor()
152  */
153  void onExitPointCloudProcessor() override;
154 
155  /**
156  * @see visionx::PointCloudProcessor::process()
157  */
158  void process() override;
159 
160  /**
161  * @see PropertyUser::createPropertyDefinitions()
162  */
164 
165 
166  private:
167  std::mutex pointCloudMutex;
168 
169 
170  std::string agentName;
171 
172  std::string providerName;
173  std::string sourceNodeName;
174 
175 
176  std::mutex localizeMutex;
177 
178 
179  armarx::DebugDrawerInterfacePrx debugDrawerPrx;
180  armarx::RequestableServiceListenerInterfacePrx serviceTopic;
181  };
182 }
183 
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
visionx::MaskRCNNPointCloudObjectLocalizer::onDisconnectPointCloudProcessor
void onDisconnectPointCloudProcessor() override
Definition: MaskRCNNPointCloudObjectLocalizer.cpp:61
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
visionx::PointD
pcl::FPFHSignature33 PointD
Definition: MaskRCNNPointCloudObjectLocalizer.h:81
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
visionx::MaskRCNNPointCloudObjectLocalizer::onExitPointCloudProcessor
void onExitPointCloudProcessor() override
Definition: MaskRCNNPointCloudObjectLocalizer.cpp:66
visionx::MaskRCNNPointCloudObjectLocalizer
http://pointclouds.org/documentation/tutorials/global_hypothesis_verification.php
Definition: MaskRCNNPointCloudObjectLocalizer.h:116
visionx::MaskRCNNPointCloudObjectLocalizer::onConnectPointCloudProcessor
void onConnectPointCloudProcessor() override
Definition: MaskRCNNPointCloudObjectLocalizer.cpp:54
visionx::MaskRCNNPointCloudObjectLocalizerPropertyDefinitions::MaskRCNNPointCloudObjectLocalizerPropertyDefinitions
MaskRCNNPointCloudObjectLocalizerPropertyDefinitions(std::string prefix)
Definition: MaskRCNNPointCloudObjectLocalizer.h:92
visionx::PointCloudProcessor
The PointCloudProcessor class provides an interface for access to PointCloudProviders via Ice and sha...
Definition: PointCloudProcessor.h:186
PCLUtilities.h
FramedPose.h
visionx::MaskRCNNPointCloudObjectLocalizerPropertyDefinitions
Definition: MaskRCNNPointCloudObjectLocalizer.h:88
MemoryXCoreObjectFactories.h
visionx::PointCloudProcessorPropertyDefinitions
Properties of PointCloudProcessor.
Definition: PointCloudProcessor.h:173
PointCloudProcessor.h
visionx::MaskRCNNPointCloudObjectLocalizer::getDefaultName
std::string getDefaultName() const override
Definition: MaskRCNNPointCloudObjectLocalizer.h:124
Component.h
visionx::PointL
pcl::PointXYZRGBL PointL
Definition: MaskRCNNPointCloudObjectLocalizer.h:80
visionx::MaskRCNNPointCloudObjectLocalizer::getLocation
void getLocation(armarx::FramedOrientationBasePtr &orientation, armarx::FramedPositionBasePtr &position, const Ice::Current &c=::Ice::Current()) override
Definition: MaskRCNNPointCloudObjectLocalizer.cpp:227
visionx::MaskRCNNPointCloudObjectLocalizer::localizeObjectClasses
memoryx::ObjectLocalizationResultList localizeObjectClasses(const memoryx::ObjectClassNameList &objectClassNames, const Ice::Current &c=::Ice::Current()) override
Definition: MaskRCNNPointCloudObjectLocalizer.cpp:79
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface >
visionx::MaskRCNNPointCloudObjectLocalizer::onInitPointCloudProcessor
void onInitPointCloudProcessor() override
Definition: MaskRCNNPointCloudObjectLocalizer.cpp:40
visionx::MaskRCNNPointCloudObjectLocalizer::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: MaskRCNNPointCloudObjectLocalizer.cpp:233
ArmarXDataPath.h
armarx::PropertyDefinitionBase::eModifiable
@ eModifiable
Definition: PropertyDefinitionInterface.h:57
visionx::PointT
pcl::PointXYZRGBA PointT
Definition: MaskRCNNPointCloudObjectLocalizer.h:79
visionx::MaskRCNNPointCloudObjectLocalizer::process
void process() override
Definition: MaskRCNNPointCloudObjectLocalizer.cpp:70