Main Content

syncWith

Sync map with overlapping map

Description

example

mat= syncWith(map,sourcemap)updatesmapwith data from anotherbinaryOccupancyMapobject,sourcemap. Locations inmapthat are also found insourcemapare updated. All other cells inmapare set tomap.DefaultValue.

Examples

collapse all

This example shows how to sync two overlapping maps using thesyncWithfunction.

2-D occupancy maps are used to represent and visualize robot workspaces. In this example 2-D occupancy maps are created using existing map grid values stored insideexampleMaps.mat.

load('exampleMaps.mat');

Create and display a new empty 2-D occupancy map object usingbinaryOccupancyMapfunction.

map1 = binaryOccupancyMap (7070); show(map1) title('New Map')

Figure contains an axes object. The axes object with title New Map contains an object of type image.

Create and display 2-D occupancy map using the map grid values stored incomplexMap.

map2 = binaryOccupancyMap(complexMap); show(map2) title('Complex Map')

Figure contains an axes object. The axes object with title Complex Map contains an object of type image.

Now updatemap1withmap2using thesyncWithfunction.

syncWith(map1,map2); show(map1)

Figure contains an axes object. The axes object with title Binary Occupancy Grid contains an object of type image.

Input Arguments

collapse all

Map representation, specified as abinaryOccupancyMapobject.

Map representation, specified as abinaryOccupancyMapobject.

Extended Capabilities

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

Version History

Introduced in R2019b