Main Content

world2local

Convert world coordinates to local coordinates

Description

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

example

Examples

collapse all

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

map = binaryOccupancyMap(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 binaryOccupancyMap 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