# Revision history [back]

### Gmapping doesn't mark free spaces

in the documentation for Gmapping it is said :

The maximum range of the sensor. If regions with no obstacles within the range of the sensor should appear as free space in the map, set maxUrange < maximum range of the real sensor <= maxRange.

now my laser sensor has a maximum range of 30 meters so i set the maxRange parameter to 30.0 and maxUrange parameter to 29.0 but gammping still doesn't mark free spaces when obstacles are out of range .

in fact when the laser doesn't detect any obstacles in the range of 30 meters this 30 meters area is not marked as free and remains unknown. I changed maxUrange and maxRange to many different values but that didn't help.

I also visited here and [here] (https://answers.ros.org/question/222692/gmapping-how-to-mark-out-of-range-laserscan-as-free-space/) but they didn't help . there's also an open issue for this problem on GitHub repo for slam_gmapping below are the parameters I use for gmapping :

<?xml version="1.0"?>
<launch>
<arg name="robotname" default="robot1"/>
<group ns="$(arg robotname)"> <node pkg="gmapping" type="slam_gmapping" name="mapping"> <param name="map_frame" value="/map" /> <param name="base_frame" value="$(arg robotname)/base_link"/>
<param name="odom_frame" value="$(arg robotname)/odom" /> <remap from="scan" to="/$(arg robotname)/hokuyo" />
<param name="map_update_interval" value="0.1" />
<param name="delta" value="0.2 "/>
<param name="particle" value="5" />
<param name="iterations" value="1" />
<param name="maxUrange" value="29" />
<param name="maxRange" value="30" />
<param name="linearUpdate" value="0.1" />
<param name="xmin" value="-75" />
<param name="xmax" value="75" />
<param name="ymax" value="75" />
<param name="ymin" value="-75" />

</node>
</group>
</launch>


I was wondering If anyone has a solution. btw I am using ros kinetic on Ubuntu 16.04