Quaternion

class wpimath.geometry.Quaternion(*args, **kwargs)

Bases: pybind11_object

Overloaded function.

  1. __init__(self: wpimath.geometry._geometry.Quaternion) -> None

Constructs a quaternion with a default angle of 0 degrees.

  1. __init__(self: wpimath.geometry._geometry.Quaternion, w: float, x: float, y: float, z: float) -> None

Constructs a quaternion with the given components.

Parameters:
  • w – W component of the quaternion.

  • x – X component of the quaternion.

  • y – Y component of the quaternion.

  • z – Z component of the quaternion.

W() float

Returns W component of the quaternion.

X() float

Returns X component of the quaternion.

Y() float

Returns Y component of the quaternion.

Z() float

Returns Z component of the quaternion.

inverse() wpimath.geometry._geometry.Quaternion

Returns the inverse of the quaternion.

normalize() wpimath.geometry._geometry.Quaternion

Normalizes the quaternion.

toRotationVector() numpy.ndarray[numpy.float64[3, 1]]

Returns the rotation vector representation of this quaternion.

This is also the log operator of SO(3).