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

Fix TypeError when using --cache_time argument #545

Open
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from

Conversation

tik0
Copy link

@tik0 tik0 commented Nov 29, 2022

Running rosrun tf2_tools echo.py --cache_time 1.0 source_frame target_frame causes TypeError: time must have a to_sec method, e.g. rospy.Time or rospy.Duration, because the argument is not properly converted. The fix handles the conversion, if the argument was given.

Running `rosrun tf2_tools echo.py --cache_time 1.0 source_frame target_frame` causes `TypeError: time must have a to_sec method, e.g. rospy.Time or rospy.Duration`, because the argument is not properly converted. The fix handles the conversion, if the argument was given.
@tik0 tik0 requested a review from tfoote as a code owner November 29, 2022 22:30
Copy link
Member

@tfoote tfoote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this it's a good fix.
This is the minimum fix and looks fine.

Looking at the if statement I think it would be better to actually pass in the default cache time value to the arguments for better visibility.

It's in c++ here as tf2::BufferCore::DEFAULT_CACHE_TIME
We likely need to expose it into the python library. https://github.com/ros/geometry2/blob/noetic-devel/tf2_py/src/tf2_py.cpp and then reference that in the command line usage as a default here.

@ahcorde ahcorde added the noetic label Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants