网上没咋找到有关kitti数据集自带里程计评测工具的内容,这里补充给一下。
下载
需要下载的文件:calibration_files, ground_truth_poses和development_kit (以下介绍参考development_kit中的readme.txt)
- calibration_files: 相机内参,LiDAR到相机外参,以及图像的什么时间戳(不是很懂)
- ground_truth_poses: 00 - 10序列位姿真值
- development_kit: 评测程序 evaluate_odometry
使用
主要参考development_kit中的readme.txt
-
编译development_kit/devkit/cpp/evaluate_odometry.cpp
g++ -O3 -DNDEBUG -o evaluate_odometry evaluate_odometry.cpp matrix.cpp
如果报以下错误1
在mail.h的Mail类中添加以下代码void finalize (bool success,std::string benchmark,std::string result_sha="",std::string user_sha="") { if (success) { msg("Your evaluation results are available at:"); msg("http://www.cvlibs.net/datasets/kitti/user_submit_check_login.php?benchmark=%s&user=%s&result=%s",benchmark.c_str(),user_sha.c_str(), result_sha.c_str()); } else { msg("An error occured while processing your results."); msg("Please make sure that the data in your zip archive has the right format!"); } }
-
目录组织结构及文件
为了后面成功运行evaluate_odometry,需要构建如下的目录结构,即需在evaluate_odometry所在目录新建data文件夹、results文件夹及其它们的子文件夹,poses子文件夹里存放的是里程计的ground_truth,但是需要将官网下载的00.txt ~10.txt的名字修改为11.txt ~21.txt。result_sha下存放待评测数据和评测结果,文件夹名可以改,但要和下面运行evaluate_odometry时提供的参数保持一致。resultes/result_sha/data下存放的是待评测里程计数据,命名也是11.txt ~21.txt,对应于00-10序列。评测程序是for循环从11.txt依次开始评测的,如果你缺少11.txt,后面的都不会评测。但如果缺少后面的,前面的是可以正常评测的。当然你可以修改程序里的for循环,控制从哪个序列开始评测。
-
运行 evaluate_odometry,其支持单参数或者三参数,result_sha是你想存放评测结果的文件夹,该文件夹下将存放评测结果。后面两个参数是你kitti注册的用户名和邮箱,似乎和网上评测有关(打榜)。我暂时只试了本地评测,所以在此只关注单参数的方式。
Usage: ./evaluate_odometry result_sha [user_sha email]
例如运行如下的命令行,得到下面的文件组织,其中errors、plot_error和plot_path为评测结果文件夹。
./evaluate_odometry result_sha
一些问题
- 跑自己里程计的时候最好使用仿真时间,即use_sim_time设置为true,并且播放bag时带上–clock和-k。我跑的时候里程计结果总会少一行,可能就是这个造成的(之后测试发现是由于播放bag前的时间延迟太短,也就是"Waiting 0.2 seconds after advertising topics… done"中的0.2太短了,可以通过添加参数-d将延迟时间调长)。
- 自己跑的里程计.txt里的行数必须和ground_truth中的一样。
- 11.txt ~21.txt中的数据组织是每行代表一个时刻的位姿,由3×4的变换矩阵按行reshape成1×12。
- ground_truth是左相机的,如果是激光里程计需要转换,转换外参在calibration_files文件夹中。
Reference
https://stackoverflow.com/questions/57036291/how-to-evaluate-the-results-in-the-kitti-odometry-dataset ↩︎