Skip to content

Make process_message() take a shared_ptr to a const message - #159

Merged
christophebedard merged 1 commit into
rollingfrom
christophebedard/const-serialized-message-callback
Nov 28, 2026
Merged

christophebedard merged 1 commit into
rollingfrom
christophebedard/const-serialized-message-callback

Conversation

@christophebedard

@christophebedard christophebedard commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

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.

Needed for ros2/rclcpp#3449, which removes these callback signatures. Merge this one first. These won't be removed for Makoa, see ros2/rclcpp#3450. However, they're still deprecated, so we should make this change.

Did you use Generative AI?

Claude Opus 5.5 to make this change.

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 <bedard.christophe@gmail.com>
@christophebedard
christophebedard merged commit 9eeaa84 into rolling Nov 28, 2026
11 checks passed
@christophebedard
christophebedard deleted the christophebedard/const-serialized-message-callback branch November 28, 2026 17:53
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.

2 participants