ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Converting a basis to a quaternion python

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

daniel_dsouza gravatar image

Hello,

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
2

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 transformations.py in tf package

from tf.transformations import quaternion_from_matrix

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

Question Tools

1 follower

Stats

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

Seen: 467 times

Last updated: Feb 08 '16