From ed21f991e752d3ac3f08fc081795ff2eed09069b Mon Sep 17 00:00:00 2001 From: fabianhirmann <117293434+fabianhirmann@users.noreply.github.com> Date: Mon, 10 Jul 2023 15:33:40 +0200 Subject: [PATCH] add missing tf timeout at differential mode of IMU, odometry, and pose sensor model (#322) --- fuse_models/src/imu_2d.cpp | 4 ++-- fuse_models/src/odometry_2d.cpp | 4 ++-- fuse_models/src/pose_2d.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fuse_models/src/imu_2d.cpp b/fuse_models/src/imu_2d.cpp index 0874faccc..24a4ae0e1 100644 --- a/fuse_models/src/imu_2d.cpp +++ b/fuse_models/src/imu_2d.cpp @@ -222,7 +222,7 @@ void Imu2D::processDifferential(const geometry_msgs::PoseWithCovarianceStamped& transformed_pose->header.frame_id = params_.orientation_target_frame.empty() ? pose.header.frame_id : params_.orientation_target_frame; - if (!common::transformMessage(tf_buffer_, pose, *transformed_pose)) + if (!common::transformMessage(tf_buffer_, pose, *transformed_pose, params_.tf_timeout)) { ROS_WARN_STREAM_THROTTLE(5.0, "Cannot transform pose message with stamp " << pose.header.stamp << " to orientation target frame " @@ -242,7 +242,7 @@ void Imu2D::processDifferential(const geometry_msgs::PoseWithCovarianceStamped& transformed_twist.header.frame_id = params_.twist_target_frame.empty() ? twist.header.frame_id : params_.twist_target_frame; - if (!common::transformMessage(tf_buffer_, twist, transformed_twist)) + if (!common::transformMessage(tf_buffer_, twist, transformed_twist, params_.tf_timeout)) { ROS_WARN_STREAM_THROTTLE(5.0, "Cannot transform twist message with stamp " << twist.header.stamp << " to twist target frame " diff --git a/fuse_models/src/odometry_2d.cpp b/fuse_models/src/odometry_2d.cpp index 3ffb04b28..73bc06d18 100644 --- a/fuse_models/src/odometry_2d.cpp +++ b/fuse_models/src/odometry_2d.cpp @@ -165,7 +165,7 @@ void Odometry2D::processDifferential(const geometry_msgs::PoseWithCovarianceStam transformed_pose->header.frame_id = params_.pose_target_frame.empty() ? pose.header.frame_id : params_.pose_target_frame; - if (!common::transformMessage(tf_buffer_, pose, *transformed_pose)) + if (!common::transformMessage(tf_buffer_, pose, *transformed_pose, params_.tf_timeout)) { ROS_WARN_STREAM_THROTTLE(5.0, "Cannot transform pose message with stamp " << pose.header.stamp << " to pose target frame " << params_.pose_target_frame); @@ -184,7 +184,7 @@ void Odometry2D::processDifferential(const geometry_msgs::PoseWithCovarianceStam transformed_twist.header.frame_id = params_.twist_target_frame.empty() ? twist.header.frame_id : params_.twist_target_frame; - if (!common::transformMessage(tf_buffer_, twist, transformed_twist)) + if (!common::transformMessage(tf_buffer_, twist, transformed_twist, params_.tf_timeout)) { ROS_WARN_STREAM_THROTTLE(5.0, "Cannot transform twist message with stamp " << twist.header.stamp << " to twist target frame " diff --git a/fuse_models/src/pose_2d.cpp b/fuse_models/src/pose_2d.cpp index 248e1ded1..66fb2e1a1 100644 --- a/fuse_models/src/pose_2d.cpp +++ b/fuse_models/src/pose_2d.cpp @@ -131,7 +131,7 @@ void Pose2D::processDifferential(const geometry_msgs::PoseWithCovarianceStamped& auto transformed_pose = std::make_unique(); transformed_pose->header.frame_id = params_.target_frame.empty() ? pose.header.frame_id : params_.target_frame; - if (!common::transformMessage(tf_buffer_, pose, *transformed_pose)) + if (!common::transformMessage(tf_buffer_, pose, *transformed_pose, params_.tf_timeout)) { ROS_WARN_STREAM_THROTTLE(5.0, "Cannot transform pose message with stamp " << pose.header.stamp << " to target frame " << params_.target_frame);