Skip to content

Conversation

@Flova
Copy link
Member

@Flova Flova commented May 29, 2025

No description provided.

class TransformListener:
"""
A dummy TransformListener that just sets the node into the C++ Buffer.
This is done for compatibility with the previous implementation.
Copy link
Member

Choose a reason for hiding this comment

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

Previous means here the original API?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes

Comment on lines +36 to +42
def set_node(self, node: Node):
"""
This API is used instead of the constructor to set the node.
This way we can have a dummy TransformListener and therefore
keep compatibility with the official implementation.
"""
self._impl = CppBuffer(serialize_message(Duration.to_msg(self.cache_time)), node)
Copy link
Member

Choose a reason for hiding this comment

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

I believe, set_node is a custom name and does not stem from tf2_ros, right?
I don't have a better suggestion, but I have the feeling, the names here are a bit convoluted: set_node, impl, CppBuffer. Maybe we can clean this up a bit ;)

Copy link
Member Author

@Flova Flova May 29, 2025

Choose a reason for hiding this comment

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

Add node ist a custom API. But is does not break the upstream interface.

What do you mean by convoluted?

CppBuffer ist the name of the Cpp library that this python class wraps to add things like types, doc strings etc.

impl holds the reference to the actual implementation. Naming the it impl is common with this pattern. I think TF2 and our move it bindings do it too (tho. I haven't checked).

And add node adds a node to the TF buffer enabling the use of a dummy listener.

I am not sure how to clean it up either.

@jaagut jaagut self-requested a review June 5, 2025 13:31
@Flova Flova merged commit 9ddce3f into main Jun 7, 2025
@Flova Flova deleted the feature/new_api branch June 7, 2025 06:22
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

Successfully merging this pull request may close these issues.

3 participants