MATLAB 帮助中心
Convert occupancy grid to matrix
mat = occupancyMatrix(map)
mat = occupancyMatrix(map) returns occupancy values stored in the occupancy grid object as a matrix.
mat
map
example
collapse all
This example uses:
Generate a random 2-D maze map.
map = mapMaze(2,MapSize=[10 10],MapResolution=1); show(map)
Convert the binary occupancy map to occupancy values matrix.
occupancyMatrix(map)
ans = 10×10 logical array 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1
binaryOccupancyMap
Map representation, specified as a binaryOccupancyMap object. This object represents the environment of the robot. The object contains a matrix grid with binary values indicating obstacles as true (1) and free locations as false (0).
true
1
false
0
Occupancy values, returned as an h-by-w matrix, where h and w are defined by the two elements of the GridSize property of the occupancy grid object.
GridSize
Data Types: double
double
expand all
Introduced in R2016b
binaryOccupancyMap | occupancyMap (Navigation Toolbox)
occupancyMap
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处