Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

tf transformations euler rotation matrix

I have written a little test to learn the inner wokings of tf.transformations. I make a rotation matrix from euler angels (euler_matrix) and then extract the angels from this matrix(euler_from_matrix); many times the result is not equal to the initial inbput. I am sampling euler angels from 0-pi range and I also compare tangents(also not equal). What am I doing wrong?

Here is my code

euler1 = (np.random.rand(1,3)*math.pi).tolist()[0]
R1 = euler_matrix(*euler1)
eu1 = euler_from_matrix(R1)

print np.isclose(eu1,euler1)
print np.isclose(np.tan(eu1),np.tan(euler1))