ros2 / examples

Example packages for ROS 2
Apache License 2.0
681 stars 308 forks source link

Use `const&` signature for read-only sub callbacks #337

Closed aprotyas closed 2 years ago

aprotyas commented 2 years ago

The constant reference message signatures should be preferred over the shared pointer to constant message signatures for read-only subscriber callbacks, as discussed in https://github.com/ros2/rclcpp/pull/1598.

As such, it makes sense to migrate to said signatures in the examples.

Note that this should be backported to Galactic only.

Signed-off-by: Abrar Rahman Protyasha aprotyas@u.rochester.edu

aprotyas commented 2 years ago

CI Repos file: https://gist.github.com/aprotyas/dca8fd39a17abacc898fa569e6b50fc5 Build args: --packages-up-to examples_rclcpp_minimal_subscriber Test args: --packages-select examples_rclcpp_minimal_subscriber Job: https://ci.ros2.org/job/ci_launcher/9790/