Robotics StackExchange | Archived questions

Instant incorrect laser distance reading in simulation

I am working o an obstacle avoidance algorithm. I am using Hokuyo laser sensor to detect obtacles. Scan rate is 50Hz and resolution is 0.01. My obstacle avoidance algorithm would be active when the minimum distance to an obstacle is closer than 0.5m. However, ranges have instantly low values. So obstacle avoidance is always active. How can i prevent these misreadings?

Asked by aircraftpilot5 on 2020-12-07 05:52:57 UTC

Comments

It may help to plot and describe the data a bit. Is there anything the lidar may actually be detecting, like dirt or smudges? What kind of low values--all/some zeros? Is it noisy, or a dead spot? The LaserScanRangeFilter from the laser_filters package may be what you're after, but it's hard to say without knowing what the actual issue is.

Asked by tryan on 2020-12-07 12:52:23 UTC

I am working in the Gazebo environment. Nothing is seeming at this points. I have plotted the range data, for example one of them includes 0.2m among the 100 samples near 16m ranges.

Asked by aircraftpilot5 on 2020-12-08 02:44:30 UTC

The first thing I would check in simulation is that you don't have a collision element in the way. Collision elements are not visible by default, so you'll probably have to enable them. One way to do that is to right click on your robot in the Gazebo scene then View > Collisions. Also, can you post the plot of the range data here?

Asked by tryan on 2020-12-08 08:29:37 UTC

Answers

(Quite a few assumptions in this answer, as you don't specify which laserscanner you have, but still...)

Usually, laser scanners have a minimum range at which they can produce meaningful results. This is also reflected in the sensor_msgs/LaserScans range_min property. You should definitely disregard any value below this. However, this also means that the scanners driver properly sets this value. Check the data sheet and double check.

Also, laser scanners have different behaviors in error cases or max-range readings. Some scanners provide proper max-range and/or error-codes, some scanners (and if I remember correctly some Hokuyo scanners do that), provide min-range or close-to-zero readings when they are above their max range. This often lead to strange behavior in larger environments w.r.t. costmap clearing using the Hokuyo URG-04-LX scanner. Put your scanner/robot in a "boxed environment" and check if you get proper readings when you definitely don't have any max-range or error messages (i.e. all walls should be good detectable by the scanner).

Asked by mgruhler on 2020-12-08 02:26:27 UTC

Comments

Thank you for your answer. The minimum range is set 0.08m and maximum is 30m. I've started my drone surrounded with walls on Gazebo. When i examine the range data, for example i encounter 100 samples about 16m and a 0.2m among them. I could not eliminate that.

Asked by aircraftpilot5 on 2020-12-08 02:39:33 UTC

Your not working with a real scanner, but in simulation?!?

Asked by mgruhler on 2020-12-08 02:50:14 UTC

Yes, for now in simulation.

Asked by aircraftpilot5 on 2020-12-08 02:59:12 UTC

Well, that is some quite relevant piece of information :-) You should have started with that... I took the liberty to retag and edit your quesiton title...

Forget all physical effects, dirt, smudges, etc...

can you share your model/code that starts the simulation? If the values at those ranges / angles are constant, you are probably hitting some part of your model (might not be visible, but used for the raytrace operation)

Asked by mgruhler on 2020-12-08 04:09:53 UTC