local2grid

Convert local coordinates to grid indices

Description

ij = local2grid(map,xy) converts an array of local coordinates, xy, to an array of grid indices, ij in [row col] format.

Input Arguments

collapse all

Map representation, specified as a occupancyMap object. This object represents the environment of the vehicle. The object contains a matrix grid with values representing the probability of the occupancy of that cell. Values close to 1 represent a high probability that the cell contains an obstacle. Values close to 0 represent a high probability that the cell is not occupied and obstacle free.

Local coordinates, specified as an n-by-2 matrix of [x y] pairs, where n is the number of local coordinates.

Output Arguments

collapse all

Grid positions, returned as an n-by-2 matrix of [i j] pairs in [row col] format, where n is the number of grid positions. The grid cell locations start at (1,1) and are counted from the top left corner of the grid.

Introduced in R2019b