35 usingProxy(getProperty<std::string>(
"RobotStateComponentName").getValue());
36 resultCloud.reset(
new pcl::PointCloud<pcl::PointXYZ>());
39 filter.setStddevMulThresh(1.0);
46 robotStateComponent = getProxy<RobotStateComponentInterfacePrx>(getProperty<std::string>(
"RobotStateComponentName").getValue());
66 pcl::PointCloud<pcl::PointXYZ> cloud;
67 cloud.points.reserve(scan.size());
69 for (
const LaserScanStep& l : scan)
72 p.x = -l.distance * std::sin(l.angle);
73 p.y = l.distance * std::cos(l.angle);
75 cloud.points.push_back(p);
79 cloud.width = cloud.points.size();
82 std::unique_lock<std::mutex> lock(mutex, std::try_to_lock);
84 if (!lock.owns_lock())
94 const std::string& frameName = name;
96 if (localRobot->hasRobotNode(frameName))
99 pcl::transformPointCloud(cloud, clouds[name],
transform);
101 resultCloud->clear();
102 for (
auto& kv : clouds)
104 const pcl::PointCloud<pcl::PointXYZ>&
c = kv.second;
113 if(resultCloud->empty())
119 pcl::PointCloud<pcl::PointXYZ>::Ptr cloudFiltered(
new pcl::PointCloud<pcl::PointXYZ>());
120 filter.setInputCloud(resultCloud);
121 filter.filter(*cloudFiltered);
125 providePointCloud(cloudFiltered);
134 def->topic<LaserScannerUnitListener>(
"LaserScans",
"laser_scanner_topic",
"Name of the laser scanner topic.");
142 visionx::MetaPointCloudFormatPtr info =
new visionx::MetaPointCloudFormat();
144 info->size = info->capacity;
145 info->type = visionx::PointContentType::ePoints;