From 1801589173ae3615484a67db849cbc49f37c37fa Mon Sep 17 00:00:00 2001 From: Hugo Laloge Date: Thu, 16 Apr 2026 10:20:26 +0200 Subject: [PATCH] Re-use the main filter node for the TransformListener This avoids spawning a new node uselessly. --- src/scan_to_cloud_filter_chain.cpp | 2 +- src/scan_to_scan_filter_chain.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scan_to_cloud_filter_chain.cpp b/src/scan_to_cloud_filter_chain.cpp index 859f7758..9ff360d2 100644 --- a/src/scan_to_cloud_filter_chain.cpp +++ b/src/scan_to_cloud_filter_chain.cpp @@ -45,7 +45,7 @@ ScanToCloudFilterChain::ScanToCloudFilterChain( diagnostic_updater_(this), laser_max_range_(DBL_MAX), buffer_(this->get_clock()), - tf_(buffer_), + tf_(buffer_, this), filter_(scan_sub_, buffer_, "", 50, *this), cloud_filter_chain_("sensor_msgs::msg::PointCloud2"), scan_filter_chain_("sensor_msgs::msg::LaserScan") diff --git a/src/scan_to_scan_filter_chain.cpp b/src/scan_to_scan_filter_chain.cpp index 98743316..53ec5dbb 100644 --- a/src/scan_to_scan_filter_chain.cpp +++ b/src/scan_to_scan_filter_chain.cpp @@ -71,7 +71,7 @@ ScanToScanFilterChain::ScanToScanFilterChain( this->get_parameter("scan_filtered_history_depth", scan_filtered_history_depth_); if (!tf_message_filter_target_frame_.empty()) { - tf_.reset(new tf2_ros::TransformListener(buffer_)); + tf_.reset(new tf2_ros::TransformListener(buffer_, this)); tf_filter_.reset( new tf2_ros::MessageFilter( scan_sub_, buffer_, "",