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

Buffer and BufferClient do not the same function signatures #598

Open
christian-rauch opened this issue Apr 19, 2023 · 2 comments
Open

Buffer and BufferClient do not the same function signatures #598

christian-rauch opened this issue Apr 19, 2023 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@christian-rauch
Copy link

The abstract method lookup_transform, as implemented by tf2_ros.buffer.Buffer and tf2_ros.buffer_client.BufferClient, is using different types for time.

Bug report

Required Info:

  • Operating System:
    • Ubuntu 20.04
  • Installation type:
    • binaries
  • Version or commit hash:
    • foxy
  • Client library (if applicable):
    • rclpy

Steps to reproduce issue

  1. Instantiate a tf2_ros.buffer.Buffer and call lookup_transform with time from the header.stamp (type: builtin_interfaces.msg.Time). This will pass.
  2. Instantiate a tf2_ros.buffer_client.BufferClient and call the same function with the same time type. This will fail with AttributeError: 'Time' object has no attribute 'to_msg'.

Expected behavior

Since both classes inherit from tf2_ros.BufferInterface the function signatures should be the same and the actual implementation should be interchangeable.

Actual behavior

BufferClient uses a different type for the time than the Buffer as BufferClient tries to convert the time message of type builtin_interfaces.msg.Time again via to_msg().

@christian-rauch
Copy link
Author

I see that this is fixed in humble:

where the rclpy.time.Time type is used for all implementations.

Could this (and other fixes to the BufferClient) be backported to foxy?

@clalancette
Copy link
Contributor

Could this (and other fixes to the BufferClient) be backported to foxy?

They can be backported if they don't change API or ABI. If they do change either of those, then another solution has to be found.

I'll also point out that Foxy goes End-of-Life in one month, so it may not be worth the effort.

@clalancette clalancette added the help wanted Extra attention is needed label May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants