Main Content

local2world

Convert local coordinates to world coordinates

Description

xyWorld = local2world(map,xy) converts an array of local coordinates to world coordinates.

example

Examples

collapse all

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

map = binaryOccupancyMap(10,10);

Get world coordinates from local coordinates.

[xLocal,yLocal] = meshgrid(0:0.5:2);
xyWorld = local2world(map,[xLocal(:) yLocal(:)]);

Input Arguments

collapse all

Map representation, specified as a binaryOccupancyMap object. This object represents the environment of the vehicle.

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

Data Types: double

Output Arguments

collapse all

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

Data Types: double

Extended Capabilities

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

Version History

Introduced in R2019b