evo评估
通过跑王京大神的learnorb得到的数据集与真实的轨迹进行对比
数据集:MH_01_easy.bag
得到的
我得到的关键帧的实际轨迹,为txt文件。
而真实轨迹为data.csv 文件 都为Euroc格式,开始参考:
链接: https://blog.csdn.net/weixin_41969600/article/details/89891610.即可得到
通过以下代码转换为tum格式:
//evo_traj euroc data.csv --save_as_tum
本来想着 都变成tum格式就可对齐,得到评估图像,但我开始错误了得到时间戳不一致
然后找了好久好久
//#!/usr/bin/python
# -*- coding: UTF-8 -*-
import csv
# 输入csv文件名称和输出txt文件名称
csv_file = raw_input('Enter the name of your input csv file: ')
txt_file = raw_input('Enter the name of your output txt file: ')
with open(txt_file, "w") as my_output_file:
with open(csv_file, "r") as my_input_file:
#逐行读取csv存入txt中
for row in csv.reader(my_input_file):
# 前8个数据是:timestamp tx ty tz qw qx qy qz
row = row[0:8]
# 时间戳单位处理
temp1 = row[0][0:10] + row[0][10:16]
row[0] = temp1
# 互换 qw 和 qx
temp2 = row[4]
row[4] = row[7]
row[7] = temp2
my_output_file.write(" ".join(row)+'\n')
my_output_file.close()