-
Notifications
You must be signed in to change notification settings - Fork 2
Add API that is closer to the original tf2 one #1
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
Conversation
bitbots_tf_buffer/__init__.py
Outdated
| class TransformListener: | ||
| """ | ||
| A dummy TransformListener that just sets the node into the C++ Buffer. | ||
| This is done for compatibility with the previous implementation. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
| 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) |
There was a problem hiding this comment.
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 ;)
There was a problem hiding this comment.
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.
No description provided.