Rosanswers logo

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 https://github.com/ros/geometry_tutorials.git -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/colcon_cd.sh
# 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.2-1focal.20210630.232207 amd64 [installed,automatic]
ros-galactic-tf2-ros-py/focal,now 0.17.2-1focal.20210630.232545 amd64 [installed,automatic]
ros-galactic-tf2-ros/focal,now 0.17.2-1focal.20210701.000424 amd64 [installed,automatic]
ros-galactic-tf2-sensor-msgs/focal,now 0.17.2-1focal.20210701.001410 amd64 [installed,automatic]
ros-galactic-tf2-tools/focal,now 0.17.2-1focal.20210630.232718 amd64 [installed,automatic]
ros-galactic-tf2/focal,now 0.17.2-1focal.20210630.224852 amd64 [installed,automatic]

Originally posted by Cadmus on ROS Answers with karma: 25 on 2021-08-22

Post score: 0


2 Answers 2


Rosanswers logo

This is a ROS package. https://index.ros.org/p/tf_transformations

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.

Originally posted by tfoote with karma: 58457 on 2021-08-23

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by tfoote on 2021-08-23:
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.

Comment by Cadmus on 2021-08-23:
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.

Comment by tfoote on 2021-08-24:
Sorry I typoed when I typed the package name. It should be ros-galactic-tf-transformations


Rosanswers logo

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

sudo apt install ros-galactic-tf-transformations

Also note from: https://github.com/DLu/tf_transformations

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.

Originally posted by Darkproduct with karma: 100 on 2021-08-24

This answer was NOT ACCEPTED on the original site

Post score: 1


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.