setOccupancy
Set occupancy probability of locations
Syntax
Description
This MATLAB® function assigns the occupancy values to specified locations in an occupancy map.
outputs an validPts = setOccupancy(___)n-element vector of logical values indicating
whether input coordinates are within the map limits.
setOccupancy(
assigns a matrix of occupancy values by specifying the bottom-left corner
location in world coordinates.map,bottomLeft,inputMatrix)
setOccupancy(
assigns a matrix of occupancy values by specifying the bottom-left corner
location in local coordinates.map,bottomLeft,inputMatrix,'local')
setOccupancy(
assigns a matrix of occupancy values by specifying the top-left cell index in
grid indices and the matrix size.map,topLeft,inputMatrix,'grid')
Examples
Input Arguments
Output Arguments
Limitations
Occupancy values have a limited resolution of ±0.001. The values are stored as
int16 using a log-odds representation. This data type limits
resolution, but saves memory when storing large maps in MATLAB. When calling setOccupancy and then
getOccupancy, the value returned might not equal the value you
set. For more information, see the log-odds representations section in Occupancy Grids.
Extended Capabilities
Version History
Introduced in R2019b
![Figure contains an axes object. The axes object with title Occupancy Grid, xlabel X [meters], ylabel Y [meters] contains an object of type image.](../../examples/nav/win64/CreateAndModifyAnOccupancyMapExample_01.png)
![Figure contains an axes object. The axes object with title Occupancy Grid, xlabel X [meters], ylabel Y [meters] contains an object of type image.](../../examples/nav/win64/CreateAndModifyAnOccupancyMapExample_02.png)
![Figure contains an axes object. The axes object with title Occupancy Grid, xlabel X [meters], ylabel Y [meters] contains an object of type image.](../../examples/nav/win64/CreateAndModifyAnOccupancyMapExample_03.png)