KieranWynn / pyquaternion

A fully featured, pythonic library for representing and using quaternions
http://kieranwynn.github.io/pyquaternion/
MIT License
339 stars 68 forks source link

yaw_pithc_roll #60

Closed joseherrerasamp closed 3 years ago

joseherrerasamp commented 3 years ago

Hello Kieran,

I am trying to obtain the euler angles (yaw, pitch, roll sequence) from yaw_pitch_roll but when introducing a Quaternion class type it does not work. It returns me a 'tuple' object is not callable error.

I am not sure what is going on, or if it is possible to perform that conversion another way.

Sorry for the inconveniences.

Kinds regards, Jose Herrera

bonzairob commented 3 years ago

Quaternion.yaw_pitch_roll is a property, not a method - so you don't need the () on the end.

>>> from pyquaternion import Quaternion
>>> r = Quaternion.random()
>>> r.yaw_pitch_roll
(0.5707924427321308, -1.3428330941518551, 1.1461679465348418)
>>> r.yaw_pitch_roll()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'tuple' object is not callable