Skip to content

fix(cloudini_ros): bind node to a named lvalue for PointCloudTransport on Rolling#117

Open
facontidavide wants to merge 1 commit into
mainfrom
fix/ros-pct-node-interfaces
Open

fix(cloudini_ros): bind node to a named lvalue for PointCloudTransport on Rolling#117
facontidavide wants to merge 1 commit into
mainfrom
fix/ros-pct-node-interfaces

Conversation

@facontidavide

Copy link
Copy Markdown
Owner

Problem

The ROS 2 buildfarm devel job fails to build cloudini_ros on Rolling/Resolute (GCC 15):
Rdev__cloudini__ubuntu_resolute_amd64 #6

test/test_plugin_subscriber.cpp:51 …
error: no matching function for call to
  'construct_at(point_cloud_transport::PointCloudTransport*&, std::shared_ptr<rclcpp::Node>)'
error: cannot bind non-const lvalue reference of type 'std::shared_ptr<rclcpp::Node>&' to an rvalue
note: NodeInterfaces(NodeT & node)

Root cause

point_cloud_transport removed its deprecated by-value constructor PointCloudTransport(rclcpp::Node::SharedPtr) on Rolling, leaving only PointCloudTransport(rclcpp::node_interfaces::NodeInterfaces<…>). Building a NodeInterfaces from a node goes through NodeInterfaces(NodeT& node) — a non-const lvalue reference — so the temporary returned by shared_from_this() can no longer bind.

Fix

Bind shared_from_this() to a named lvalue before constructing PointCloudTransport, in both plugin tests (test_plugin_publisher.cpp, test_plugin_subscriber.cpp). Distro-safe: older distros still have the by-value ctor (lvalue binds it); Rolling/Resolute use the NodeInterfaces ctor (lvalue binds NodeInterfaces(NodeT&)). No -Werror in cloudini_ros, so the deprecation on intermediate distros is non-fatal.

The ros-rolling workflow in this repo builds+tests cloudini_ros on Rolling, so CI here reproduces and verifies the fix.

🤖 Generated with Claude Code

…t (Rolling)

ROS Rolling/Resolute removed point_cloud_transport's deprecated by-value
PointCloudTransport(rclcpp::Node::SharedPtr) constructor, leaving only the
NodeInterfaces overload. Building a NodeInterfaces from a node goes through
NodeInterfaces(NodeT& node) -- a non-const lvalue reference -- so the temporary
returned by shared_from_this() no longer binds:

  error: cannot bind non-const lvalue reference of type
  'std::shared_ptr<rclcpp::Node>&' to an rvalue

Bind shared_from_this() to a named lvalue first in the plugin publisher and
subscriber tests. Works on all distros (older ones still expose the by-value
ctor; Rolling/Resolute use the NodeInterfaces ctor).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Timple

Timple commented Jun 4, 2026

Copy link
Copy Markdown

Perhaps there is another constructor you can use which passes the required interfaces

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