parent
697d97cd38
commit
65165ffc5e
|
@ -19,8 +19,10 @@ def check_Eulers(eulers):
|
||||||
return eulers
|
return eulers
|
||||||
|
|
||||||
def check_quaternion(q):
|
def check_quaternion(q):
|
||||||
if q.q < 0.0: # positive first quaternion component?
|
if q[0] < 0.0: # positive first quaternion component?
|
||||||
raise ValueError('quaternion has negative first component.\n{}'.format(q))
|
raise ValueError('quaternion has negative first component.\n{}'.format(q))
|
||||||
|
if not(np.isclose(np.linalg.norm(q), 1.0)): # unit quaternion?
|
||||||
|
raise ValueError('quaternion is not of unit length.\n{} {} {} {}'.format(*q))
|
||||||
return q
|
return q
|
||||||
|
|
||||||
def check_matrix(M):
|
def check_matrix(M):
|
||||||
|
|
Loading…
Reference in New Issue