DLu / navigation_layers

155 stars 136 forks source link

Obstacles forming just a dot on costmap #68

Closed SherlockSheep closed 4 years ago

SherlockSheep commented 4 years ago

Hi, I'm using sonar with the range_sensor_layer kinetic version. There's something odd that obstacle form just a dot on the costmap, which is supposed to be an arc. 1539239532950636

DLu commented 4 years ago

Are you setting any custom parameters?

SherlockSheep commented 4 years ago

I used: phi = 1.2 inflate_cone=0.0 clear_threshold=0.2 mark_threshold=0.8 clear_on_max_reading=true.

After reading your code and paper 'A comparison of three uncertainty calculi for building sonar-based occupancy grids' by Miguel Ribo, I found out the reason: the pixels' priors were already cleared to 0 before the sensor cone reached the obstacle. So only the pixel on the sensor's x-axis was set to 233.

But if I turn clear_on_max_reading to false, there will always be a point at the sensor's max-reading-position.

To solve this I made a judgment statement: if the reading reaches max-reading, don't set prior. And when clearing sensor cone, never clear pixels further than max-reading.

Combinacijus commented 4 years ago

For me on Melodic works the same puts a dot instead of an arc. And I would say this is correct behaviour. If it marked whole arch your map quality would be worse because you don't know at which point of the arc obstacle is located. At greater distances arc will be larger and it could easily block narrow spaces. I have robot with 10 sonars all around and I would say it works reasonably well as is. As for workaround you could either modify code or add multiple fake sonar sensor a few degrees apart from a some sensor and publish same data to all of them this would make some kind of an arc.

SherlockSheep commented 4 years ago

@Combinacijus Thanks for commenting. I'v modified the code to meet my demand.

Magmanat commented 3 years ago

Hi @SherlockSheep i am having this issue as well, is it possible to send me the fix that you did?