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

chuong's profile - activity

2015-08-03 08:11:44 -0500 received badge  Good Answer (source)
2015-08-01 03:42:59 -0500 received badge  Nice Answer (source)
2015-07-19 19:51:25 -0500 commented answer Scan message must contain angles from -x to x

I tested @Vincent Rabaud's patch and found gmapping didn't run as expected. It printed "Registering First Scan" then stopped updating. There was no other output until being killed.

2015-07-16 00:01:30 -0500 received badge  Teacher (source)
2015-07-16 00:01:30 -0500 received badge  Necromancer (source)
2015-07-15 22:43:13 -0500 received badge  Editor (source)
2015-07-15 22:32:04 -0500 answered a question Scan message must contain angles from -x to x

This error is due to recent change in gmapping package. This can be fixed by modifying and recompiling the gmapping package as follows:

$ wget http://packages.ros.org/ros/ubuntu/pool/main/r/ros-indigo-gmapping/ros-indigo-gmapping_1.3.7.orig.tar.gz
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
$ catkin_init_workspace
$ tar xvf ../../ros-indigo-gmapping_1.3.7.orig.tar.gz
$ mv ros-indigo-gmapping-1.3.7/ gmapping
$ gedit gmapping/src/slam_gmapping.cpp
Change line 409 from:
  if (fabs(fabs(scan.angle_min) - fabs(scan.angle_max)) > FLT_EPSILON)
to:
  if (fabs(fabs(scan.angle_min) - fabs(scan.angle_max)) > 0.003) // this is the value for Kinect
Save and close the file. Go back to commandline:

$ cd ..
$ catkin_make
$ sudo cp devel/lib/gmapping/slam_gmapping* /opt/ros/indigo/lib/gmapping/
This works for me.

2015-07-15 22:09:48 -0500 commented question Scan message must contain angles from -x to x

I have the same problem. This is the new behaviour in the latest ros-indigo-gmapping-1.3.7 package. CHANGELOG.rst says: .... * Added cfloat include * Change arbitrary constant to FLT_EPSILON * Added check that scan goes from -x to x .......