Gazebo | Ignition | Community
Ask Your Question

Calculate Pitch, Roll, Yaw (with python tensorflow)

asked 2018-05-03 11:33:26 -0500

Karine Miras gravatar image

updated 2018-05-04 05:42:18 -0500

Dear All,

I'm working with Gazebo through python in a virtual environment for simulating modular robots, and I'm having trouble to calculate the Euler angles (Pitch, Roll, Yaw) of the robots' parts using tensorflow. I provide tensorflow an orientation matrix witch I fetch from Gazebo, following examples I've seen around, however, the method Im trying to call is non existent. Obs: I did indstall tensorflow and tf in the virtual environment.

import tensorflow

explicit_quat = [orientation.x, orientation.y, orientation.z, orientation.w]

euler = tensorflow.transformations.euler_from_quaternion(explicit_quat)

The ERROR: 'module' object has no attribute 'transformations'

I also tried it with the tf module, but I get the same.

Can you please help me?

Thank you!

edit retag flag offensive close merge delete


You need to be more specific. Temsorflow is a completely different project from Gazebo. How do you use it in Gazebo? Do you have some virtual environment? From where do you get this `orientation` object?

Milan Jelisavcic gravatar imageMilan Jelisavcic ( 2018-05-03 17:51:58 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2018-05-04 01:50:54 -0500

yves gravatar image

Please be more specific!

edit flag offensive delete link more


Can you please tell what exactly should be more specific? Thanks

Karine Miras gravatar imageKarine Miras ( 2018-05-07 08:41:50 -0500 )edit

answered 2018-05-04 03:15:53 -0500

Raskkii gravatar image

I think the function you are looking for is actually from the 'tf' module. So import tf and then euler = tf.transformations.euler_from_quaternion(explicit_quat)

edit flag offensive delete link more


Hi, I tried that too, but I get the same error. Thanks a lot!

Karine Miras gravatar imageKarine Miras ( 2018-05-04 05:42:57 -0500 )edit

In this case your installation of the tf module might be faulty. Maybe this link will help you:

Raskkii gravatar imageRaskkii ( 2018-05-04 07:20:37 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-05-03 11:32:51 -0500

Seen: 907 times

Last updated: May 04 '18