Main Content

inflate

Inflate each occupied grid location

Description

example

inflate(map,radius)inflates each occupied position of themapby the radius given in meters.radiusis rounded up to the nearest cell equivalent based on the resolution of the map. Every cell within the radius is set totrue(1).

inflate(map,gridradius,'grid')inflates each occupied position by the radius given in number of cells.

Examples

collapse all

Create a 10m x 10m empty map.

map = binaryOccupancyMap(10,10,10);

Set occupancy of world locations and show map.

x = [1.2; 2.3; 3.4; 4.5; 5.6]; y = [5.0; 4.0; 3.0; 2.0; 1.0]; setOccupancy(map, [x y], ones(5,1)) figure show(map)

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

Inflate occupied locations by a given radius.

inflate(map, 0.5) figure show(map)

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

Get grid locations from world locations.

ij = world2grid(map, [x y]);

Set grid locations to free locations.

setOccupancy(map, ij, zeros(5,1),'grid') figure show(map)

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. This object represents the environment of the robot. The object contains a matrix grid with binary values indicating obstacles astrue(1) and free locations asfalse(0).

Dimension that defines how much to inflate occupied locations, specified as a scalar.radiusis rounded up to the nearest cell value.

Data Types:double

Dimension that defines how much to inflate occupied locations, specified as a positive scalar.gridradiusis the number of cells to inflate the occupied locations.

Data Types:double

Extended Capabilities

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

Version History

Introduced in R2015a