Skip to content

Conversation

alsora
Copy link
Collaborator

@alsora alsora commented Aug 11, 2024

I noticed that ROS 2 action clients and servers don't have an API equivalent to get_topic_name or get_service_name that you can find in publishers, subscriptions, etc.

I often needed this API in my applications and I always end up with some ugly thing that would be better handled by the client library.
So I went to try to implement it... but I quickly discovered that the logic that we normally use for topics and services is not directly applicable to actions.
rcl actions don't store such name, moreover it looks like actions ignore remapping rules?

Looking at the RCL code I see that we don't have a remapping type for actions (only for namespaces, nodes, topics and services).
I guess that users could try to remap the underlying topics and services individually, but that seems the most error prone and ugly thing to do.

I tried to solve this issue at the rclcpp level, by providing an API that at least expands the namespace.
The API is named differently from its topics and services counterpart and has a different return type, to denote that it works differently.
It's not just a lookup, it's doing string manipulations with a non-negligible performance impact.

Let me know what you think

@alsora alsora force-pushed the asoragna/actions-get-name branch from e689f7b to 97d0d5c Compare August 11, 2024 17:43
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.

1 participant