Skip to content

Fix image_transport::create_publisher for ROS2 Rolling - #3541

Merged
Nir-Az merged 1 commit into
realsenseai:r/4.58.3from
Nir-Az:rolling-image-transport-fix
Jul 20, 2026
Merged

Fix image_transport::create_publisher for ROS2 Rolling#3541
Nir-Az merged 1 commit into
realsenseai:r/4.58.3from
Nir-Az:rolling-image-transport-fix

Conversation

@Nir-Az

@Nir-Az Nir-Az commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Overview: Fixes the ROS2 Rolling build break on r/4.58.3image_transport::create_publisher API changed on Rolling and no longer accepts a raw rclcpp::Node* rvalue.

Problem

Rolling CI fails to compile:

image_publisher.cpp:45: image_transport::create_publisher( &node, topic_name, qos )
error: cannot bind non-const lvalue reference of type 'rclcpp::Node*&' to an rvalue of type 'rclcpp::Node*'

Rolling's image_transport::create_publisher now deduces NodeT from a Node& (calls node.get_node_base_interface()) and takes rclcpp::QoS instead of rmw_qos_profile_t.

Fix

Guard the Rolling/Lyrical call path behind #if defined( LYRICAL ) || defined( ROLLING ), passing node by reference and an rclcpp::QoS. Stable distros keep the existing &node path. -DROLLING is already defined by CMakeLists.txt for ROS_DISTRO=rolling.

Cherry-pick of the image_publisher.cpp hunk from #3525 (the CMake/CI/Lyrical and FastDDS-workaround parts of that PR are intentionally excluded — ROS is not built with DDS).

Scope

  • realsense2_camera/src/image_publisher.cpp only.

🤖 Generated by AI

@Nir-Az
Nir-Az requested a review from remibettan July 20, 2026 07:47
@Nir-Az
Nir-Az merged commit d84d094 into realsenseai:r/4.58.3 Jul 20, 2026
3 checks passed
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