<< Quaternion Quaternion q2tr >>

Robotics_Toolbox >> Robotics_Toolbox > Quaternion > Quaternion

Quaternion

Constructor for quaternion objects

Calling Sequence

Q = Quaternion()
Q = Quaternion(Q1)
Q = Quaternion([S V1 V2 V3])
Q = Quaternion(S)
Q = Quaternion(TH, V)
Q = Quaternion(R)
Q = Quaternion(T)

Description

Q = Quaternion() is the identitity quaternion 1<0,0,0> representing a null rotation.

Q = Quaternion(Q1) is a copy of the quaternion Q1

Q = Quaternion([S V1 V2 V3]) is a quaternion formed by specifying directly its 4 elements

Q = Quaternion(S) is a quaternion formed from the scalar S and zero vector part: S<0,0,0>

Q = Quaternion(V) is a pure quaternion with the specified vector part: 0<V>

Q = Quaternion(TH, V) is a unit-quaternion corresponding to rotation of TH about the vector V.

Q = Quaternion(R) is a unit-quaternion corresponding to the orthonormal rotation matrix R. If R (3x3xN) is a sequence then Q (Nx1) is a vector of Quaternions corresponding to the elements of R.

Q = Quaternion(T) is a unit-quaternion equivalent to the rotational part of the homogeneous transform T. If T (4x4xN) is a sequence then Q (Nx1) is a vector of Quaternions corresponding to the elements of T.

A quaternion is a compact method of representing a 3D rotation that has computational advantages including speed and numerical robustness. A quaternion has 2 parts, a scalar s, and a vector v and is typically written: q = s <vx, vy, vz>.

A unit-quaternion is one for which s^2+vx^2+vy^2+vz^2 = 1. It can be considered as a rotation by an angle theta about a unit-vector V in space where

q = cos (theta/2) < v sin(theta/2) >

Q = Quaternion(X) is a unit-quaternion equivalent to X which can be any of:

- orthonormal rotation matrix.

- homogeneous transformation matrix (rotation part only).

- rotation angle and vector

Methods

inv :

inverse of quaterion

norm :

norm of quaternion

unit :

unitized quaternion

interp :

interpolation (slerp) between q and q2, 0<=s<=1

scale :

interpolation (slerp) between identity and q, 0<=s<=1

dot :

derivative of quaternion with angular velocity w

R :

equivalent 3x3 rotation matrix

T :

equivalent 4x4 homogeneous transform matrix

Arithmetic operators

q1==q2 :

test for quaternion equality

q1~=q2 :

test for quaternion inequality

q+q2 :

elementwise sum of quaternions

q-q2 :

elementwise difference of quaternions

q*q2 :

quaternion product

q*v :

rotate vector by quaternion, v is 3x1

s*q :

elementwise multiplication of quaternion by scalar

q/q2 :

q*q2.inv

q^n :

q to power n (integer only)

Properties (read only)

s :

real part

v :

vector part

Notes

Bibliography

[1] Animating rotation with quaternion curves, K. Shoemake, in Proceedings of ACM SIGGRAPH, (San Fran cisco), pp. 245-254, 1985.

[2] On homogeneous transforms, quaternions, and computational efficiency, J. Funda, R. Taylor, and R. Paul, IEEE Transactions on Robotics and Automation, vol. 6, pp. 382-388, June 1990.

[3] Robotics, Vision & Control, P. Corke, Springer 2011.

See also

Authors


Report an issue
<< Quaternion Quaternion q2tr >>