Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined 'now' variable in 'turtle_tf2_listener.py' tutorial #3960

Closed
songyuc opened this issue Oct 9, 2023 · 2 comments
Closed

Undefined 'now' variable in 'turtle_tf2_listener.py' tutorial #3960

songyuc opened this issue Oct 9, 2023 · 2 comments
Assignees

Comments

@songyuc
Copy link
Contributor

songyuc commented Oct 9, 2023

I am attempting to follow along with the Using Time (Python) — ROS 2 Documentation tutorial. In the "1. Update the listener node" section, the tutorial instructs to edit turtle_tf2_listener.py and remove the timeout=Duration(seconds=1.0) parameter from the lookup_transform() call, and gives the following code:

trans = self._tf_buffer.lookup_transform(
to_frame_rel,
from_frame_rel,
now)

However, upon inspecting the turtle_tf2_listener.py source file, I noticed that the now variable is not defined anywhere in the file. Because of this, I am unable to successfully follow along with the tutorial.

I wanted to ask if this is an error in the tutorial, or if the source file has been updated and the tutorial has not? How should I proceed in order to successfully complete the tutorial?

I am using ROS 2 Iron.

Thank you very much for your assistance.

@songyuc songyuc changed the title Issue: Undefined 'now' variable in 'turtle_tf2_listener.py' tutorial Undefined 'now' variable in 'turtle_tf2_listener.py' tutorial Oct 10, 2023
@jkaniuka
Copy link
Contributor

Hi @songyuc, your suspicions were correct 😉 - source file was updated, but tutorial has not. You can simply replace now with rclpy.time.Time(). See details here 🤖

@clalancette
Copy link
Contributor

We "fixed" this by removing the tutorial in #4384, so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants