MATLAB Answers

Take only a part of a binaryOccupancyMap

23 views (last 30 days)
simone esposito
simone esposito on 18 Apr 2021 at 9:36
Commented: simone esposito on 19 Apr 2021 at 19:39
Hey, is it possible to take only a part of a binaryOccupancyMap i've already created before?

Answers (1)

Cameron Stabile
Cameron Stabile on 19 Apr 2021 at 13:52
Hi Simone,
If you are using R2019b or newer you should be able to create submaps using the block syntax of getOccupancy:
% Create your original map
load exampleMaps
originalMap = binaryOccupancyMap(simpleMap);
% Extract the bottom-left quadrant of original map
botLeft = originalMap.GridLocationInWorld;
qSize = ceil([diff(originalMap.XWorldLimits) diff(originalMap.YWorldLimits)]/2);
mapData = getOccupancy(originalMap, botLeft, qSize);
% Construct your new occupancyMap
subMap = binaryOccupancyMap(mapData);
show(originalMap);
figure;
show(subMap);
Hope this helps,
Cameron
  5 Comments
simone esposito
simone esposito on 19 Apr 2021 at 19:39
Thank you very much for helping me, now it's more clear!!!

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!