From 4ac1fbf3da6e16f3728abfcc6aad6ffd1c6275aa Mon Sep 17 00:00:00 2001 From: "temkei.kem" <1041084556@qq.com> Date: Fri, 4 Oct 2024 18:56:05 +0900 Subject: [PATCH] fix a perception reproducer bug. --- .../scripts/perception_replayer/perception_reproducer.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/planning/planning_debug_tools/scripts/perception_replayer/perception_reproducer.py b/planning/planning_debug_tools/scripts/perception_replayer/perception_reproducer.py index b096aa344..3f63321b0 100755 --- a/planning/planning_debug_tools/scripts/perception_replayer/perception_reproducer.py +++ b/planning/planning_debug_tools/scripts/perception_replayer/perception_reproducer.py @@ -176,8 +176,12 @@ def on_timer(self): (ego_pose.position.x - ego_odom_msg.pose.pose.position.x) ** 2 + (ego_pose.position.y - ego_odom_msg.pose.pose.position.y) ** 2 ) - repeat_flag = ego_rosbag_speed > ego_speed * 5 and ego_rosbag_dist > 1.0 - # set the speed threshold to many (5) times then ego_speed because this constraint is mainly for departing/stopping (ego speed is close to 0). + repeat_flag = ( + ego_rosbag_speed > ego_speed * 2 + and ego_rosbag_speed > 3.0 + and ego_rosbag_dist > self.ego_odom_search_radius + ) + # if ego_rosbag_speed is too fast than ego_speed, stop publishing the rosbag's ego odom message temporarily. if not repeat_flag: self.stopwatch.tic("find_topics_by_timestamp")