Ask Your Question

How do you install tf_transformations?

asked 2021-08-22 03:05:12 -0500

Cadmus gravatar image

updated 2022-03-26 02:11:01 -0500

I've recently been following the ROS 2 Galactic tutorials and I've reached "Introduction to tf2". I wasn't able to install the demos with sudo apt-get install ros-galactic-turtle-tf2-py for some reason, so I tried building from source. But I can't seem to install a package I appear to be missing.

Here's how I set up the workspace:

$ mkdir -p min_ws/src
$ cd min_ws/src/
$ git clone -b ros2
Cloning into 'geometry_tutorials'...
remote: Enumerating objects: 614, done.
remote: Counting objects: 100% (195/195), done.
remote: Compressing objects: 100% (139/139), done.
remote: Total 614 (delta 101), reused 112 (delta 48), pack-reused 419
Receiving objects: 100% (614/614), 118.59 KiB | 499.00 KiB/s, done.
Resolving deltas: 100% (320/320), done.
$ cd ..
$ rosdep install -i --from-path src --rosdistro galactic -y
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
turtle_tf2_py: Cannot locate rosdep definition for [tf_transformations]

I have tried searching for where this package to see how to install it but nothing came up. I have also tried

sudo apt install tf_transformations
sudo apt install python-transforms3d-pip
sudo apt install transforms3d

(I have done pip3 install transforms3d already)

I tried to move on but as we expect, the node runs into

ModuleNotFoundError: No module named 'tf_transformations'

Here's a snippet from ros2 doctor --report

system           : Linux
platform info    : Linux-5.11.0-22-generic-x86_64-with-glibc2.29
release          : 5.11.0-22-generic
processor        : x86_64

middleware name    : rmw_cyclonedds_cpp

distribution name      : galactic
distribution type      : ros2
distribution status    : active
release platforms      : {'rhel': ['8'], 'ubuntu': ['focal']}

EDIT: Added info on how I set up the workspace, and how I called rosdep.

In response to @tfoote's comment:

$ sudo apt install ros-galactic-tf-conversions
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package ros-galactic-tf-conversions
$ sudo apt install ros-galactic-tf2-conversions
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package ros-galactic-tf2-conversions

I'm not sure how, but I guess there's something wrong with my installation. Here is what I did before:

  • sudo apt install ros-galactic-desktop
  • sudo apt install python3-colcon-common-extensions

Adding to .bashrc:

$ cat ~/.bashrc | tail -n 10
## ROS sourcing
# ROS 2 core - underlay
source /opt/ros/galactic/setup.bash
# colcon_cd
source /usr/share/colcon_cd/function/
# Where ROS stack is
export _colcon_cd_root=~/ros2_install
export ROS_DOMAIN_ID=0

Seems like I have some tf2 stuff, but not ros-galactic-tf-conversions:

$ sudo apt list --installed | grep "ros-galactic-tf"

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

ros-galactic-tf2-bullet/focal,now 0.17.2-1focal.20210701.001325 amd64 [installed,automatic]
ros-galactic-tf2-eigen-kdl/focal,now 0.17.2-1focal.20210630.230132 amd64 [installed,automatic]
ros-galactic-tf2-eigen/focal,now 0.17.2-1focal.20210701.001337 amd64 [installed,automatic]
ros-galactic-tf2-geometry-msgs/focal,now 0.17.2-1focal.20210701.001341 amd64 [installed,automatic]
ros-galactic-tf2-kdl/focal,now 0.17.2-1focal.20210701.001149 amd64 [installed,automatic]
ros-galactic-tf2-msgs/focal,now 0.17.2-1focal.20210630.224910 amd64 [installed,automatic]
ros-galactic-tf2-py/focal,now 0.17 ...
edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2021-08-23 15:44:19 -0500

tfoote gravatar image

updated 2021-08-24 03:36:07 -0500

This is a ROS package.

If you want the tf_transformations package from apt for galactic you should install ros-galactic-tf-transformations If rosdep is giving you that error it doesn't know that you want galactic. You should either source your galactic workspace setup file to get ROS_DISTRO set or manually set it to galactic it so rosdep knows you want galactic.

edit flag offensive delete link more



For easier help in the future, please show your full command that you're running not just the error message. And also explain how to setup your workspace. I had to make a lot of informed guesses to provide this answer.

tfoote gravatar image tfoote  ( 2021-08-23 15:45:28 -0500 )edit

Thanks for your time and your contributions to ROS. I couldn't get very far with your suggestions, but I have added the missing information to the question and added more information below the line to make my situation clearer.

Cadmus gravatar image Cadmus  ( 2021-08-23 23:03:31 -0500 )edit

Sorry I typoed when I typed the package name. It should be ros-galactic-tf-transformations

tfoote gravatar image tfoote  ( 2021-08-24 03:36:46 -0500 )edit

answered 2021-08-24 05:11:08 -0500

Darkproduct gravatar image

You should be able to just install tf-transformations with:

sudo apt install ros-galactic-tf-transformations

Also note from:

To use this package, you need to manually install the transforms3d library.

sudo pip3 install transforms3d

At the present time, you cannot install transforms3d via Ubuntu debian, nor can you force the installation of the tf_transformations package to also include transforms3d.

edit flag offensive delete link more

answered 2021-08-25 06:46:34 -0500

kurshakuz gravatar image

If you are still experiencing this issue I could suggest to clone the tf_transformations repo to your workspace and build it locally. Just go inside the /src and call:

git clone

Then rebuild the workspace and that should be it.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2021-08-22 03:05:12 -0500

Seen: 1,284 times

Last updated: Mar 26