Ask Your Question
0

Solvpnp() rvec to ros tf

asked 2019-12-06 23:59:26 -0600

Abhishekpg gravatar image

updated 2019-12-07 00:00:03 -0600

Hi Im using python opencv solvepnp() solver to find the camera to object transformation for hand2eye calibration for my robot. It returns translation vector and rotation vector. But i want to convert rotation vector into ros tf. Ie, in my solvepnp() rvec have only x,y,z values are there. But in tf there is x,y,z,w values.is ther any function to convert vector to quarternion in python?? Sorry, im very new to ros..

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-12-19 09:57:11 -0600

Abhishekpg gravatar image

updated 2019-12-19 09:57:51 -0600

Hi I solved it using tf. using

from tf.transformations import quaternion_from_euler 3
4 if __name__ == '__main__': 5 6 # RPY to convert: 90deg, 0, -90deg 7 q = quaternion_from_euler(1.5707, 0, -1.5707)

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

Stats

Asked: 2019-12-06 23:59:26 -0600

Seen: 30 times

Last updated: Dec 19 '19