Repository navigation
Deprecate the shared_ptr<MessageT> subscription callback signatures - #2975
Conversation
Signed-off-by: mini-1235 <[email protected]>
fujitatomoya
left a comment
There was a problem hiding this comment.
@mini-1235 thanks for fixing up all the related packages and repositories.
changing signatures are totally fine things to do including this PR, but i want to discuss with you on either we should enforcement or deprecation here for the next release.
Signed-off-by: mini-1235 <[email protected]>
|
I am not sure how to deal with the deprecated tests here rclcpp/rclcpp/test/rclcpp/test_any_subscription_callback.cpp Lines 683 to 723 in 1500449 Should I add |
Please do! Then we can remove them in the next cycle with find/replace |
Signed-off-by: mini-1235 <[email protected]>
Signed-off-by: mini-1235 <[email protected]>
Added! |
Signed-off-by: mini-1235 <[email protected]>
fujitatomoya
left a comment
There was a problem hiding this comment.
lgtm with green CI.
|
Pulls: #2975 |
|
@mini-1235 looks like there were some uncrustify issues here. Can you address those? |
|
As reported in uncrustify/uncrustify#4250, this is a known issue in uncrustify 0.78.1. To avoid timeout, I will skip the uncrustify check here |
Signed-off-by: mini-1235 <[email protected]>
…os2#2975) Signed-off-by: mini-1235 <[email protected]>
Subscription callbacks taking a `std::shared_ptr` to a non-const message have been deprecated since ros2/rclcpp#2975 (Lyrical), and they are being removed in Rolling by ros2/rclcpp#3449. These callbacks do not modify the message, and `from_input_tensor_msg()` takes a `const` reference. Signed-off-by: Christophe Bedard <[email protected]>
Subscription callbacks taking a `std::shared_ptr` to a non-const message have been deprecated since ros2/rclcpp#2975 (Lyrical), and they are being removed in Rolling by ros2/rclcpp#3449. These callbacks do not modify the message, so take a `ConstSharedPtr`, including in the README examples. The qc tutorial subscriber reads the data through `get_data_ptr()`, which needed a non-const buffer, so add a `const` overload that returns a read-only pointer. Signed-off-by: Christophe Bedard <[email protected]>
#7539) Subscription callbacks taking a `std::shared_ptr` to a non-const message have been deprecated since ros2/rclcpp#2975 (Lyrical), and they are being removed in Rolling by ros2/rclcpp#3449. These callbacks do not modify the message, and `from_input_tensor_msg()` takes a `const` reference. (cherry picked from commit 6c90829) Signed-off-by: Christophe Bedard <[email protected]> Co-authored-by: Christophe Bedard <[email protected]>
Subscription callbacks taking a `std::shared_ptr` to a non-const message have been deprecated since ros2/rclcpp#2975 (Lyrical), and `rclcpp` is removing them. These callbacks do not modify the message. Signed-off-by: Christophe Bedard <[email protected]>
Subscription callbacks taking a `std::shared_ptr` to a non-const message were deprecated in #2975 (Lyrical), but the `[[deprecated]]` function, `AnySubscriptionCallback::set_deprecated()`, is only used inside rclcpp headers. Downstream packages include these as system headers, and GCC does not show warnings located in system headers, even if user code triggered the template instantiation, so only Clang >= 18 shows the warning. Instead, add `[[deprecated]]` overloads of `create_subscription()` and `create_generic_subscription()` (free functions and `Node` and `LifecycleNode` member functions), constrained to the deprecated callback signatures, so that the warning is located at the user's call. Move the `create_generic_subscription()` implementation to `rclcpp::detail` so that both overloads can use it, like `create_subscription()`. Then remove `set_deprecated()` and the `RCLCPP_AVOID_DEPRECATIONS_FOR_UNIT_TESTS` macro. Since GCC users will only see the warning starting with Makoa, add TODOs to remove these overloads and the support for these callback signatures after Makoa. Also update the `rclcpp_action` tests that used a deprecated callback. Part of #3176 Signed-off-by: Christophe Bedard <[email protected]>
Subscription callbacks taking a `std::shared_ptr` to a non-const message have been deprecated since ros2/rclcpp#2975 (Lyrical), and `rclcpp` is removing them. `process_message()` does not modify the message, so take a `std::shared_ptr<const rclcpp::SerializedMessage>` instead. Signed-off-by: Christophe Bedard <[email protected]>
Subscription callbacks taking a `std::shared_ptr` to a non-const message were deprecated in #2975 (Lyrical), but the `[[deprecated]]` function, `AnySubscriptionCallback::set_deprecated()`, is only used inside rclcpp headers. Downstream packages include these as system headers, and GCC does not show warnings located in system headers, even if user code triggered the template instantiation, so only Clang >= 18 shows the warning. Instead, add `[[deprecated]]` overloads of `create_subscription()` and `create_generic_subscription()` (free functions and `Node` and `LifecycleNode` member functions), constrained to the deprecated callback signatures, so that the warning is located at the user's call. Move the `create_generic_subscription()` implementation to `rclcpp::detail` so that both overloads can use it, like `create_subscription()`. Then remove `set_deprecated()` and the `RCLCPP_AVOID_DEPRECATIONS_FOR_UNIT_TESTS` macro. Since GCC users will only see the warning starting with Makoa, add TODOs to remove these overloads and the support for these callback signatures after Makoa. Also update the `rclcpp_action` tests that used a deprecated callback. Part of #3176 Signed-off-by: Christophe Bedard <[email protected]>
Description
Fixes #2972
Is this user-facing behavior change?
Yes
Did you use Generative AI?
No
Additional Information
When working on this PR, I noticed that #1713 only deprecates
MessageT. However, looking at the comment here:rclcpp/rclcpp/include/rclcpp/any_subscription_callback.hpp
Lines 140 to 154 in eb49444
it looks like the type_adaptation/serialized message are not yet deprecated, how should we proceed?
In the meantime, I have also updated the tests for type_adaptation/serialized to use
std::shared_ptr<const>