-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use const&
signature for read-only sub callbacks
#2297
Conversation
The constant reference message signatures should be preferred over the shared pointer to constant message signatures for read-only subscriber callbacks, as discussed in ros2/rclcpp#1598. As such, it makes sense to migrate to said signatures in documentation. Signed-off-by: Abrar Rahman Protyasha <[email protected]>
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.
In short, I'm fine with this change, but @aprotyas did you test out these tutorials on Foxy, Galactic, and Rolling to ensure that they still work?
Yes, I forgot to mention. I've tested and these tutorials only work on Rolling and Galactic because the Also, since users will download code from ros2/examples in the simple pubsub tutorial, another PR is needed to reflect the changes in minimal_subscriber/member_function.cpp. I will open that shortly. |
Ah, excellent. Thanks for letting me know. In that case, I'm going to approve and merge this one, and backport to only Galactic. |
The constant reference message signatures should be preferred over the shared pointer to constant message signatures for read-only subscriber callbacks, as discussed in ros2/rclcpp#1598. As such, it makes sense to migrate to said signatures in documentation. Signed-off-by: Abrar Rahman Protyasha <[email protected]> (cherry picked from commit e4cd3cb) # Conflicts: # source/Tutorials/Custom-ROS2-Interfaces.rst # source/Tutorials/FastDDS-Configuration/FastDDS-Configuration.rst # source/Tutorials/Tf2/Writing-A-Tf2-Broadcaster-Cpp.rst # source/Tutorials/Writing-A-Simple-Cpp-Publisher-And-Subscriber.rst
…2298) * Use `const&` signature for read-only sub callbacks (#2297) The constant reference message signatures should be preferred over the shared pointer to constant message signatures for read-only subscriber callbacks, as discussed in ros2/rclcpp#1598. As such, it makes sense to migrate to said signatures in documentation. Signed-off-by: Abrar Rahman Protyasha <[email protected]> (cherry picked from commit e4cd3cb) Co-authored-by: Chris Lalancette <[email protected]>
The constant reference message signatures should be preferred over the
shared pointer to constant message signatures for read-only subscriber
callbacks, as discussed in ros2/rclcpp#1598.
As such, it makes sense to migrate to said signatures in documentation.
Signed-off-by: Abrar Rahman Protyasha [email protected]