ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How do you install tf_transformations?

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

Cadmus gravatar image

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

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

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

   RMW MIDDLEWARE
middleware name    : rmw_cyclonedds_cpp

   ROS 2 INFORMATION
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
# Choose ROS_DOMAIN_ID
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 ...
(more)
edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
1

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

tfoote gravatar image

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

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

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

Comments

1

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 -0600 )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 -0600 )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 -0600 )edit
1

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

Darkproduct gravatar image

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_transformat...

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
0

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

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 https://github.com/DLu/tf_transformat...

Then rebuild the workspace and that should be it.

edit flag offensive delete link more

Question Tools

4 followers

Stats

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

Seen: 13,610 times

Last updated: Mar 26 '22