Main Content

syncWith

Sync map with overlapping map

Since R2019b

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')

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

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

Now update map1 with map2 using the syncWith function.

syncWith(map1,map2);
show(map1)

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™.

Version History

Introduced in R2019b