fix(cloudini_ros): bind node to a named lvalue for PointCloudTransport on Rolling#117
Open
facontidavide wants to merge 1 commit into
Open
fix(cloudini_ros): bind node to a named lvalue for PointCloudTransport on Rolling#117facontidavide wants to merge 1 commit into
facontidavide wants to merge 1 commit into
Conversation
…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>
|
Perhaps there is another constructor you can use which passes the required interfaces |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The ROS 2 buildfarm devel job fails to build
cloudini_roson Rolling/Resolute (GCC 15):Rdev__cloudini__ubuntu_resolute_amd64 #6
Root cause
point_cloud_transportremoved its deprecated by-value constructorPointCloudTransport(rclcpp::Node::SharedPtr)on Rolling, leaving onlyPointCloudTransport(rclcpp::node_interfaces::NodeInterfaces<…>). Building aNodeInterfacesfrom a node goes throughNodeInterfaces(NodeT& node)— a non-const lvalue reference — so the temporary returned byshared_from_this()can no longer bind.Fix
Bind
shared_from_this()to a named lvalue before constructingPointCloudTransport, 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 theNodeInterfacesctor (lvalue bindsNodeInterfaces(NodeT&)). No-Werrorincloudini_ros, so the deprecation on intermediate distros is non-fatal.The
ros-rollingworkflow in this repo builds+testscloudini_roson Rolling, so CI here reproduces and verifies the fix.🤖 Generated with Claude Code