(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/LaserScan
s 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).
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 thelaser_filters
package may be what you're after, but it's hard to say without knowing what the actual issue is.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.
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?