OpTaS  1.0.7
An optimization-based task specification library for trajectory optimization and model predictive control.
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
optas.spatialmath.Quaternion Class Reference

Quaternion class. More...

Public Member Functions

def __init__ (self, ArrayType x, ArrayType y, ArrayType z, ArrayType w)
 Quaternion constructor. More...
 
Tuple[ArrayTypesplit (self)
 Split the quaternion into its xyzw parts. More...
 
def __mul__ (self, quat)
 Quaternion multiplication. More...
 
CasADiArrayType sumsqr (self)
 Sum the square values of the quaternion elements. More...
 
def inv (self)
 Quaternion inverse. More...
 
CasADiArrayType getquat (self)
 Return the quaternion vector. More...
 
CasADiArrayType getrpy (self)
 Return the quaternion as Roll-Pitch-Yaw angles. More...
 
CasADiArrayType getrotm (self)
 
CasADiArrayType getrotm (self)
 

Static Public Member Functions

def fromrpy (ArrayType rpy)
 Return a quaternion from Roll-Pitch-Yaw angles. More...
 
def fromvec (ArrayType q)
 Return a quaternion from a quaternion vector array. More...
 
def fromangvec (ArrayType theta, ArrayType v)
 Return a quaternion from angle-vector form. More...
 

Private Attributes

 _q
 

Detailed Description

Quaternion class.

Constructor & Destructor Documentation

◆ __init__()

def optas.spatialmath.Quaternion.__init__ (   self,
ArrayType  x,
ArrayType  y,
ArrayType  z,
ArrayType  w 
)

Quaternion constructor.

   @param x x-value of the quaternion.
   @param y y-value of quaternion.
   @param z z-value of quaternion.
   @param w w-value of quaternion.
   @return An instance of the Quaternion class.

Member Function Documentation

◆ __mul__()

def optas.spatialmath.Quaternion.__mul__ (   self,
  quat 
)

Quaternion multiplication.

   @param quat Another quaternion to multiply.
   @return Quaternion product.

◆ fromangvec()

def optas.spatialmath.Quaternion.fromangvec ( ArrayType  theta,
ArrayType  v 
)
static

Return a quaternion from angle-vector form.

   @param theta Angle of rotation (radians).
   @param v Direction vector to rotate about.
   @return An instance of the Quaternion class.

◆ fromrpy()

def optas.spatialmath.Quaternion.fromrpy ( ArrayType  rpy)
static

Return a quaternion from Roll-Pitch-Yaw angles.

   @param rpy Roll-Pitch-Yaw angles (radians).
   @return An instance of the Quaternion class.

◆ fromvec()

def optas.spatialmath.Quaternion.fromvec ( ArrayType  q)
static

Return a quaternion from a quaternion vector array.

   @param q Quaternion as an array.
   @return An instance of the Quaternion class.

◆ getquat()

CasADiArrayType optas.spatialmath.Quaternion.getquat (   self)

Return the quaternion vector.

   @return The quaternion as an array.

◆ getrotm() [1/2]

CasADiArrayType optas.spatialmath.Quaternion.getrotm (   self)
@ return rot matrix

◆ getrotm() [2/2]

CasADiArrayType optas.spatialmath.Quaternion.getrotm (   self)
@ return rot matrix

◆ getrpy()

CasADiArrayType optas.spatialmath.Quaternion.getrpy (   self)

Return the quaternion as Roll-Pitch-Yaw angles.

   @return The RPY Euler angles (in radians).

◆ inv()

def optas.spatialmath.Quaternion.inv (   self)

Quaternion inverse.

   @return Inverse quaternion.

◆ split()

Tuple[ArrayType] optas.spatialmath.Quaternion.split (   self)

Split the quaternion into its xyzw parts.

   @return The xyzw parts of the quaternion.

◆ sumsqr()

CasADiArrayType optas.spatialmath.Quaternion.sumsqr (   self)

Sum the square values of the quaternion elements.

   @return Result of the sum of square values of the quaternion.

Member Data Documentation

◆ _q

optas.spatialmath.Quaternion._q
private

The documentation for this class was generated from the following file: