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

transformLaserScanToPointCloud and pcl::fromROSMsgs???

asked 2012-03-07 21:16:43 -0600

liquidmonkey gravatar image

updated 2014-04-20 14:09:44 -0600

ngrennan gravatar image

i've taken a sensor_msgs/LaserScan and used transformLaserScanToPointCloud to get a new sensor_msgs/PointCloud.

originally my laserScan only had single values but after this, when i cout the ->points, there seems to be three values, (something, something, 0)

and since i want to be able to perform some pcl functions on my laser data i then use pcl::fromROSMsgs to take the sensor_msgs/PointCloud and transform it into a PointCloud of type PointXYZ.

and now using cout to view the ->points, there are now three values, (something, something, something).

what exaclty has happened to my original laser readings which were in meters? i thought i could access the laser values in the PointXYZ form by using ->points._x as is shown on the struct page here... http://docs.pointclouds.org/1.3.1/structpcl_1_1_point_x_y_z.html

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2012-03-07 22:18:28 -0600

dornhege gravatar image

I'm not really sure, what your problem is. What has happened is exactly what should have happened and as I read it also what you want. The laser scan distances in meters have been converted into a point cloud with coordinates. The (something, something, 0) is the point coordinates (x,y,z) and the z is 0 because there is no height information. They are still in meters. Is this what you want?

edit flag offensive delete link more

Comments

yes it is and its working, thank you :)

liquidmonkey gravatar image liquidmonkey  ( 2012-03-08 00:00:00 -0600 )edit

Question Tools

Stats

Asked: 2012-03-07 21:16:43 -0600

Seen: 691 times

Last updated: Mar 07 '12