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

How to change fake laser scan direction of rotation

asked 2011-03-12 09:47:59 -0600

updated 2016-10-24 09:01:17 -0600

ngrennan gravatar image

So I've generated my fake laser scan from the Kinect sensor point cloud using laserscan_to_pointcloud and am doing 2D SLAM using gmapping in a manner similar to the Turtlebot, but it looks as if the occupancy grid is being updated as if the laser were rotating in the opposite direction (anticlockwise instead of clockwise). What's the best way to change the laser scan direction within gmapping/slam_gmapping ? Displaying the fake laser scan I can see that it's in the correct orientation, it's just the gmapping node which is mirroring it.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2011-03-12 19:54:30 -0600

Within the URDF the rpy orientation of the fake laser can be altered such that it's equivalent to turning it upside down. This brings both the laser scan display and also the occupancy grid update into agreement.

edit flag offensive delete link more

answered 2011-07-19 21:40:43 -0600

felix k gravatar image

updated 2011-07-19 21:42:01 -0600

If still topical or not: gmapping is indeed re-inverting the laser scan direction, but there is a bug which I wrote about in">ros-pkg ticket #4984. without my given patch it had not worked for me neither, I'm using the rod4_node package which gives an inverted scan.

edit flag offensive delete link more

answered 2011-03-12 16:16:34 -0600

Chad Rockey gravatar image

Is your kinect mounted upside down? You say that you see that the scan is in the correct orientation, so I assume that this is in RVIZ and relative to base_link?

If that's the case, what are min_angle and max_angle set to? Is should be that min_angle is something like -pi/2 and max_angle is pi/2? And then the angle_increment is positive?

If all of those are the case, what version of gmapping are you using? The newest ones use the TF data to reverse upside down scans. You may want to try running with inverted_laser being set to true, but this was been removed/deprecated as of 1.1.1. You can see more at the gmapping docs.

These are good first debugging steps. Let everyone know what the results from these are.

edit flag offensive delete link more


No. The Kinect point cloud and also the fake laser appear in the correct orientation within Rviz.
JediHamster gravatar image JediHamster  ( 2011-03-12 19:35:45 -0600 )edit

Question Tools



Asked: 2011-03-12 09:47:59 -0600

Seen: 3,429 times

Last updated: Jul 19 '11