File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
evaluator/autoware_perception_online_evaluator/test Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -264,6 +264,13 @@ class EvalTest : public ::testing::Test
264264
265265 double publishObjectsAndGetMetric (const PredictedObjects & objects)
266266 {
267+ // Flush any stale metrics still in the DDS pipeline from previous publish cycles
268+ for (int i = 0 ; i < 3 ; ++i) {
269+ rclcpp::spin_some (eval_node);
270+ rclcpp::spin_some (dummy_node);
271+ rclcpp::sleep_for (std::chrono::milliseconds (100 ));
272+ }
273+
267274 metric_updated_ = false ;
268275 objects_pub_->publish (objects);
269276 const auto now = rclcpp::Clock ().now ();
@@ -282,8 +289,8 @@ class EvalTest : public ::testing::Test
282289 void publishObjects (const PredictedObjects & objects)
283290 {
284291 objects_pub_->publish (objects);
285- rclcpp::spin_some (eval_node);
286292 rclcpp::sleep_for (std::chrono::milliseconds (100 ));
293+ rclcpp::spin_some (eval_node);
287294 rclcpp::spin_some (dummy_node);
288295 }
289296
You can’t perform that action at this time.
0 commit comments