ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org

Tf_transformations - ROS 2 Python package for easy TF math

Piggy-backing on the announcement of rospy2, I too am trying to make it easier to migrate ROS 1 Python code to ROS 2. In particular, I’ve made the new package tf_transformations to fill the hole left by the useful ROS 1 library transformations.py.

In short, if you wrote the following in ROS 1,

from tf.transformations import euler_from_quaternion

the only change you need to your code in ROS 2 is

from tf_transformations import euler_from_quaternion

For more information about the rationale behind the library, why it wasn’t already in ROS 2, the installation procedures and more, please see the project README. Note that the library is currently making its way through the buildfarm for foxy, galactic and rolling, so exciting things are coming soon.

9 Likes

A much needed effort, I think a lot of us were doing this manually in various ways.

(Except any conversion to Euler angles. IMO we should work as a community to ban them forever or at least spam the user with a warning. :sweat_smile: That also reminds me I need to update the dual quaternions ROS package to support ROS2.)

1 Like