diff --git a/python/kiss_icp/pipeline.py b/python/kiss_icp/pipeline.py index e8d0b3ab..8946d946 100644 --- a/python/kiss_icp/pipeline.py +++ b/python/kiss_icp/pipeline.py @@ -166,24 +166,22 @@ def _write_gt_poses(self): ) def _run_evaluation(self): - if not self.has_gt: - print("[WARNING] No GT poses available, skipping evaluation") - return - + # Run estimation metrics evaluation, only when GT data was provided + if self.has_gt: + avg_tra, avg_rot = sequence_error(self.gt_poses, self.poses) + ate_rot, ate_trans = absolute_trajectory_error(self.gt_poses, self.poses) + self.results.append(desc="Average Translation Error", units="%", value=avg_tra) + self.results.append(desc="Average Rotational Error", units="deg/m", value=avg_rot) + self.results.append(desc="Absolute Trajectory Error (ATE)", units="m", value=ate_trans) + self.results.append(desc="Absolute Rotational Error (ARE)", units="rad", value=ate_rot) + + # Run timing metrics evaluation, always def _get_fps(): total_time_s = sum(self.times) * 1e-9 return float(len(self.times) / total_time_s) - # Run metrics evaluation - avg_tra, avg_rot = sequence_error(self.gt_poses, self.poses) - ate_rot, ate_trans = absolute_trajectory_error(self.gt_poses, self.poses) - avg_fps = int(np.floor(_get_fps())) - avg_ms = 1e3 * (1 / avg_fps) - - self.results.append(desc="Average Translation Error", units="%", value=avg_tra) - self.results.append(desc="Average Rotational Error", units="deg/m", value=avg_rot) - self.results.append(desc="Absolute Trajectory Error (ATE)", units="m", value=ate_trans) - self.results.append(desc="Absolute Rotational Error (ARE)", units="rad", value=ate_rot) + avg_fps = int(np.ceil(_get_fps())) + avg_ms = int(np.ceil(1e3 * (1 / _get_fps()))) self.results.append(desc="Average Frequency", units="Hz", value=avg_fps, trunc=True) self.results.append(desc="Average Runtime", units="ms", value=avg_ms, trunc=True)