Skip to content

Commit

Permalink
Script for vilens and hba evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
MunozBanon committed Oct 8, 2024
1 parent 39c2f05 commit c496d98
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 49 deletions.
49 changes: 0 additions & 49 deletions scripts/localisation_benchmark/hba.py

This file was deleted.

40 changes: 40 additions & 0 deletions scripts/localisation_benchmark/vilens_hba.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import re
import sys

sys.path.append("/home/oxford_spires_dataset")

from oxford_spires_utils.bash_command import run_command

def evaluation_ape_rmse (path_gt, path_traj):

output = run_command("evo_ape tum {} {} --align_origin --t_max_diff 0.01".format(path_gt, path_traj), print_output=False)

for line in output.stdout:
print(line, end="")
if "rmse" in line:
numbers = re.findall('\d+\.\d+|\d+', line)
rmse = numbers[0]

print("RMSE added to log: {}".format(rmse))

return rmse

if __name__ == "__main__":

path = '/home/oxford_spires_dataset/data/' # TODO: get path from arg an define folders in the future class.
sequence = '2024-03-20-christ-church-05' # TODO: get sequence from arg an define folders in the future class.
sub_dir = "/output_slam/"
file_name = "vilens_poses_tum.txt"
file_name_gt = "/ground_truth_traj/gt_lidar.txt"

path_gt = path + sequence + file_name_gt
path_traj = path + sequence + sub_dir + file_name

print("RUNNING VILENS EVALUATION ...")
rmse = evaluation_ape_rmse (path_gt, path_traj)

file_name = "hba_poses_tum.txt"
path_traj = path + sequence + sub_dir + file_name
print("RUNNING HBA EVALUATION ...")
rmse = evaluation_ape_rmse (path_gt, path_traj)

0 comments on commit c496d98

Please sign in to comment.