0
$\begingroup$

Rosanswers logo

Quite new to this was toying with Turtlebot GMapping on ROS Kinetic when I encountered this error.

According to the topic description, any distance above 10 m will be referred to as nan. But while simulating, the msg.ranges[300], which refers to the front , gives nan value, especially if the object is round or has cylindrical surface.

I changed the logic, so that on such occurrence, it keeps rotating. But the RViz map gets severely distorted, as it estimates the value at infinity or very far. How do I fix that?

RViz map distortion: https://imgur.com/TXFw3qV Node: https://imgur.com/mpQvbtY


Originally posted by Yokai- on ROS Answers with karma: 23 on 2021-07-12

Post score: 0


Original comments

Comment by Mike Scheutzow on 2021-07-12:
On http://wiki.ros.org/gmapping I see parameters ~maxRange and ~maxUrange. Have you set them to reasonable values?

Comment by mgruhler on 2021-07-13:
Also, could you please clarify if this is an issue with gmapping or if those are the actual values that get reported by your laserscanner? If yes, which laserscanner are you using (model, simulated)?

Comment by Yokai- on 2021-07-13:
@Mike Scheutzow, I'm using the gmapping_demo provided by the turtlebot tutorial, which has a max range set to 80 m by default. But the issue is with LaserScan which gives the distance of very close round objects as nan (>10 m). Even if I'm not using the turtlebot_gazebo gmapping_demo.launch file, the LaserScan alone gives faulty results

Comment by Yokai- on 2021-07-13:
@mgruhler, I see no issue with GMapping, the LaserScan is providing faulty nan values. As for the laserscanner sensor used by the model is "360 Laser Distance Sensor LDS-01", according to https://emanual.robotis.com/docs/en/platform/turtlebot3/features/#features

Comment by mgruhler on 2021-07-13:
I'm confused. Are you running in simulation (gazebo) or a real robot with a real sensor?

Comment by Yokai- on 2021-07-13:
@mgruhler , sorry for not understanding earlier. It is a simulation.

Comment by Mike Scheutzow on 2021-07-13:
I have not run this particular simulation, but why are you surprised that a nan clears out the map up to 80 meters? You have told gmapping that the laser data is reliable out to that distance. Also, be aware that you can get nan in the real world because not every surface cleanly reflects the laser beam back to the lidar.

Comment by Yokai- on 2021-07-13:
@Mike Scheutzow , I have no issues with nan clearing out the map. My issue is that the laserscan gives nan data for objects as close as 1 m from the robot, which is incorrect. This happens especially if the object is cylindrical. Maybe I failed to clarify my question. Sorry for that.

You can find the snap shot here : https://imgur.com/TXFw3qV

Comment by Mike Scheutzow on 2021-07-13:
All lidars I'm familiar with also have a minimum distance. They do not work down to 0 meters. You would need to look at the simulation model to know how yours is configured.

Comment by Mike Scheutzow on 2021-07-13:
Please describe what you mean by "distortion". You first image is too small for me to make out the details, but it looks to me like the robot has not moved around that section enough to build up a good map. That cylindar adjacent to the robot is blocking a very big arc of the lidar scan.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

All lidars have a minimum range. Objects closer than this distance usually return either 0 or NotANumber (nan).

To get optimal results, you must properly configure gmapping for the sensors you are using. Getting a nan sample from a lidar is normal and means "no light bounced back." gmapping will interpret this value as "no obstacles out to maximum range" for that ray.

If you move the robot to a new pose, it may then see an object that was previously not visible.


Originally posted by Mike Scheutzow with karma: 4903 on 2021-07-13

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.