Main Content

selectSubmap

Select submap within map

Since R2021a

Description

sMapOut = selectSubmap(sMapIn,roi) selects a submap within the sMapIn using the specified region of interest roi.

Use this function to confine the search space for localization using coarse position estimates.

example

sMapOut = selectSubmap(sMapIn,center,sz) selects the submap specified by the center and size sz of the submap.

Examples

collapse all

Load a segment map from a MAT file into the workspace.

data = load('segmatchMapFullParkingLot.mat');
sMap = data.segmatchMapFullParkingLot;

Visualize the currently selected submap.

figure
show(sMap,'submap')
title('Initial Selected Submap')

Figure contains an axes object. The axes object with title Initial Selected Submap contains an object of type scatter.

Select a new submap within the map.

center = [0 30 0];
sz = [40 25 10];
sMap = selectSubmap(sMap,center,sz);

Visualize the selected submap.

figure
show(sMap,'submap')
title('New Selected Submap')

Figure contains an axes object. The axes object with title New Selected Submap contains an object of type scatter.

Input Arguments

collapse all

Original map of segments and features, specified as a pcmapsegmatch object.

Region of interest, specified as a 6-element vector of the form [xmin xmax ymin ymax zmin zmax].

Center of the submap, specified as 3-element vector of the form [xc yc zc].

Size of the submap along each axis, specified as 3-element vector of the form [xsz ysz zsz].

Output Arguments

collapse all

Updated map of segments and features, returned as a pcmapsegmatch object with the updated SelectedSubmap property.

Tips

  • Use a submap size large enough to include the uncertainty of the position estimates and the range of the sensor used with findPose.A larger submap can increase computation time during each call to the findPose function, but it can reduce the frequency of submap updates.

Version History

Introduced in R2021a

See Also

Objects

Functions