Main Content

world2local

Convert world coordinates to local coordinates

Description

xyLocal = world2local(map,xyWorld) converts world coordinates in the map to local coordinates.

example

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 matrix of [x y] pairs, where n is the number of world coordinates.

Data Types: double

Output Arguments

collapse all

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

Data Types: double

Extended Capabilities

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

Version History

Introduced in R2019b

expand all