Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pipeline.py #218

Merged
merged 4 commits into from
Sep 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions python/kiss_icp/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
nachovizzo marked this conversation as resolved.
Show resolved Hide resolved
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)

Expand Down
Loading