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

sensor_msgs::LaserScan to PCLPointCloud2 in Indigo

asked 2015-01-27 12:14:02 -0500

Pototo gravatar image

updated 2015-01-27 12:15:33 -0500

Hi folks,

I want to know how can I convert an sensor_msgs::LaserScan::ConstPtr& to an pcl::PCLPointCloud2 object?

Specifically, what libraries (e.g., "pcl/conver.h" or something like that), what functions (e.g., pcl::fromLasertoPoinCloud() or something like that), and intermediary conversion variables, if any (e.g., from laser-->laserToCloud_holder-->PCLPointCloud).

PS: giving me the direct answer right here is 10x more useful than sending me to a "Migration" website, etc. (because I am also reading some of them already). Sample code/projects is also useful!

Thanks in advanced.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-01-27 12:58:48 -0500

tfoote gravatar image

The laser_geometry package has a library for projecting laser scans into point clouds:

edit flag offensive delete link more


Hi, Yes, I saw that, but I'm trying to change from pcl::PCLPointCloud2, and not from sensor_msgs::PointCloud2.

Pototo gravatar image Pototo  ( 2015-01-27 13:09:57 -0500 )edit

Do you think there is an extra step that I would have to follow to get to PCLPointCloud2 form the conversion from laser to sensor_msgs::PointCloud to convert that data to PCLPointCloud2? Thanks

Pototo gravatar image Pototo  ( 2015-01-27 13:10:58 -0500 )edit

Yes, but those methods are in the PCL library and not in ROS. ROS will take you as far as pcl::PointCloud

paulbovbel gravatar image paulbovbel  ( 2015-01-27 13:21:19 -0500 )edit

Question Tools

1 follower


Asked: 2015-01-27 12:14:02 -0500

Seen: 1,988 times

Last updated: Jan 27 '15