主要内容

quaternion

R2026b

Orientation of pose object as quaternion

Since R2026b

    Description

    Add-On Required: This feature requires the 3D Scenarios add-on.

    quat = quaternion(p) calculates the orientation of the specified pose as a quaternion. By default, the orientation sequence is the mapping from the intrinsic frame to the pose object.

    Note

    This function requires a product that includes the quaternion object.

    quat = quaternion(p,Name=Value) calculates the quaternion using options specified by one or more name-value arguments.

    Input Arguments

    collapse all

    Pose, specified as a array of pose objects.

    Name-Value Arguments

    collapse all

    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: quaternion(p,ObjectOrientationBasis="flu") specifies the basis vectors as forward-left-up.

    Frame rotation type, specified as one of these values:

    • "frame" — Define the orientation sequence as the mapping from the intrinsic frame to the pose object.

    • "point" — Define the orientation sequence as the mapping from the pose object to the intrinsic frame.

    Basis vectors for the quaternion, specified as "auto", "flu", or "frd". This value specifies whether the basis for the quaternion uses a forward-left-up (FLU) or forward-right-down (FRD) convention.

    The default, "auto", selects a convention based on the AxesConvention property of the reference frame for the pose object. When the ReferenceFrame property is empty, the default convention is FLU.

    Axes ConventionCorresponding Basis
    "ned""frd"
    "enu""flu"
    "flu""flu"
    "frd""frd"
    "xyz""flu"

    Output Arguments

    collapse all

    Quaternion, returned as an array of quaternion objects. The size of the array matches the size of p.

    Version History

    Introduced in R2026b