-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
tf2 timeout python tutorial references code that doesn't exist #2935
Comments
As far as I can tell, that part of the module exists just fine. Running locally:
We do some slightly non-standard things in the
Yes, agreed. That tutorial needs a review and a rewrite. I'm going to update the title of this issue to reflect that. If you have time to look into it and open a PR, it is much appreciated.
Sorry, this comment isn't very helpful. If you have specific issues with the tutorials, please feel free to open up issues. But a general "I found weird stuff" doesn't really help us solve anything. |
Oh, hey @clalancette. Thanks for taking the time to review this.
Well, I would love to but I'm not sure how. I mean, I've been doing tests on the Also, the duration of the timeout (when included) seems to be taken into consideration only when the Not sure how to proceed from there.
I'm sorry, that was me trying to conclude the issue with a complementary opinion. I've been doing separate issue threads with the things I've been founding in here though. |
Yeah, that's fine. When I reviewed it a couple of months ago, that's where I got to as well. There should be a way to make it work, I just haven't had time to come back and figure out what the tutorial is actually trying to accomplish.
No worries, it happens. We rely a lot on the community to find and fix issues in the documentation, so please do feel free to keep opening issues as you find them. Thanks for this report. |
As far as I understand, the tutorial is trying to teach how the |
Update: The intention of this whole thing is to use now = self.get_clock().now() From there, we can call the trans = self.tf_buffer.lookup_transform(to_frame_rel, from_frame_rel, now) This will lead to the exception we were talking about. That exception gives some timestamps we can study and this is why I'm writing this now.
As you can see, the results oscillate from two values and I don't have an explanation to that (yet). The next thing I did was to include the trans = self.tf_buffer.lookup_transform(to_frame_rel, from_frame_rel, now, timeout=rclpy.duration.Duration(seconds=0.05) ) As since the exception was still there, I did the same thing as before:
It is clear that the oscillation continues but now the values are different. If you do the math, this is because of those extra ms I put in the now = self.get_clock().now() - rclpy.time.Duration(seconds=0.05)
trans = self.tf_buffer.lookup_transform(to_frame_rel, from_frame_rel, now) And surprise! It works like a charm now. Hope this help! Please let me know. |
We "fixed" this by removing the tutorial in #4384, so closing. |
Hi.
I've been doing and reviewing all the ros2 tutorials for a while and now I've came across with the tf2 ones.
In first place, the Listener tutorial, specifically on the "Writing a listener node" where all the main code relies, I noticed some weird stuff that VSCode later confirmed me:
As you can see, there is an import to a part of
tf2_ros
module that doesn't actually exists. Then, there is calls to a variable that is defined later on the code (i.e. first it's called, then defined. Weird). At the end, I'm not sure if all of this makes any difference because the node works as expected and you can do the examples normally.On second place (and the more absurd one), on the timeout tutorial nothing inside this tutorial makes any sense considering it is using the listener tutorial as a reference. It asks to change a code that is not found on the listener one and to modify things that already are missing in the original one.
This is not the first time I discover weird things in the ros2_documentation and I would like to suggest a review on this topic, specially in the tutorials part, because is where the common user goes first to find answers or goes to learn things in order to develop new projects using ROS.
Hope this can be solved.
The text was updated successfully, but these errors were encountered: