2019-04-14 21:07:42 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
2019-07-29 16:14:02 +02:00
|
|
|
import json
|
2019-04-14 21:07:42 +02:00
|
|
|
|
|
|
|
|
2019-07-29 16:56:22 +02:00
|
|
|
datasets = ['Seq.', 'MH_01_easy', 'MH_02_easy', 'MH_03_medium', 'MH_04_difficult',
|
2019-04-14 21:07:42 +02:00
|
|
|
'MH_05_difficult', 'V1_01_easy', 'V1_02_medium',
|
|
|
|
'V1_03_difficult', 'V2_01_easy', 'V2_02_medium']
|
|
|
|
|
|
|
|
|
|
|
|
# Other results.
|
2019-07-29 16:14:02 +02:00
|
|
|
|
2019-04-14 21:07:42 +02:00
|
|
|
|
2019-07-29 16:56:22 +02:00
|
|
|
vio = {
|
|
|
|
'ate' : ['VIO RMS ATE [m]'],
|
|
|
|
'time' : ['VIO Time [s]'],
|
|
|
|
'num_frames' : ['VIO Num. Frames']
|
|
|
|
}
|
2019-04-14 21:07:42 +02:00
|
|
|
|
2019-07-29 16:56:22 +02:00
|
|
|
mapping = {
|
|
|
|
'ate' : ['MAP RMS ATE [m]'],
|
|
|
|
'time' : ['MAP Time [s]'],
|
|
|
|
'num_frames' : ['MAP Num. KFs']
|
|
|
|
}
|
2019-04-14 21:07:42 +02:00
|
|
|
|
2019-07-29 16:56:22 +02:00
|
|
|
pose_graph = {
|
|
|
|
'ate' : ['PG RMS ATE [m]'],
|
|
|
|
'time' : ['PG Time [s]'],
|
|
|
|
'num_frames' : ['PG Num. KFs']
|
|
|
|
}
|
|
|
|
|
|
|
|
out_dir = sys.argv[1]
|
|
|
|
|
|
|
|
def load_data(x, prefix, key):
|
|
|
|
fname = out_dir + '/' + prefix + '_' + key
|
2019-04-14 21:07:42 +02:00
|
|
|
if os.path.isfile(fname):
|
2019-04-15 17:38:58 +02:00
|
|
|
with open(fname, 'r') as f:
|
2019-07-29 16:14:02 +02:00
|
|
|
j = json.load(f)
|
|
|
|
res = round(j['rms_ate'], 3)
|
2019-07-29 16:56:22 +02:00
|
|
|
x['ate'].append(float(res))
|
|
|
|
x['time'].append(round(j['exec_time_ns']*1e-9, 3))
|
|
|
|
x['num_frames'].append(j['num_frames'])
|
2019-04-14 21:07:42 +02:00
|
|
|
else:
|
2019-07-29 16:56:22 +02:00
|
|
|
x['ate'].append(float('Inf'))
|
|
|
|
x['time'].append(float('Inf'))
|
|
|
|
x['num_frames'].append(float('Inf'))
|
|
|
|
|
|
|
|
|
|
|
|
for key in datasets[1:]:
|
|
|
|
load_data(vio, 'vio', key)
|
|
|
|
load_data(mapping, 'mapper', key)
|
|
|
|
load_data(pose_graph, 'mapper_no_weights', key)
|
|
|
|
|
|
|
|
|
|
|
|
row_format ="{:>17}" + "{:>13}" * (len(datasets)-1)
|
|
|
|
|
|
|
|
datasets_short = [x[:5] for x in datasets]
|
|
|
|
|
|
|
|
print '\nVisual-Inertial Odometry'
|
|
|
|
print row_format.format(*datasets_short)
|
|
|
|
|
|
|
|
print row_format.format(*vio['ate'])
|
|
|
|
print row_format.format(*vio['time'])
|
|
|
|
print row_format.format(*vio['num_frames'])
|
2019-04-14 21:07:42 +02:00
|
|
|
|
2019-07-29 16:56:22 +02:00
|
|
|
print '\nVisual-Inertial Mapping'
|
|
|
|
print row_format.format(*datasets_short)
|
2019-07-29 16:18:04 +02:00
|
|
|
|
2019-07-29 16:56:22 +02:00
|
|
|
print row_format.format(*mapping['ate'])
|
|
|
|
print row_format.format(*mapping['time'])
|
|
|
|
print row_format.format(*mapping['num_frames'])
|
2019-07-29 16:14:02 +02:00
|
|
|
|
|
|
|
|
2019-07-29 16:56:22 +02:00
|
|
|
print '\nPose-Graph optimization (Identity weights for all factors)'
|
|
|
|
print row_format.format(*datasets_short)
|
2019-07-29 16:14:02 +02:00
|
|
|
|
2019-07-29 16:56:22 +02:00
|
|
|
print row_format.format(*pose_graph['ate'])
|
|
|
|
print row_format.format(*pose_graph['time'])
|
|
|
|
print row_format.format(*pose_graph['num_frames'])
|
2019-04-14 21:07:42 +02:00
|
|
|
|