Skip to content

Use ConstSharedPtr in the buffer backend subscription examples - #7532

Merged
ahcorde merged 1 commit into
rollingfrom
christophebedard/use-const-shared-ptr-callbacks
Nov 27, 2026
Merged

ahcorde merged 1 commit into
rollingfrom
christophebedard/use-const-shared-ptr-callbacks

Conversation

@christophebedard

Copy link
Copy Markdown
Member

Description

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. These callbacks do not modify the message, and from_input_tensor_msg() takes a const reference.

Did you use Generative AI?

Claude Opus 5.5 to make this change.

Additional Information

Companion PR: ros2/rclcpp#3449, which removes these callback signatures. They are also deprecated in Lyrical, so this could be backported there.

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]>
@github-actions

Copy link
Copy Markdown

HTML artifacts: https://github.com/ros2/ros2_documentation/actions/runs/45929160083/artifacts/15168655011.

To view the resulting site:

  1. Click on the above link to download the artifacts archive
  2. Extract it
  3. Open html-artifacts-7532/index.html in your favorite browser

@ahcorde
ahcorde merged commit 6c90829 into rolling Nov 27, 2026
7 checks passed
@ahcorde
ahcorde deleted the christophebedard/use-const-shared-ptr-callbacks branch November 27, 2026 09:24
ahcorde pushed a commit that referenced this pull request Nov 27, 2026
#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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants