PointCloudRecorder.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::PointCloudRecorder
17  * @author Markus Grotz ( markus dot grotz at kit dot edu )
18  * @date 2017
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 
26 
27 
29 
30 #include <ArmarXCore/interface/observers/ObserverInterface.h>
31 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
32 
34 
35 #include <pcl/point_types.h>
36 
37 #include <pcl/io/pcd_io.h>
38 
39 
41 
42 
43 
44 namespace armarx
45 {
46 
47  using PointT = pcl::PointXYZRGBL;
48 
55  {
56  public:
59  {
60  defineOptionalProperty<std::string>("Folder", "/tmp", "Path where to store the point clouds.");
61  defineOptionalProperty<std::string>("DebugObserverName", "DebugObserver", "Name of the topic the DebugObserver listens on");
62  defineOptionalProperty<std::string>("DebugDrawerTopicName", "DebugDrawerUpdates", "Name of the DebugDrawerTopic");
63  defineOptionalProperty<float>("UpdateRate", 2.0f, "Frequency how often the voxel grid is updated");
64  defineOptionalProperty<int>("NumPointClouds", 0, "Number of point clouds before exiting");
65  defineOptionalProperty<bool>("WriteBinary", true, "If enabled, the point clouds will be stored in binary format. Otherwise, in ASCII format.");
66  defineOptionalProperty<bool>("RemoveNaNs", true, "If enabled, invalid points will be removed from the point cloud.");
67  }
68  };
69 
83  virtual public visionx::PointCloudProcessor
84  {
85  public:
89  std::string getDefaultName() const override
90  {
91  return "PointCloudRecorder";
92  }
93 
94  protected:
98  void onInitPointCloudProcessor() override;
99 
103  void onConnectPointCloudProcessor() override;
104 
108  void onDisconnectPointCloudProcessor() override;
109 
113  void onExitPointCloudProcessor() override;
114 
118  void process() override;
119 
124 
125 
126  private:
127 
128  DebugDrawerInterfacePrx debugDrawer;
129  DebugObserverInterfacePrx debugObserver;
130 
131 
132  std::unique_ptr<armarx::CycleUtil> cycleKeeper;
133 
134  int numClouds;
135  int currentCloud;
136 
137  bool writeBinary;
138  bool removeNaNs;
139  };
140 }
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
armarx::DebugObserverInterfacePrx
::IceInternal::ProxyHandle< ::IceProxy::armarx::DebugObserverInterface > DebugObserverInterfacePrx
Definition: JointController.h:42
armarx::PointCloudRecorderPropertyDefinitions
Definition: PointCloudRecorder.h:53
visionx::PointCloudProcessorPropertyDefinitions::PointCloudProcessorPropertyDefinitions
PointCloudProcessorPropertyDefinitions(std::string prefix)
Definition: PointCloudProcessor.cpp:111
armarx::PointCloudRecorder::process
void process() override
Definition: PointCloudRecorder.cpp:78
armarx::PointCloudRecorderPropertyDefinitions::PointCloudRecorderPropertyDefinitions
PointCloudRecorderPropertyDefinitions(std::string prefix)
Definition: PointCloudRecorder.h:57
visionx::PointCloudProcessor
The PointCloudProcessor class provides an interface for access to PointCloudProviders via Ice and sha...
Definition: PointCloudProcessor.h:186
armarx::PointT
pcl::PointXYZRGBL PointT
Definition: Common.h:28
armarx::PointCloudRecorder::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: PointCloudRecorder.cpp:36
visionx::PointCloudProcessorPropertyDefinitions
Properties of PointCloudProcessor.
Definition: PointCloudProcessor.h:173
PointCloudProcessor.h
Component.h
CycleUtil.h
armarx::PointCloudRecorder::onConnectPointCloudProcessor
void onConnectPointCloudProcessor() override
Definition: PointCloudRecorder.cpp:59
armarx::PointCloudRecorder::onInitPointCloudProcessor
void onInitPointCloudProcessor() override
Definition: PointCloudRecorder.cpp:44
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::PointCloudRecorder::onDisconnectPointCloudProcessor
void onDisconnectPointCloudProcessor() override
Definition: PointCloudRecorder.cpp:70
armarx::DebugDrawerInterfacePrx
::IceInternal::ProxyHandle< ::IceProxy::armarx::DebugDrawerInterface > DebugDrawerInterfacePrx
Definition: JointController.h:40
armarx::PointCloudRecorder
Brief description of class PointCloudRecorder.
Definition: PointCloudRecorder.h:82
armarx::PointCloudRecorder::getDefaultName
std::string getDefaultName() const override
Definition: PointCloudRecorder.h:89
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::PointCloudRecorder::onExitPointCloudProcessor
void onExitPointCloudProcessor() override
Definition: PointCloudRecorder.cpp:74