Main Content

show

Display 2-D lidar scans and lidar sensor trajectory

Since R2022b

Description

show(scanMapObj) displays the map defined by the lidarscanmap object scanMapObj, with all lidar scans overlaid at their estimate poses in the map. The function also displays the sensor trajectory.

example

ax = show(scanMapObj) displays the lidar scan map and returns the axes handle ax.

[___] = show(___,Name=Value) specifies options using one or more name-value arguments in addition to any combination of arguments from previous syntaxes. For example, show(scanMapObj,ShowTrajectory=False) displays the pose graph of lidar scans, but not the sensor trajectory.

Examples

collapse all

Load a MAT file containing 2-D lidar scans into the workspace.

data = load("wareHouse.mat");
scans = data.wareHouseScans;

Create a lidarscanmap object.

scanMapObj = lidarscanmap;

Add the first 15 scans from the input data to the scanMapObj object by using the addScan function.

for currentID = 1:15
    addScan(scanMapObj,scans{currentID});
end

Visualize the map and the sensor trajectory.

figure
show(scanMapObj);

Figure contains an axes object. The axes object contains 16 objects of type line. One or more of the lines displays its values using only markers

Input Arguments

collapse all

2-D lidar scan map, specified as a lidarscanmap object.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: show(scanMapObj,ShowTrajectory=False) displays the pose graph of lidar scans, but not the sensor trajectory.

Axes on which to plot lidar scan map, specified as an Axes object or an UIAxes object. For more information, see axes, uiaxes documentation.

Sensor trajectory map, specified as a logical 1 (true) or 0 (false). Specify this as false to not display the sensor trajectory.

Data Types: logical

Lidar scan map environment, specified as a logical 1 (true) or 0 (false). Specify this as false to not display the map environment.

Data Types: logical

Output Arguments

collapse all

Axes of the lidar scan map plot, returned as an Axes object or an UIAxes object. For more information, see axes, uiaxes documentation.

Version History

Introduced in R2022b