MATLAB Answers

Take only a part of a binaryOccupancyMap

22 ビュー (過去 30 日間)
simone esposito
simone esposito 2021 年 4 月 18 日 9:36
コメント済み: simone esposito 2021 年 4 月 19 日 19:39
Hey, is it possible to take only a part of a binaryOccupancyMap i've already created before?

回答 (1 件)

Cameron Stabile
Cameron Stabile 2021 年 4 月 19 日 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 件のコメント
simone esposito
simone esposito 2021 年 4 月 19 日 19:39
Thank you very much for helping me, now it's more clear!!!

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by