ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to pass Pointcloud2 message to PCL smoothing algorithm?

asked 2022-12-16 08:30:20 -0500

HossamAlzomor gravatar image

I am following the ROS PCL tutorials , When I try to implement the Smoothing and normal estimation based on polynomial reconstruction algorithm I get the following error error

C2664: 'void pcl::PCLBase<pointint>::setInputCloud(const boost::shared_ptr<const pcl::pointcloud<pointt="">> &)': cannot convert argument 1 from 'const pcl::PCLPointCloud2ConstPtr' to 'const boost::shared_ptr<const pcl::pointcloud<pointt="">> &'

    with
    [
        PointInT=pcl::PointXYZ,
        PointT=pcl::PointXYZ
    ]
    and
    [
        PointT=pcl::PointXYZ
    ]

How to pass PointCloud2 message to this algorithm?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2022-12-17 08:32:01 -0500

Mike Scheutzow gravatar image

updated 2022-12-17 08:35:39 -0500

The conversion function is named pcl::fromROSMsg() from ros package pcl_conversions. Also see answers to #q405219.

edit flag offensive delete link more
0

answered 2022-12-19 10:15:08 -0500

HossamAlzomor gravatar image

in the following page I found

The publisher takes care of the conversion (serialization) between sensor_msgs::PointCloud2 and pcl::PointCloud<t> where needed

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-12-16 08:30:20 -0500

Seen: 120 times

Last updated: Dec 19 '22