ROS Answers: Open Source Q&A Forum - RSS feedhttps://answers.ros.org/questions/Open source question and answer forum written in Python and DjangoenROS Answers is licensed under Creative Commons Attribution 3.0Tue, 16 Aug 2016 04:33:21 -0500tf2 - where's quaternion_from_euler gone?https://answers.ros.org/question/73819/tf2-wheres-quaternion_from_euler-gone/Hi,
since I'm trying to migrate my workspace from Groovy to Hydro there are some questions arising. This is one of them. I'm going to post the others seperately.
In Python, how do I convert a vector of Euler angles into a quaternion using tf2? In tf there was something like
tf.transformations.quaternion_from_euler(...)
How's that done with tf2?
ThanksMon, 19 Aug 2013 13:09:49 -0500https://answers.ros.org/question/73819/tf2-wheres-quaternion_from_euler-gone/Answer by vtalpaert for <p>Hi,</p>
<p>since I'm trying to migrate my workspace from Groovy to Hydro there are some questions arising. This is one of them. I'm going to post the others seperately. </p>
<p>In Python, how do I convert a vector of Euler angles into a quaternion using tf2? In tf there was something like</p>
<pre><code>tf.transformations.quaternion_from_euler(...)
</code></pre>
<p>How's that done with tf2?</p>
<p>Thanks</p>
https://answers.ros.org/question/73819/tf2-wheres-quaternion_from_euler-gone/?answer=241790#post-id-241790It's simply in a new package, so use
tf_conversions.transformations.quaternion_from_euler(roll, pitch, yaw)
instead of
tf.transformations.quaternion_from_euler(...)Tue, 16 Aug 2016 04:33:21 -0500https://answers.ros.org/question/73819/tf2-wheres-quaternion_from_euler-gone/?answer=241790#post-id-241790Answer by Vincent Rabaud for <p>Hi,</p>
<p>since I'm trying to migrate my workspace from Groovy to Hydro there are some questions arising. This is one of them. I'm going to post the others seperately. </p>
<p>In Python, how do I convert a vector of Euler angles into a quaternion using tf2? In tf there was something like</p>
<pre><code>tf.transformations.quaternion_from_euler(...)
</code></pre>
<p>How's that done with tf2?</p>
<p>Thanks</p>
https://answers.ros.org/question/73819/tf2-wheres-quaternion_from_euler-gone/?answer=200293#post-id-200293you can use PyKDL as shown here: https://github.com/ros-perception/calibration/commit/7bf0e25facf9079d572b2459f2b9c860613d49b8
All you need is here: http://docs.ros.org/diamondback/api/kdl/html/python/geometric_primitives.html#rotationThu, 01 Jan 2015 09:18:24 -0600https://answers.ros.org/question/73819/tf2-wheres-quaternion_from_euler-gone/?answer=200293#post-id-200293Answer by tfoote for <p>Hi,</p>
<p>since I'm trying to migrate my workspace from Groovy to Hydro there are some questions arising. This is one of them. I'm going to post the others seperately. </p>
<p>In Python, how do I convert a vector of Euler angles into a quaternion using tf2? In tf there was something like</p>
<pre><code>tf.transformations.quaternion_from_euler(...)
</code></pre>
<p>How's that done with tf2?</p>
<p>Thanks</p>
https://answers.ros.org/question/73819/tf2-wheres-quaternion_from_euler-gone/?answer=73828#post-id-73828tf2 has been redesigned to provide only the functionality of tf and not bundle in external libraries for convenience. transformations.py is an externally developed library which was included inside of tf for convenience. For now you can continue to use it in that location. Down the road it would be cleaner to package transformations.py itself
More information on transformations.py can be found here: http://www.lfd.uci.edu/~gohlke/Mon, 19 Aug 2013 14:41:26 -0500https://answers.ros.org/question/73819/tf2-wheres-quaternion_from_euler-gone/?answer=73828#post-id-73828