-
Notifications
You must be signed in to change notification settings - Fork 481
Description
Generated by Generative AI
No
Operating System:
Linux mini1235-XPS-15-9520 6.8.0-86-generic #87-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 22 18:03:36 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
ROS version or commit hash:
Rolling
RMW implementation (if applicable):
No response
RMW Configuration (if applicable):
No response
Client library (if applicable):
No response
'ros2 doctor --report' output
ros2 doctor --report
<COPY OUTPUT HERE>Steps to reproduce issue
- Create subscription with deprecated syntax
sub_ = this->create_subscription<std_msgs::msg::Int32>(
input,
10,
[](std::shared_ptr<std_msgs::msg::Int32> msg)
Expected behavior
Reports error or warning when compile
Actual behavior
Nothing happen
Additional information
states that
Back in Humble, subscription signatures of the form
void callback(std::shared_ptr<MessageT>)andvoid callback(std::shared_ptr<MessageT>, const rclcpp::MessageInfo &)were deprecated.
In Jazzy, these subscription signatures have been removed.
Users should switch to usingvoid callback(std::shared_ptr<const MessageT>)orvoid callback(std::shared_ptr<const MessageT>, const rclcpp MessageInfo &).
Related PRs in this repo are:
- refactor AnySubscriptionCallback and add/deprecate callback signatures #1598
- Deprecate the
void shared_ptr<MessageT>subscription callback signatures #1713 - deprecates the syntax - Remove the set_deprecated signatures in any_subscription_callback. #2431 - removes the deprecation warnings
In the latest version, I am still able to use the syntax std::shared_ptr<MessageT> in the callback, is this intended?
If no, why don't we remove the deprecated signature as well?
rclcpp/rclcpp/include/rclcpp/any_subscription_callback.hpp
Lines 140 to 154 in 4d14414
| // Deprecated signatures: | |
| using SharedPtrCallback = | |
| std::function<void (std::shared_ptr<SubscribedType>)>; | |
| using SharedPtrROSMessageCallback = | |
| std::function<void (std::shared_ptr<ROSMessageType>)>; | |
| using SharedPtrWithInfoCallback = | |
| std::function<void (std::shared_ptr<SubscribedType>, const rclcpp::MessageInfo &)>; | |
| using SharedPtrWithInfoROSMessageCallback = | |
| std::function<void ( | |
| std::shared_ptr<ROSMessageType>, | |
| const rclcpp::MessageInfo &)>; | |
| using SharedPtrSerializedMessageCallback = | |
| std::function<void (std::shared_ptr<rclcpp::SerializedMessage>)>; | |
| using SharedPtrSerializedMessageWithInfoCallback = | |
| std::function<void (std::shared_ptr<rclcpp::SerializedMessage>, const rclcpp::MessageInfo &)>; |
This is something I noticed in ros2/ros2_documentation#2333 (comment), where the ros2/demos#532 changes from const sensor_msgs::msg::Image::SharedPtr to sensor_msgs::msg::Image::ConstSharedPtr and breaks the tutorial