0
$\begingroup$

Rosanswers logo

Hi, I am using ROS2 dashing and I want to work with the geometry2/tf2_ros package which is available at https://index.ros.org/p/tf2_ros/#dashing.

I am sure this is a very basic question, but I am having a hard time finding documentation on how to do stuff in ROS2.

  • How do I install the package so I can import the modules to my python scripts?

Thanks!

EDIT:

I think I have to rephrase the question. I allready have the tf2 package installed and I can run the static_transform_publisher from terminal, but I am having trouble importing the tf2_ros module to python when I am writing my own nodes - keep getting "no module named tf2_ros".

So what I am asking is how do I make the package available so that I can import the python modules when writing my own python nodes?


Originally posted by svintissen on ROS Answers with karma: 75 on 2020-04-29

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I guess you're having a hard time finding documentation about this as installing a package hasn't changed between ROS 1 and ROS 2. If a package is released, and you're using ROS on any supported Debian or Ubuntu flavour, installing it would be a matter of:

sudo apt install ros-$ROS_DISTRO-package-name

so in this case:

sudo apt install ros-dashing-tf2-ros

Note that this is how you would install any Debian/Ubuntu package, not just released ROS packages. Which is probably another reason why it's not overly documented.

I'm not saying it's a stupid or unnecessary question btw, just proferring possible rationales for why you cannot find any documentation about this subject.


Edit:

I am having trouble importing the tf2_ros module to python when I am writing my own nodes - keep getting "no module named tf2_ros". [..] So what I am asking is how do I make the package available so that I can import the python modules when writing my own python nodes?

If that is your actual question then it appears it's actually a duplicate of #q309889.

Summary: the Python side to tf2_ros was only released into Eloquent, not Dashing.


Edit 2: it seems you asked a similar question in #q350839. @tfoote remarks there the package tf2_ros was released into all ROS 2 versions, which is technically correct. I do believe that the Python side of tf2_ros was only included in the Eloquent version though (because of this comment by Chris):

This was merged into master, and will be part of the Eloquent release: https://index.ros.org//doc/ros2/Releases/Release-Eloquent-Elusor/

The changes were too invasive to backport into Dashing.


Originally posted by gvdhoorn with karma: 86574 on 2020-04-29

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by svintissen on 2020-04-29:
Thanks, I think I have to rephrase the question. I allready have the tf2 package installed and I can run the static_transform_publisher from terminal, but I am having trouble importing the tf2_ros module to python when I am writing my own nodes - keep getting "no module named tf2_ros".

So what I am asking is how do I make the package available so that I can import the python modules when writing my own python nodes?

$\endgroup$

Your Answer

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