Main Content


Convert occupancy grid to matrix


mat = occupancyMatrix(map) returns occupancy values stored in the occupancy grid object as a matrix.

Input Arguments

collapse all

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).

Output Arguments

collapse all

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.

Data Types: double

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2016b