Main Content

syncWith

Sync map with overlapping map

Description

example

mat = syncWith(map,sourcemap) updates map with data from another binaryOccupancyMap object, sourcemap. Locations in map that are also found in sourcemap are updated. All other cells in map are set to map.DefaultValue.

Examples

collapse all

This example shows how to sync two overlapping maps using the syncWith function.

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 inside exampleMaps.mat.

load('exampleMaps.mat');

Create and display a new empty 2-D occupancy map object using binaryOccupancyMap function.

map1 = binaryOccupancyMap(70,70); 
show(map1) 
title('New Map')

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

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

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

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

Now update map1 with map2 using the syncWith function.

syncWith(map1,map2);
show(map1)

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

Input Arguments

collapse all

Map representation, specified as a binaryOccupancyMap object.

Map representation, specified as a binaryOccupancyMap object.

Extended Capabilities

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

See Also

| (Navigation Toolbox)

Introduced in R2019b