36 usingProxy(getProperty<std::string>(
"RobotStateComponentName").getValue());
37 resultCloud.reset(
new pcl::PointCloud<pcl::PointXYZ>());
40 filter.setStddevMulThresh(1.0);
47 robotStateComponent = getProxy<RobotStateComponentInterfacePrx>(
48 getProperty<std::string>(
"RobotStateComponentName").getValue());
66 const std::string& name,
67 const LaserScan& scan,
68 const TimestampBasePtr& timestamp,
69 const Ice::Current&
c)
71 pcl::PointCloud<pcl::PointXYZ> cloud;
72 cloud.points.reserve(scan.size());
74 for (
const LaserScanStep& l : scan)
77 p.x = -l.distance * std::sin(l.angle);
78 p.y = l.distance * std::cos(l.angle);
80 cloud.points.push_back(p);
84 cloud.width = cloud.points.size();
87 std::unique_lock<std::mutex> lock(mutex, std::try_to_lock);
89 if (!lock.owns_lock())
99 const std::string& frameName = name;
101 if (localRobot->hasRobotNode(frameName))
104 pcl::transformPointCloud(cloud, clouds[name],
transform);
106 resultCloud->clear();
107 for (
auto& kv : clouds)
109 const pcl::PointCloud<pcl::PointXYZ>&
c = kv.second;
118 if (resultCloud->empty())
121 <<
"Input point cloud is empty. Will not report anything.";
125 pcl::PointCloud<pcl::PointXYZ>::Ptr cloudFiltered(
new pcl::PointCloud<pcl::PointXYZ>());
126 filter.setInputCloud(resultCloud);
127 filter.filter(*cloudFiltered);
131 providePointCloud(cloudFiltered);
140 def->topic<LaserScannerUnitListener>(
141 "LaserScans",
"laser_scanner_topic",
"Name of the laser scanner topic.");
146 visionx::MetaPointCloudFormatPtr
149 visionx::MetaPointCloudFormatPtr info =
new visionx::MetaPointCloudFormat();
151 info->size = info->capacity;
152 info->type = visionx::PointContentType::ePoints;