
Public Member Functions | |
| def | __init__ (self, attitude) |
| def | __mul__ (self, other) |
| def | __truediv__ (self, other) |
| def | dcm (self) |
| def | dcm (self, dcm) |
| def | inversed (self) |
| def | transform (self, v3) |
Public Member Functions inherited from pymavlink.quaternion.QuaternionBase | |
| def | __eq__ (self, other) |
| def | __getitem__ (self, index) |
| def | __init__ (self, attitude=[1) |
| def | __mul__ (self, other) |
| def | __str__ (self) |
| def | __truediv__ (self, other) |
| def | close (self, other) |
| def | dcm (self) |
| def | dcm (self, dcm) |
| def | euler (self) |
| def | euler (self, euler) |
| def | inversed (self) |
| def | norm (self) |
| def | normalize (self) |
| def | q (self) |
| def | q (self, q) |
| def | transform (self, v) |
Public Attributes | |
| dcm | |
| q | |
Public Attributes inherited from pymavlink.quaternion.QuaternionBase | |
| dcm | |
| euler | |
| q | |
Private Member Functions | |
| def | _dcm_array_to_matrix3 (self, dcm) |
| def | _dcm_to_euler (self, dcm) |
| def | _dcm_to_q (self, dcm) |
| def | _euler_to_dcm (self, euler) |
| def | _matrix3_to_dcm_array (self, m) |
| def | _q_to_dcm (self, q) |
Private Attributes | |
| _dcm | |
| _euler | |
| _q | |
Additional Inherited Members | |
Static Public Member Functions inherited from pymavlink.quaternion.QuaternionBase | |
| def | norm_array (q) |
| def | normalize_array (q) |
Quaternion class that supports pymavlink's Vector3 and Matrix3
Usage:
>>> from quaternion import Quaternion
>>> from rotmat import Vector3, Matrix3
>>> m = Matrix3()
>>> m.from_euler(45, 0, 0)
>>> print(m)
Matrix3((1.00, 0.00, 0.00), (0.00, 0.53, -0.85), (-0.00, 0.85, 0.53))
>>> q = Quaternion(m)
>>> print(q)
[ 0.87330464 0.48717451 0. 0. ]
>>> print(q.dcm)
Matrix3((1.00, 0.00, 0.00), (0.00, 0.53, -0.85), (-0.00, 0.85, 0.53))
>>> v = Vector3(0, 1, 0)
>>> v2 = q.transform(v)
>>> print(v2)
Vector3(0.00, 0.53, 0.85)
Definition at line 454 of file quaternion.py.
| def pymavlink.quaternion.Quaternion.__init__ | ( | self, | |
| attitude | |||
| ) |
Construct a quaternion from an attitude
:param attitude: another Quaternion, QuaternionBase,
3 element list [roll, pitch, yaw],
4 element list [w, x, y ,z], DCM (3x3 array or Matrix3)
Definition at line 477 of file quaternion.py.
| def pymavlink.quaternion.Quaternion.__mul__ | ( | self, | |
| other | |||
| ) |
:param other: Quaternion :returns: multiplaction of this Quaternion with other
Definition at line 616 of file quaternion.py.
| def pymavlink.quaternion.Quaternion.__truediv__ | ( | self, | |
| other | |||
| ) |
:param other: Quaternion :returns: division of this Quaternion with other
Definition at line 623 of file quaternion.py.
|
private |
Converts dcm array into Matrix3 :param dcm: 3x3 dcm array :returns: Matrix3
Definition at line 553 of file quaternion.py.
|
private |
Create DCM from euler angles :param dcm: Matrix3 :returns: array [roll, pitch, yaw] in rad
Definition at line 607 of file quaternion.py.
|
private |
Create q from dcm (Matrix3) :param dcm: Matrix3 :returns: array q which represents a quaternion [w, x, y, z]
Definition at line 586 of file quaternion.py.
|
private |
Create DCM (Matrix3) from euler angles :param euler: array [roll, pitch, yaw] in rad :returns: Matrix3
Definition at line 596 of file quaternion.py.
|
private |
Converts Matrix3 in an array :param m: Matrix3 :returns: 3x3 array
Definition at line 565 of file quaternion.py.
|
private |
Create DCM (Matrix3) from q :param q: array q which represents a quaternion [w, x, y, z] :returns: Matrix3
Definition at line 576 of file quaternion.py.
| def pymavlink.quaternion.Quaternion.dcm | ( | self | ) |
Get the DCM :returns: Matrix3
Definition at line 500 of file quaternion.py.
| def pymavlink.quaternion.Quaternion.dcm | ( | self, | |
| dcm | |||
| ) |
Set the DCM :param dcm: Matrix3
Definition at line 516 of file quaternion.py.
| def pymavlink.quaternion.Quaternion.inversed | ( | self | ) |
Get inversed quaternion :returns: inversed quaternion
Definition at line 531 of file quaternion.py.
| def pymavlink.quaternion.Quaternion.transform | ( | self, | |
| v3 | |||
| ) |
Calculates the vector transformed by this quaternion :param v3: Vector3 to be transformed :returns: transformed vector
Definition at line 539 of file quaternion.py.
|
private |
Definition at line 509 of file quaternion.py.
|
private |
Definition at line 528 of file quaternion.py.
|
private |
Definition at line 527 of file quaternion.py.
| pymavlink.quaternion.Quaternion.dcm |
Definition at line 488 of file quaternion.py.
| pymavlink.quaternion.Quaternion.q |
Definition at line 486 of file quaternion.py.