From 6d0fae07042c50500ea2b379464b0cfb36240982 Mon Sep 17 00:00:00 2001 From: sergiopaniego Date: Fri, 15 Oct 2021 16:00:51 +0000 Subject: [PATCH] Hot fix metrics --- behavior_metrics/utils/metrics.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/behavior_metrics/utils/metrics.py b/behavior_metrics/utils/metrics.py index 5f62a689..56f63de6 100644 --- a/behavior_metrics/utils/metrics.py +++ b/behavior_metrics/utils/metrics.py @@ -70,10 +70,12 @@ def read_perfect_lap_rosbag(ground_truth_lap_file): perfect_lap_checkpoints.append(row) start_point = perfect_lap_checkpoints[0] - for x, point in enumerate(perfect_lap_checkpoints): - if x > 100 and is_finish_line(point, start_point): - lap_point = point - break + lap_point = 0 + for ckp_iter, point in enumerate(perfect_lap_checkpoints): + if ckp_iter > 100 and is_finish_line(point, start_point): + if type(lap_point) == int: + lap_point = point + break circuit_diameter = circuit_distance_completed(perfect_lap_checkpoints, lap_point) shutil.rmtree(ground_truth_lap_file.split('.bag')[0])