Robotics StackExchange | Archived questions

Calculate Pitch, Roll, Yaw (with python tensorflow)

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.eulerfromquaternion(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!

Asked by Karine Miras on 2018-05-03 11:32:51 UTC

Comments

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?

Asked by Milan Jelisavcic on 2018-05-03 17:51:58 UTC

Answers

Please be more specific!

Asked by yves on 2018-05-04 01:50:54 UTC

Comments

Can you please tell what exactly should be more specific?

Thanks

Asked by Karine Miras on 2018-05-07 08:41:50 UTC

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)

Asked by Raskkii on 2018-05-04 03:15:53 UTC

Comments

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

Asked by Karine Miras on 2018-05-04 05:42:57 UTC

In this case your installation of the tf module might be faulty. Maybe this link will help you: https://answers.ros.org/question/170261/tf-attributeerror-module-object-has-no-attribute-transformations/

Asked by Raskkii on 2018-05-04 07:20:37 UTC