Repository navigation
tf_visual_tools: pass Node by reference to TransformBroadcaster - #302
Merged
Merged
Conversation
tf2_ros::TransformBroadcaster used to accept a node pointer through a set of
constructor overloads marked
[[deprecated("Use rclcpp::node_interfaces::NodeInterfaces instead of NodeT")]]
guarded by std::enable_if_t<rcpputils::is_pointer<NodeT>::value, bool>.
ros2/geometry2#940 "Removed deprecated code" (ahcorde, merged 2026-07-01,
+0/-978 across 13 files) deleted them. What remains takes
rclcpp::node_interfaces::NodeInterfaces<NodeParametersInterface,
NodeTopicsInterface>, which calls get_node_*_interface() directly on whatever
it is handed -- so a std::shared_ptr<rclcpp::Node> no longer satisfies it:
/opt/ros/rolling/include/rclcpp/rclcpp/node_interfaces/node_topics_interface.hpp:99:1:
error: 'const class std::shared_ptr<rclcpp::Node>' has no member named
'get_node_topics_interface'
99 | RCLCPP_NODE_INTERFACE_HELPERS_SUPPORT(
rclcpp::node_interfaces::NodeTopicsInterface, topics)
Dereference instead. The remaining constructor is templated on node type and
accepts a node reference on every supported distro, so no version guard is
needed -- and this is the migration the deprecation notice asked for.
First shipped in tf2_ros 0.46.2:
0.46.1 pointer ctor present -> old form compiles
0.46.2 removed by #940 -> old form fails
0.46.3 removed -> old form fails
Verified by compiling both forms against each distro's real headers:
distro (node) (*node)
humble ok ok
jazzy ok ok
rolling osrf/ros:rolling-desktop ok ok (tf2_ros 0.46.1)
rolling ros-testing on resolute FAILS ok (tf2_ros 0.46.3)
Note the prebuilt rolling desktop image still ships 0.46.1 and therefore
still accepts the old form; only the current ros-testing packages on
Resolute reject it, which is what CI builds against.
Surfaced by the rolling-testing job on #300 once #301 stopped fail-fast
from cancelling it.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
nbbrooks
force-pushed
the
nbbrooks/fix-transform-broadcaster-nodeinterfaces
branch
from
August 2, 2026 23:09
2b25a60 to
632fd3d
Compare
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.
Why
rolling-testingfails to compile on Resolute:Upstream cause
ros2/geometry2#940 — "Removed deprecated code" (ahcorde, merged 2026-07-01,
+0/-978across 13 files).tf2_ros::TransformBroadcasterused to accept a node pointer via constructor overloads marked:#940 deleted them. What remains takes
rclcpp::node_interfaces::NodeInterfaces<NodeParametersInterface, NodeTopicsInterface>, and that template callsget_node_*_interface()directly on whatever it's handed — so astd::shared_ptr<rclcpp::Node>no longer satisfies it. The error surfaces inside the rclcpp headers, but the change is in geometry2.src/tf_visual_tools.cpp:62passes theSharedPtr.First shipped in tf2_ros 0.46.2:
How
Dereference it — which is exactly the migration the deprecation notice asked for.
The remaining constructor is templated on node type and accepts a node reference on every supported distro, so no version guard is needed.
Verification
Compiled both forms against each distro's real headers:
(node)(*node)osrf/ros:humble-desktoposrf/ros:jazzy-desktoposrf/ros:rolling-desktopubuntu:resoluteosrf/ros:rolling-desktopimage still ships tf2_ros 0.46.1 and therefore still accepts the old form. Only the currentros-testingpackages on Resolute reject it — which is what CI and the buildfarm use. Testing against the desktop image alone gives a false pass.How it surfaced
The
ros2matrix used to cancel this job: nofail-fast: false, and therolling+ROS_REPO: mainjob died in setup within ~60s, taking its siblings with it. #301 fixed that; #300 fixed the Qt5/Qt6 collision that was masking this behind an earlier CMake generate failure. With both cleared, the build gets 44s into compiling and hits this.Independent of #300 — this touches only
src/tf_visual_tools.cpp, that one touchesCMakeLists.txt+package.xml. Either merge order works.🤖 Generated with Claude Code