magazino / move_base_flex

Move Base Flex: a backwards-compatible replacement for move_base
https://uos.github.io/mbf_docs/
BSD 3-Clause "New" or "Revised" License
422 stars 154 forks source link

Change to use supercover #322

Open renan028 opened 11 months ago

renan028 commented 11 months ago

Description

As discussed here: https://github.com/magazino/move_base_flex/pull/317#discussion_r1228850967

Bresenham line drawing misses grid squares that the ray passes through. The supercover algorithm gets all the squares and it is the preferred algorithm to use when we search for possible collisions . Great description in Realtime Collision Detection "7.4.2 Uniform Grid Intersection Test".

image

In this PR, we are replacing getLineCells (Bresenham) by supercover, which is a more conservative approach.

Note that we needed to change some tests because the resolution of the map is 1.0 and the robot size is 1.0 x 1.0, thus diagonals should cover all cells around with new supercover.