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#include <pcl/io/pcd_io.h>
27#include <pcl/point_types.h>
28
31#include <ArmarXCore/interface/observers/ObserverInterface.h>
32
33#include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
34
36
37namespace armarx
38{
39
40 using PointT = pcl::PointXYZRGBL;
41
42 /**
43 * @class PointCloudRecorderPropertyDefinitions
44 * @brief
45 */
48 {
49 public:
52 {
54 "Folder", "/tmp", "Path where to store the point clouds.");
55 defineOptionalProperty<std::string>("DebugObserverName",
56 "DebugObserver",
57 "Name of the topic the DebugObserver listens on");
59 "DebugDrawerTopicName", "DebugDrawerUpdates", "Name of the DebugDrawerTopic");
61 "UpdateRate", 2.0f, "Frequency how often the voxel grid is updated");
63 "NumPointClouds", 0, "Number of point clouds before exiting");
64 defineOptionalProperty<bool>("WriteBinary",
65 true,
66 "If enabled, the point clouds will be stored in binary "
67 "format. Otherwise, in ASCII format.");
69 "RemoveNaNs",
70 true,
71 "If enabled, invalid points will be removed from the point cloud.");
72 }
73 };
74
75 /**
76 * @defgroup Component-PointCloudRecorder PointCloudRecorder
77 * @ingroup VisionX-Components
78 * A description of the component PointCloudRecorder.
79 *
80 * @class PointCloudRecorder
81 * @ingroup Component-PointCloudRecorder
82 * @brief Brief description of class PointCloudRecorder.
83 *
84 * Detailed description of class PointCloudRecorder.
85 */
86
88 {
89 public:
90 /**
91 * @see armarx::ManagedIceObject::getDefaultName()
92 */
93 std::string
94 getDefaultName() const override
95 {
96 return "PointCloudRecorder";
97 }
98
99 protected:
100 /**
101 * @see visionx::PointCloudProcessor::onInitPointCloudProcessor()
102 */
103 void onInitPointCloudProcessor() override;
104
105 /**
106 * @see visionx::PointCloudProcessor::onConnectPointCloudProcessor()
107 */
108 void onConnectPointCloudProcessor() override;
109
110 /**
111 * @see visionx::PointCloudProcessor::onDisconnectPointCloudProcessor()
112 */
113 void onDisconnectPointCloudProcessor() override;
114
115 /**
116 * @see visionx::PointCloudProcessor::onExitPointCloudProcessor()
117 */
118 void onExitPointCloudProcessor() override;
119
120 /**
121 * @see visionx::PointCloudProcessor::process()
122 */
123 void process() override;
124
125 /**
126 * @see PropertyUser::createPropertyDefinitions()
127 */
129
130
131 private:
132 DebugDrawerInterfacePrx debugDrawer;
133 DebugObserverInterfacePrx debugObserver;
134
135
136 std::unique_ptr<armarx::CycleUtil> cycleKeeper;
137
138 int numClouds;
139 int currentCloud;
140
141 bool writeBinary;
142 bool removeNaNs;
143 };
144} // namespace armarx
Brief description of class PointCloudRecorder.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onExitPointCloudProcessor() override
void onConnectPointCloudProcessor() override
void onDisconnectPointCloudProcessor() override
void onInitPointCloudProcessor() override
std::string getDefaultName() const override
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)
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
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface > DebugDrawerInterfacePrx
pcl::PointXYZRGBL PointT
Definition Common.h:30
ArmarX headers.