diff --git a/nav2_costmap_2d/plugins/range_sensor_layer.cpp b/nav2_costmap_2d/plugins/range_sensor_layer.cpp index c8020781d6..ffbe8a3ef8 100644 --- a/nav2_costmap_2d/plugins/range_sensor_layer.cpp +++ b/nav2_costmap_2d/plugins/range_sensor_layer.cpp @@ -293,7 +293,9 @@ void RangeSensorLayer::updateCostmap( in.header.frame_id = range_message.header.frame_id; if (!tf_->canTransform( - in.header.frame_id, global_frame_, tf2_ros::fromMsg(in.header.stamp))) + in.header.frame_id, global_frame_, + tf2_ros::fromMsg(in.header.stamp), + tf2_ros::fromRclcpp(transform_tolerance_))) { RCLCPP_INFO( logger_, "Range sensor layer can't transform from %s to %s", diff --git a/nav2_costmap_2d/test/integration/range_tests.cpp b/nav2_costmap_2d/test/integration/range_tests.cpp index 196406e7e0..1ee5380b7a 100644 --- a/nav2_costmap_2d/test/integration/range_tests.cpp +++ b/nav2_costmap_2d/test/integration/range_tests.cpp @@ -115,6 +115,7 @@ class TestNode : public ::testing::Test : node_(std::make_shared("range_test_node")), tf_(node_->get_clock()) { + tf_.setUsingDedicatedThread(true); // Standard non-plugin specific parameters node_->declare_parameter("map_topic", rclcpp::ParameterValue(std::string("map"))); node_->declare_parameter("track_unknown_space", rclcpp::ParameterValue(false));