Unified Node Interfaces: Add const version of get_node_x_interface()#3006
Conversation
…turns a const shared pointer which can be used in e.g. const member functions to access at least the const member functions of the node interfaces Signed-off-by: Fabian Hirmann <f.hirmann@arti-robots.com>
|
Since you two were/are currently looking at my other PR #3002, I was hoping that you maybe could also look into that one too. If not, please let me know. After #3002 is merged, it would be great if you could also trigger backporting this change to Humble using mergifyio (and probably to all other ROS versions which are having the Many thanks, |
|
Pulls: #3006 |
fujitatomoya
left a comment
There was a problem hiding this comment.
@fabianhirmann this fails to build, you can see the build log here https://ci.ros2.org/job/ci_linux/26520/console.
guess that there are no such methods with signature generated by this macro?
|
Thank you for your comments @ahcorde and @alsora! I found the issue at the build and locally it successfully built on rolling now. The issue was that in #2075 the method for directly creating The question for me now is if I should also backport #2075 to Humble after #3002 is completed (or as part of #3002) such that the constructors of |
…g changes from ros2#2075 Signed-off-by: Fabian Hirmann <f.hirmann@arti-robots.com>
fe5b48e to
45f9c67
Compare
|
Pulls: #3006 |
|
@ahcorde Thank you for triggering another build. I saw now that it is failing but from the logs it looks like there is another error at the build which is unrelated to my changes and looks like a general CI issue. Therefore it would be great if you could have a look on it (or just trigger another build). |
|
Pulls: #3006 |
…os2#3006) Signed-off-by: Fabian Hirmann <f.hirmann@arti-robots.com>
|
https://github.com/Mergifyio backport kilted jazzy humble |
✅ Backports have been createdDetails
|
Description
This small PR adds a const version of get_node_x_interface() which returns a const shared pointer.
Is this user-facing behavior change?
No
Did you use Generative AI?
No
Additional Information
This addition is required when the
NodeInterfacesclass is a member of a class and one then would like to use theNodeInterfacesclass member in a const member function of that class to access at least const member functions of the separate node interfaces. Without this addition this is not possible at all andNodeInterfacesclass members can only be accessed in non-const member functions.It would also be great if this can be backported to older versions as well (especially in my case to Humble which gets just now the unified node interfaces backported with #3002).