Main Content

show

Plot pose graph

Description

example

show(poseGraph)plots the specified pose graph in a figure.

show(poseGraph,Name,Value)specifies options usingName,Valuepair arguments. For example,'IDs','on'plots all node and edge IDs of the pose graph.

axes= show(___)returns the axes handle that the pose graph is plotted to using any of previous syntaxes.

Examples

collapse all

Optimize a pose graph based on the nodes and edge constraints. The pose graph used in this example is from theIntel Research Lab Datasetand was generated from collecting wheel odometry and a laser range finder sensor information in an indoor lab.

Load the Intel data set that contains a 2-D pose graph. Inspect theposeGraphobject to view the number of nodes and loop closures.

loadintel-2d-posegraph.matpgdisp(pg)
poseGraph with properties: NumNodes: 1228 NumEdges: 1483 NumLoopClosureEdges: 256 LoopClosureEdgeIDs: [1228 1229 1230 1231 1232 1233 1234 1235 1236 ... ] LandmarkNodeIDs: [1x0 double]

Plot the pose graph with IDs off. Red lines indicate loop closures identified in the dataset.

show(pg,'IDs','off'); title('Original Pose Graph')

Figure contains an axes object. The axes object with title Original Pose Graph contains 3 objects of type line.

Optimize the pose graph. Nodes are adjusted based on the edge constraints and loop closures. Plot the optimized pose graph to see the adjustment of the nodes with loop closures.

updatedPG = optimizePoseGraph(pg); figure show(updatedPG,'IDs','off'); title('Updated Pose Graph')

Figure contains an axes object. The axes object with title Updated Pose Graph contains 3 objects of type line.

Optimize a pose graph based on the nodes and edge constraints. The pose graph used in this example is taken from theMIT Datasetand was generated using information extracted from a parking garage.

Load the pose graph from the MIT dataset. Inspect theposeGraph3Dobject to view the number of nodes and loop closures.

loadparking-garage-posegraph.matpgdisp(pg);
poseGraph3Dwith properties: NumNodes: 1661 NumEdges: 6275 NumLoopClosureEdges: 4615 LoopClosureEdgeIDs: [128 129 130 132 133 134 135 137 138 139 140 ... ] LandmarkNodeIDs: [1x0 double]

Plot the pose graph with IDs off. Red lines indicate loop closures identified in the dataset.

title('Original Pose Graph') show(pg,'IDs','off'); view(-30,45)

Figure contains an axes object. The axes object contains 3 objects of type line.

Optimize the pose graph. Nodes are adjusted based on the edge constraints and loop closures. Plot the optimized pose graph to see the adjustment of the nodes with loop closures.

updatedPG = optimizePoseGraph(pg); figure title('Updated Pose Graph') show(updatedPG,'IDs','off'); view(-30,45)

Figure contains an axes object. The axes object contains 3 objects of type line.

Input Arguments

collapse all

Pose graph, specified as aposeGraphorposeGraph3Dobject.

Name-Value Arguments

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN, whereNameis the argument name andValueis the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and encloseNamein quotes.

Example:'IDs','off'

Axes used to plot the pose graph, specified as the comma-separated pair consisting of'Parent'and either anAxesorUIAxesobject. Seeaxesoruiaxes.

Display of IDs on pose graph, specified as the comma-separated pair consisting of'IDs'and one of the following:

  • 'all'— Plot all node and edge IDs.

  • 'nodes'— Plot all node IDs and loop closure IDs.

  • 'loopclosures'— Plot only loop closure edge IDs.

  • 'landmarks'e -情节具有里程碑意义的dge IDs.

  • 'off'— Do not plot any IDs.

Output Arguments

collapse all

Axes used to plot the map, returned as either anAxesorUIAxesobject. Seeaxesoruiaxes.

Version History

Introduced in R2019b