binaryOccupancyMap
Create occupancy grid with binary values
Description
The binaryOccupancyMap
creates a 2-D occupancy map object, which you
can use to represent and visualize a robot workspace, including obstacles. The
integration of sensor data and position estimates create a spatial representation of the
approximate locations of the obstacles.
Occupancy grids are used in robotics algorithms such as path planning. They are also used in mapping applications, such as for finding collision-free paths, performing collision avoidance, and calculating localization. You can modify your occupancy grid to fit your specific application.
Each cell in the occupancy grid has a value representing the occupancy status of that
cell. An occupied location is represented as true (1)
and a free
location is represented as false (0)
.
The object keeps track of three reference frames: world, local, and, grid. The world
frame origin is defined by GridLocationInWorld
, which defines the
bottom-left corner of the map relative to the world frame. The
LocalOriginInWorld
property specifies the location of the
origin of the local frame relative to the world frame. The first grid location with
index (1,1)
begins in the top-left corner of the grid.
Note
This object was previously named
robotics.BinaryOccupancyGrid
.
Creation
Syntax
Description
map = binaryOccupancyMap
creates a 2-D binary
occupancy grid with a width and height of 10m. The default grid resolution
is one cell per meter.
map = binaryOccupancyMap(rows,cols,
creates a 2-D binary occupancy grid of size
(resolution
,"grid")rows
,cols
).
map = binaryOccupancyMap(
creates
a grid from the values in matrix p
)p
. The size of the
grid matches the size of the matrix, with each cell value interpreted from
its location in the matrix. p
contains any numeric or
logical type with zeros (0) and ones (1).
map = binaryOccupancyMap(
creates a map from a matrix with the p
,resolution
)Resolution
property specified in cells per meter.
map = binaryOccupancyMap(
creates an object using values from another
sourcemap
)binaryOccupancyMap
object.
map = binaryOccupancyMap(
creates an object using values from another
sourcemap
,resolution
)binaryOccupancyMap
object, but resamples the matrix to
have the specified resolution.
map = binaryOccupancyMap(___,
sets properties using one or more name-value arguments.Name=Value
)
Input Arguments
Properties
Object Functions
copy | Create copy of binary occupancy map |
checkOccupancy | Check if locations are free or occupied |
getOccupancy | Get occupancy value of locations |
grid2local | Convert grid indices to local coordinates |
grid2world | Convert grid indices to world coordinates |
inflate | Inflate each occupied location |
insertRay | Insert ray from laser scan observation |
local2grid | Convert local coordinates to grid indices |
local2world | Convert local coordinates to world coordinates |
move | Move map in world frame |
occupancyMatrix | Convert occupancy grid to matrix |
raycast | Compute cell indices along a ray |
rayIntersection | Find intersection points of rays and occupied map cells |
setOccupancy | Set occupancy value of locations |
show | Display binary occupancy map |
syncWith | Sync map with overlapping map |
world2grid | Convert world coordinates to grid indices |
world2local | Convert world coordinates to local coordinates |