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.0Sat, 22 May 2021 08:26:22 -0500Possible error in 'Quaternions' tutorialhttps://answers.ros.org/question/378765/possible-error-in-quaternions-tutorial/ Hi, I tried transforming roll, pitch, yaw angles to a quaternion in python following this tutorial (http://wiki.ros.org/tf2/Tutorials/Quaternions). In subtopic 3 "Think in RPY then convert to quaternion" the import statement is `from tf_conversions.transformations import quaternion_from_euler`. When trying to run my node python said that it can't find the module tf_conversions.transformations. I tried many things and finally looked into the source code of the package. Turns out that the import has to be `from tf.transformations import quaternion_from_euler`, because the `quaternion_from_euler` function is located in this file: https://github.com/ros/geometry/blob/noetic-devel/tf/src/tf/transformations.py.
I am not sure how to correct the tutorial page but maybe this help somebody to change it or at least get the import right. I was struggling with this for 2 straight hours thinking the tutorial was right...Fri, 21 May 2021 07:55:02 -0500https://answers.ros.org/question/378765/possible-error-in-quaternions-tutorial/Comment by sdoering for <p>Hi, I tried transforming roll, pitch, yaw angles to a quaternion in python following this tutorial (<a href="http://wiki.ros.org/tf2/Tutorials/Quaternions">http://wiki.ros.org/tf2/Tutorials/Qua...</a>). In subtopic 3 "Think in RPY then convert to quaternion" the import statement is <code>from tf_conversions.transformations import quaternion_from_euler</code>. When trying to run my node python said that it can't find the module tf_conversions.transformations. I tried many things and finally looked into the source code of the package. Turns out that the import has to be <code>from tf.transformations import quaternion_from_euler</code>, because the <code>quaternion_from_euler</code>function is located in this file: <a href="https://github.com/ros/geometry/blob/noetic-devel/tf/src/tf/transformations.py">https://github.com/ros/geometry/blob/...</a>.</p>
<p>I am not sure how to correct the tutorial page but maybe this help somebody to change it or at least get the import right. I was struggling with this for 2 straight hours thinking the tutorial was right...</p>
https://answers.ros.org/question/378765/possible-error-in-quaternions-tutorial/?comment=378835#post-id-378835I requested access to edit the ROS wiki and will correct to article once I got it.Sat, 22 May 2021 08:26:22 -0500https://answers.ros.org/question/378765/possible-error-in-quaternions-tutorial/?comment=378835#post-id-378835Comment by AndyZe for <p>Hi, I tried transforming roll, pitch, yaw angles to a quaternion in python following this tutorial (<a href="http://wiki.ros.org/tf2/Tutorials/Quaternions">http://wiki.ros.org/tf2/Tutorials/Qua...</a>). In subtopic 3 "Think in RPY then convert to quaternion" the import statement is <code>from tf_conversions.transformations import quaternion_from_euler</code>. When trying to run my node python said that it can't find the module tf_conversions.transformations. I tried many things and finally looked into the source code of the package. Turns out that the import has to be <code>from tf.transformations import quaternion_from_euler</code>, because the <code>quaternion_from_euler</code>function is located in this file: <a href="https://github.com/ros/geometry/blob/noetic-devel/tf/src/tf/transformations.py">https://github.com/ros/geometry/blob/...</a>.</p>
<p>I am not sure how to correct the tutorial page but maybe this help somebody to change it or at least get the import right. I was struggling with this for 2 straight hours thinking the tutorial was right...</p>
https://answers.ros.org/question/378765/possible-error-in-quaternions-tutorial/?comment=378784#post-id-378784Please correct it! I think you just need to click the Login button then make an account.Fri, 21 May 2021 11:23:06 -0500https://answers.ros.org/question/378765/possible-error-in-quaternions-tutorial/?comment=378784#post-id-378784Answer by Ranjit Kathiriya for <p>Hi, I tried transforming roll, pitch, yaw angles to a quaternion in python following this tutorial (<a href="http://wiki.ros.org/tf2/Tutorials/Quaternions">http://wiki.ros.org/tf2/Tutorials/Qua...</a>). In subtopic 3 "Think in RPY then convert to quaternion" the import statement is <code>from tf_conversions.transformations import quaternion_from_euler</code>. When trying to run my node python said that it can't find the module tf_conversions.transformations. I tried many things and finally looked into the source code of the package. Turns out that the import has to be <code>from tf.transformations import quaternion_from_euler</code>, because the <code>quaternion_from_euler</code>function is located in this file: <a href="https://github.com/ros/geometry/blob/noetic-devel/tf/src/tf/transformations.py">https://github.com/ros/geometry/blob/...</a>.</p>
<p>I am not sure how to correct the tutorial page but maybe this help somebody to change it or at least get the import right. I was struggling with this for 2 straight hours thinking the tutorial was right...</p>
https://answers.ros.org/question/378765/possible-error-in-quaternions-tutorial/?answer=378778#post-id-378778> I was struggling with this for 2 straight hours thinking the tutorial was right
I know you are completely true.
From next time follow these links for documentation for the enhancement document.
http://docs.ros.org/en/melodic/api/tf/html/python/
http://docs.ros.org/en/noetic/api/
Over here you can get a list of all packages that are launched with particular distribution and their functions.Fri, 21 May 2021 10:27:51 -0500https://answers.ros.org/question/378765/possible-error-in-quaternions-tutorial/?answer=378778#post-id-378778