27#include <pcl/filters/filter.h>
86 pcl::PointCloud<PointT>::Ptr inputCloud(
new pcl::PointCloud<PointT>());
91 ARMARX_INFO <<
"Timeout or error while waiting for point cloud data";
107 std::to_string(inputCloud->header.stamp) +
".pcd";
109 const auto isNan = [](
const PointT& p) ->
bool {
return std::isnan(p.z); };
113 inputCloud->points.erase(
114 std::remove_if(inputCloud->points.begin(), inputCloud->points.end(), isNan),
115 inputCloud->points.end());
117 inputCloud->width = inputCloud->points.size();
118 inputCloud->height = 1;
119 inputCloud->is_dense =
true;
124 pcl::io::savePCDFileBinary(fileName, *inputCloud);
128 pcl::io::savePCDFileASCII(fileName, *inputCloud);
131 ARMARX_LOG <<
"writing to file: " << fileName;
136 if (numClouds && currentCloud >= numClouds)
140 PointCloudProcessor::onDisconnectComponent();
144 cycleKeeper->waitForCycleDuration();
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Property< PropertyType > getProperty(const std::string &name)
This util class helps with keeping a cycle time during a control cycle.
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
TopicProxyType getTopic(const std::string &name)
Returns a proxy of the specified topic.
ArmarXManagerPtr getArmarXManager() const
Returns the ArmarX manager used to add and remove components.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onExitPointCloudProcessor() override
void onConnectPointCloudProcessor() override
void onDisconnectPointCloudProcessor() override
void onInitPointCloudProcessor() override
void enableResultPointClouds(std::string resultProviderName="")
Enables visualization.
int getPointClouds(const PointCloudPtrT &pointCloudPtr)
Poll PointClouds from provider.
bool waitForPointClouds(int milliseconds=1000)
Wait for new PointClouds.
void provideResultPointClouds(const PointCloudPtrT &pointClouds, std::string providerName="")
sends result PointClouds for visualization
#define ARMARX_INFO
The normal logging level.
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.