plotTransforms

Plot 3-D transforms from translations and rotations

Syntax

``ax = plotTransforms(translations,rotations)``
``ax = plotTransforms(translations,rotations,Name,Value)``

Description

````ax = plotTransforms(translations,rotations)` draws transform frames in a 3-D figure window using the specified translations and rotations. The z-axis always points upward.```
````ax = plotTransforms(translations,rotations,Name,Value)` specifies additional options using name-value pair arguments. Specify multiple name-value pairs 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 or n-by-4 matrix of `[w x y z]` quaternion vectors. Each element of the array or each row of the matrix represents the rotation of the xyz-positions specified in `translations`.

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

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.

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"`

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 `UIAxes`object. See `axes` or `uiaxes`.

Version History

Introduced in R2018b