Main Content

world2local

Convert world coordinates to local coordinates

Since R2019b

Description

example

xyLocal = world2local(map,xy) converts an array of world coordinates to local coordinates.

Examples

collapse all

Create an empty occupancy map with a width and height of 10 meters.

map = occupancyMap(10,10);

Get local coordinates from world coordinates.

[xWorld,yWorld] = meshgrid(0:0.5:2);
xyLocal = world2local(map,[xWorld(:) yWorld(:)]);

Input Arguments

collapse all

Map representation, specified as a occupancyMap, mapLayer, multiLayerMap, or signedDistanceMap object.

World coordinates, specified as an n-by-2 vertical array of [x y] pairs, where n is the number of world coordinates.

Output Arguments

collapse all

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

Extended Capabilities

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

Version History

Introduced in R2019b

expand all