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

include z axis in my pointcloud data

asked 2018-06-03 05:00:11 -0500

cloud12 gravatar image

converting my LaserScan data into pointCloud by laser_geometry package , produces pointcloud data with z=0, as mentioned in the documentation, and what i am getting is a 2D point cloud with only x and y , how should i include z axis with into my point cloud messages?

edit retag flag offensive close merge delete

Comments

You already do. The Z value of all points from a 2D laser scan will be zero. Where are you expecting to get the z information from?

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2018-06-03 06:14:21 -0500 )edit

i intentionally wants to provide various z values to my point cloud , so that each time my laser, which is mounted on a servo motor tilts by an angle, the same can be reflected in the plot in rviz

cloud12 gravatar image cloud12  ( 2018-06-04 00:56:56 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-06-04 07:55:01 -0500

Okay, I understand your question now. I have built a 3D LiDAR scanning system the same as you describe here.

To get the 3D LiDAR data it's not ideal to manually add z values to the point cloud, the way to do this is to use the TF system. You need to generate a Transform that describes the location and orientation of your LiDAR sensor in a suitable parent frame (body_frame for a rover or world for a fixed sensor). When your servo moves, this Transform needs to update to reflect the changing position of the LiDAR sensor.

The frame_id of the 2D laser scan messages needs to be set to the new sensor frame you've created, so that when the servo moves the points will be shown in the correct place in RVIZ. This is the correct way of handling moving sensors in ROS.

If you want to assemble these scans into a single point cloud, convert each laser scan message to a point cloud then transform it into the parent frame. Adding these transformed 2D point clouds into a single point cloud will create a single 3D point cloud.

Hope this helps.

edit flag offensive delete link more

Comments

whenever there is a transformation , all the pointclouds jumps to new transformed frame , leaving no data in previous frames , i guess conversion of the point cloud to parent frame is a issue here

cloud12 gravatar image cloud12  ( 2018-06-06 09:33:25 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2018-06-03 05:00:11 -0500

Seen: 493 times

Last updated: Jun 04 '18