Confusing occupancy map in the MATLAB documentation "Mapping with Known Poses"

1 visualización (últimos 30 días)
I came across this Matlab example(https://www.mathworks.com/help/robotics/ug/mapping-with-known-poses.html) and I like it. However, I notice that as the robot moves towards the end, some of the previously occupied grids become free again. See the marked regions below.
The occupied grids along x=10 become almost free as the robot moves towards the end. My impression is that the map is static. So why does this change happen? Any suggestions are appreciated. Thanks!

Respuestas (1)

Cameron Stabile
Cameron Stabile el 10 de Nov. de 2022
Hi Chang,
The insertRay method updates the map using the DDA raycasting algorithm. Put simply, a ray is traced between two points, iteratively stepped through the map (matrix). If the ray is less than the max ray length, then it registers a hit at the final cell location (increasing the occupancy value), and all other traced cells register a "miss" (decreasing the occupancy value).
The reason for the large gap is most likely due to a few beams passing along that verticle "wall" when the robot rounds the corner (near the top of the circles you've drawn). During that time, the beams will be close to parallel with the wall, allowing the ray to pass through previously occupied cells until it registers a "hit" lower down and thus causing previously occupied cells to become free:
It's worth remembering that maps are only accurate to their resolution, so if the true location of the wall lies close to the edge of a cell, there's a higher chance the wall can disappear later.
There are a few things you can try to mitigate these effects:
1) Narrow your sensor's field of view (FOV) by modifying the rangeSensor's HorizontalAngle
  • This example uses a Lidar with 360 FOV, meaning the chance of spawning these parallel rays is fairly high. A fan-shaped spread of lasers could help to mitigate this, as the robot will be less likely to clear previously visited cells unless it's heading is pointed directly down a wall.
2) Change the inverse model of insertRay
  • By default, insertRay will update cells using the LogoddsMiss and LogoddsHit properties of the occupancyMap, which are 0.4 and 0.7, respectively.
  • You can provide your own hit and miss update values in the inverseModel argument of insertRay. Setting values closer to 0.5 will cause them to have less of an effect, so to prevent clearing of cells, you can try something like [0.48 0.9].
3) Refine the map resolution
  • Lastly, you can reduce the chances of this occurring by increasing the map resolution. This will reduce the potential error between cell-boundaries and ground-truth wall, reducing the gaps through which these parallel beams can pass.
Hope this helps,
Cameron

Productos


Versión

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by