mapLayer
Description
The mapLayer
object creates an N-dimensional
grid map, where the first two dimensions determine the footprint of the map, and all
subsequent dimensions dictate the size and layout of the data stored in each cell. For storing
scalar binary or probability values for a grid map, use the binaryOccupancyMap
or occupancyMap
objects instead.
A map layer stores data for grid cells that represent a discretized region of space. To
query and update data using world, local, or grid coordinates, use the getMapData
and
setMapData
object
functions. Each grid cell in the map can store data of any size from a single a value to a
multi-dimensional array. For more information, see the DataSize
property.
Layer behavior can also be customized by providing function handles during creation using
the GetTransformFcn
and SetTransformFcn
properties.
Creation
Syntax
Description
creates an empty map object
occupying 10-by-10 meters of space with a resolution of 1 cell per meter.map
= mapLayer
creates a map from the values in the matrix or matrix array.map
= mapLayer(mapData
)
creates a new object using the layers copied from another map
= mapLayer(sourceMap
)mapLayer
object.
specifies property values using name-value arguments. map
= mapLayer(___,Name=Value
)
For example, mapLayer(__,'LocalOriginInWorld',[15 20])
sets the
local origin to a specific world location.
Input Arguments
Properties
Object Functions
getMapData | Retrieve data from map layer |
grid2local | Convert grid indices to local coordinates |
grid2world | Convert grid indices to world coordinates |
local2grid | Convert local coordinates to grid indices |
local2world | Convert local coordinates to world coordinates |
move | Move map in world frame |
setMapData | Assign data to map layer |
syncWith | Sync map with overlapping map |
world2grid | Convert world coordinates to grid indices |
world2local | Convert world coordinates to local coordinates |
Examples
Limitations
mapLayer
objects can only belong to onemultiLayerMap
object at a time.
Extended Capabilities
Version History
Introduced in R2021a