Main Content

plotTransforms

Plot 3-D transforms from translations and rotations

Description

ax = plotTransforms(translations,rotations) draws transform frames in a 3-D figure window using the specified translations translations, and rotations, rotations. The z-axis always points upward.

ax = plotTransforms(transformations) draws transform frames for the specified SE(2) or SE(3) transformations, transformations.

ax = plotTransforms(___,Name,Value) specifies additional options using name-value arguments. Specify multiple name-value arguments to set multiple options.

Input Arguments

collapse all

xyz-positions specified as a vector or matrix of [x y z] vectors. Each row represents a new frame to plot with a corresponding orientation in rotations.

Example: [1 1 1; 2 2 2]

Rotations of xyz-positions specified as a quaternion array, N-by-4 matrix of [w x y z] quaternion vectors, or an N-element array of so2 or so3 objects. N is the total number of rotations, and each element of the array, each row of the matrix or rotation transformation objects represent the rotation of the xyz-positions specified in translations.

If rotations is an N-element array of so2 or so3 objects, each element must be of the same type.

Example: [1 1 1 0; 1 3 5 0]

Transformations, specified as an se2 object, an se3 object, or an M-element array of se2 or se3 objects. M is the total number of transformations.

If you specify transformations as an array, each element must be of the same type.

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.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'FrameSize',5

Size of frame and attached meshes, specified as positive numeric scalar.

Color of frames, specified as an RGB triplet or string scalar.

Example: [0 0 1] or "green"

xyz labels of the coordinate frame, specified as "off" to hide the labels or "on" to show the labels.

Frame labels, specified as a string or N-element array of strings, where N is the total number of frames and each string corresponds to one frame at the same index of transformations, translations, or rotations.

xyz labels of the plotting axes, specified as "off" to hide the labels or "on"to show the labels.

Direction of the positive z-axis of inertial frame, specified as either "up" or "down". In the plot, the positive z-axis always points up.

File path of mesh file attached to frames, specified as either a character vector or string scalar. The mesh is attached to each plotted frame at the specified position and orientation. Provided .stl are

  • "fixedwing.stl"

  • "multirotor.stl"

  • "groundvehicle.stl"

Example: 'fixedwing.stl'

Color of attached mesh, specified as an RGB triplet or string scalar.

Example: [0 0 1] or "green"

Plot view, specified as "3D", "2D", or a three-element vector of the form [x,y,z] that sets the view angle in Cartesian coordinates. The magnitude of x,y, and z are ignored.

Axes used to plot the pose graph, specified as the comma-separated pair consisting of 'Parent' and either an Axes or UIAxes object. See axes or uiaxes.

Output Arguments

collapse all

Axes used to plot the pose graph, specified as the comma-separated pair consisting of 'Parent' and either an Axes or UIAxesobject. See axes or uiaxes.

Version History

Introduced in R2018b

See Also

Functions

Objects