ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Converting a basis to a quaternion python

asked 2016-02-05 15:28:42 -0500

daniel_dsouza gravatar image


I have information in this format (what I assume to be a rotation matrix)

xBasis:(-0.923067, -0.221423, -0.314514)

yBasis:(-0.380463, 0.645773, 0.661985)

zBasis:(-0.0565259, -0.730718, 0.680336)

origin:(0, 0, 0)

and I would like to convert it to a quaternion. Could you please advise me the best way to do so in Python?

Thanks in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-02-08 06:07:37 -0500

yasagitov gravatar image

updated 2016-02-08 06:11:32 -0500

Use quaternion_from_matrix method from in tf package

from tf.transformations import quaternion_from_matrix

q = quaternion_from_matrix(tr_matrix)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-02-05 15:28:42 -0500

Seen: 394 times

Last updated: Feb 08 '16