From 3f2dbf004a5604a10ea902af2d8a20e77ae2af8d Mon Sep 17 00:00:00 2001 From: stevemacenski Date: Thu, 7 Jul 2022 13:01:37 -0700 Subject: [PATCH 1/2] forward porting #3053 --- nav2_costmap_2d/plugins/range_sensor_layer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nav2_costmap_2d/plugins/range_sensor_layer.cpp b/nav2_costmap_2d/plugins/range_sensor_layer.cpp index c8020781d6f..ffbe8a3ef8b 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", From 7e412ea42439ed7d6dbd4acd6756720271c1b5dc Mon Sep 17 00:00:00 2001 From: stevemacenski Date: Mon, 11 Jul 2022 12:23:50 -0700 Subject: [PATCH 2/2] adding TF warning suggestion --- nav2_costmap_2d/test/integration/range_tests.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/nav2_costmap_2d/test/integration/range_tests.cpp b/nav2_costmap_2d/test/integration/range_tests.cpp index 196406e7e02..1ee5380b7a2 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));