ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

How to align velodyne point clouds?

asked 2017-05-17 17:25:16 -0600

mmy227 gravatar image

Hi, I have a Velodyne sensor on a robot and am trying to build a 2D map from the velodyne point clouds using octomap. I have odometry in the form of nav_msgs/Odometry messages from the /world to /base_link frame. How do I transform the velodyne point clouds so they are aligned even when the robot moves and turns?

I tried using pcl_ros::transformPointCloud with a tf listener that looked up the transform from the /world frame to the /velodyne frame but got an error saying the /velodyne frame does not exist. I have considered using the TransformNodelet from the velodyne_pointcloud package but am having issues with the calibration file. Would using the TransformNodelet with the specified frame as /world align the point clouds?

Thank you!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-05-18 01:47:10 -0600

ufr3c_tjc gravatar image

When you got the error saying that the /velodyne frame doesn't exist, it means you haven't defined it in your URDF. Put a link in your URDF at the location of the velodyne sensor on the robot, and give it a fixed type joint. Then, your current approach should work. See below for an example.

<link name="velodyne"/>

<joint name="velodyne_to_base_link" type="fixed">
  <parent link="base_link"/>
  <child link="velodyne"/>
  <origin xyz="0 0 0" rpy="0 0 0"/>

I'm not sure exactly how the octomap package works, but you don't normally need to transform data yourself (at least for packages like gmapping, AMCL). You can usually just feed in the raw point cloud data, with velodyne as the frame_id, and the package should transform it itself (reducing the chance you make a mistake in your own transforming). Either way, make sure the velodyne link is in the correct spot and you should be fine.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2017-05-17 17:25:16 -0600

Seen: 712 times

Last updated: May 18 '17