Main Content

Get occupancy value of locations

returns an array of probability occupancy values at the `occVal`

= getOccupancy(`map`

,`xy`

)`xy`

locations in the world frame. Values close to 1 represent a high probability
that the cell contains an obstacle. Values close to 0 represent a high
probability that the cell is not occupied and obstacle free. Unknown locations,
including outside the map, return `map.DefaultValue`

.

returns a matrix of occupancy values by specifying the bottom-left corner
location in world coordinates and the matrix size in meters.`occMatrix`

= getOccupancy(`map`

,`bottomLeft`

,`matSize`

)

returns a matrix of occupancy values by specifying the bottom-left corner
location in local coordinates and the matrix size in meters.`occMatrix`

= getOccupancy(`map`

,`bottomLeft`

,`matSize`

,'local')

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.