python2 安装evo 与 评价MSKCF 等slam系统

2024-01-10 03:18

本文主要是介绍python2 安装evo 与 评价MSKCF 等slam系统,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

参考https://blog.csdn.net/weixin_44386661/article/details/103080551

https://blog.csdn.net/zhiwei121/article/details/105013678

这里用源码安装

#
git clone https://github.com/MichaelGrupp/evo.git
cd evo
# 安装在系统的python2 使用清华源 并开启usr
#可以尝试安装在python3pip install --editable . --upgrade --no-binary evo -i https://pypi.tuna.tsinghua.edu.cn/simple  --user#出现问题
#更新numpy 和matplotlib的版本
pip install numpy --upgrade --user
pip install matplotlib --upgrade --user
#如果更新不了 发现加上清华源即可
pip install numpy --upgrade --user  -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install matplotlib --upgrade --user  -i https://pypi.tuna.tsinghua.edu.cn/simple

再次在python2.7装,找不到evo_traj,pip uninstall evo了,以下信息 :

装在了 ./local ??? 什么情况

solved 2020.12.21

首先git所有的内容,采用编译安装的方法

git clone https://github.com/MichaelGrupp/evo.git
cd evo

现在evo又更新了,支持python3.6+,还是习惯用python2.7, 切到这个分支tag https://github.com/MichaelGrupp/evo/tree/v1.12.0

git checkout v1.12.0

安装就完了,pip对应python2, pip3默认对应pthon3

pip install --editable . --upgrade --no-binary evoWARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
Obtaining file:///home/lin/My_lib/evo
Requirement already satisfied, skipping upgrade: numpy in /home/lin/.local/lib/python2.7/site-packages (from evo==1.12.0) (1.16.6)
Requirement already satisfied, skipping upgrade: matplotlib in /home/lin/.local/lib/python2.7/site-packages (from evo==1.12.0) (2.2.5)
Requirement already satisfied, skipping upgrade: scipy>=1.2 in /home/lin/.local/lib/python2.7/site-packages (from evo==1.12.0) (1.2.3)
Requirement already satisfied, skipping upgrade: pandas in /home/lin/.local/lib/python2.7/site-packages (from evo==1.12.0) (0.24.2)
Requirement already satisfied, skipping upgrade: seaborn>=0.9 in /home/lin/.local/lib/python2.7/site-packages (from evo==1.12.0) (0.9.1)
Requirement already satisfied, skipping upgrade: natsort in /home/lin/.local/lib/python2.7/site-packages (from evo==1.12.0) (6.2.1)
Requirement already satisfied, skipping upgrade: argcomplete in /home/lin/.local/lib/python2.7/site-packages (from evo==1.12.0) (1.12.2)
Requirement already satisfied, skipping upgrade: colorama>=0.3 in /home/lin/.local/lib/python2.7/site-packages (from evo==1.12.0) (0.4.4)
Requirement already satisfied, skipping upgrade: pygments in /usr/lib/python2.7/dist-packages (from evo==1.12.0) (2.1)
Requirement already satisfied, skipping upgrade: pyyaml in /usr/lib/python2.7/dist-packages (from evo==1.12.0) (3.11)
Requirement already satisfied, skipping upgrade: pillow in /usr/lib/python2.7/dist-packages (from evo==1.12.0) (3.1.2)
Requirement already satisfied, skipping upgrade: enum34 in /usr/lib/python2.7/dist-packages (from evo==1.12.0) (1.1.2)
Requirement already satisfied, skipping upgrade: python-dateutil>=2.1 in /home/lin/.local/lib/python2.7/site-packages (from matplotlib->evo==1.12.0) (2.8.1)
Requirement already satisfied, skipping upgrade: backports.functools-lru-cache in /home/lin/.local/lib/python2.7/site-packages (from matplotlib->evo==1.12.0) (1.6.1)
Requirement already satisfied, skipping upgrade: six>=1.10 in /usr/lib/python2.7/dist-packages (from matplotlib->evo==1.12.0) (1.10.0)
Requirement already satisfied, skipping upgrade: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/lib/python2.7/dist-packages (from matplotlib->evo==1.12.0) (2.0.3)
Requirement already satisfied, skipping upgrade: cycler>=0.10 in /home/lin/.local/lib/python2.7/site-packages (from matplotlib->evo==1.12.0) (0.10.0)
Requirement already satisfied, skipping upgrade: kiwisolver>=1.0.1 in /home/lin/.local/lib/python2.7/site-packages (from matplotlib->evo==1.12.0) (1.1.0)
Requirement already satisfied, skipping upgrade: pytz in /usr/lib/python2.7/dist-packages (from matplotlib->evo==1.12.0) (2014.10)
Requirement already satisfied, skipping upgrade: subprocess32 in /home/lin/.local/lib/python2.7/site-packages (from matplotlib->evo==1.12.0) (3.5.4)
Requirement already satisfied, skipping upgrade: importlib-metadata<4,>=0.23; python_version == "2.7" in /home/lin/.local/lib/python2.7/site-packages (from argcomplete->evo==1.12.0) (2.1.1)
Requirement already satisfied, skipping upgrade: setuptools in /usr/lib/python2.7/dist-packages (from kiwisolver>=1.0.1->matplotlib->evo==1.12.0) (20.7.0)
Requirement already satisfied, skipping upgrade: contextlib2; python_version < "3" in /home/lin/.local/lib/python2.7/site-packages (from importlib-metadata<4,>=0.23; python_version == "2.7"->argcomplete->evo==1.12.0) (0.6.0.post1)
Requirement already satisfied, skipping upgrade: pathlib2; python_version < "3" in /home/lin/.local/lib/python2.7/site-packages (from importlib-metadata<4,>=0.23; python_version == "2.7"->argcomplete->evo==1.12.0) (2.3.5)
Requirement already satisfied, skipping upgrade: zipp>=0.5 in /home/lin/.local/lib/python2.7/site-packages (from importlib-metadata<4,>=0.23; python_version == "2.7"->argcomplete->evo==1.12.0) (1.2.0)
Requirement already satisfied, skipping upgrade: configparser>=3.5; python_version < "3" in /home/lin/.local/lib/python2.7/site-packages (from importlib-metadata<4,>=0.23; python_version == "2.7"->argcomplete->evo==1.12.0) (4.0.2)
Requirement already satisfied, skipping upgrade: scandir; python_version < "3.5" in /home/lin/.local/lib/python2.7/site-packages (from pathlib2; python_version < "3"->importlib-metadata<4,>=0.23; python_version == "2.7"->argcomplete->evo==1.12.0) (1.10.0)
Installing collected packages: evoRunning setup.py develop for evo
Successfully installed evo####### sopip uninstall evo
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Found existing installation: evo 1.12.0
Uninstalling evo-1.12.0:Would remove:/home/lin/.local/lib/python2.7/site-packages/evo.egg-link
Proceed (y/n)? ySuccessfully uninstalled evo-1.12.0

这样装完,发现上面的问题  安在了/.local,这本来也是python的习惯,但是导致 evo的evo_ape等等命令找不到

于是 用sudo ,evo可以被tab了

sudo pip install --editable . --upgrade --no-binary evo
[sudo] lin 的密码: WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
WARNING: The directory '/home/lin/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.Obtaining file:///home/lin/My_lib/evo
Requirement already satisfied, skipping upgrade: numpy in /home/lin/.local/lib/python2.7/site-packages (from evo==1.12.0) (1.16.6)
Requirement already satisfied, skipping upgrade: matplotlib in /home/lin/.local/lib/python2.7/site-packages (from evo==1.12.0) (2.2.5)
Requirement already satisfied, skipping upgrade: scipy>=1.2 in /home/lin/.local/lib/python2.7/site-packages (from evo==1.12.0) (1.2.3)
Requirement already satisfied, skipping upgrade: pandas in /home/lin/.local/lib/python2.7/site-packages (from evo==1.12.0) (0.24.2)
Requirement already satisfied, skipping upgrade: seaborn>=0.9 in /home/lin/.local/lib/python2.7/site-packages (from evo==1.12.0) (0.9.1)
Requirement already satisfied, skipping upgrade: natsort in /home/lin/.local/lib/python2.7/site-packages (from evo==1.12.0) (6.2.1)
Requirement already satisfied, skipping upgrade: argcomplete in /home/lin/.local/lib/python2.7/site-packages (from evo==1.12.0) (1.12.2)
Requirement already satisfied, skipping upgrade: colorama>=0.3 in /home/lin/.local/lib/python2.7/site-packages (from evo==1.12.0) (0.4.4)
Requirement already satisfied, skipping upgrade: pygments in /usr/lib/python2.7/dist-packages (from evo==1.12.0) (2.1)
Requirement already satisfied, skipping upgrade: pyyaml in /usr/lib/python2.7/dist-packages (from evo==1.12.0) (3.11)
Requirement already satisfied, skipping upgrade: pillow in /usr/lib/python2.7/dist-packages (from evo==1.12.0) (3.1.2)
Requirement already satisfied, skipping upgrade: enum34 in /usr/lib/python2.7/dist-packages (from evo==1.12.0) (1.1.2)
Requirement already satisfied, skipping upgrade: python-dateutil>=2.1 in /home/lin/.local/lib/python2.7/site-packages (from matplotlib->evo==1.12.0) (2.8.1)
Requirement already satisfied, skipping upgrade: backports.functools-lru-cache in /home/lin/.local/lib/python2.7/site-packages (from matplotlib->evo==1.12.0) (1.6.1)
Requirement already satisfied, skipping upgrade: six>=1.10 in /usr/lib/python2.7/dist-packages (from matplotlib->evo==1.12.0) (1.10.0)
Requirement already satisfied, skipping upgrade: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/lib/python2.7/dist-packages (from matplotlib->evo==1.12.0) (2.0.3)
Requirement already satisfied, skipping upgrade: cycler>=0.10 in /home/lin/.local/lib/python2.7/site-packages (from matplotlib->evo==1.12.0) (0.10.0)
Requirement already satisfied, skipping upgrade: kiwisolver>=1.0.1 in /home/lin/.local/lib/python2.7/site-packages (from matplotlib->evo==1.12.0) (1.1.0)
Requirement already satisfied, skipping upgrade: pytz in /usr/lib/python2.7/dist-packages (from matplotlib->evo==1.12.0) (2014.10)
Requirement already satisfied, skipping upgrade: subprocess32 in /home/lin/.local/lib/python2.7/site-packages (from matplotlib->evo==1.12.0) (3.5.4)
Requirement already satisfied, skipping upgrade: importlib-metadata<4,>=0.23; python_version == "2.7" in /home/lin/.local/lib/python2.7/site-packages (from argcomplete->evo==1.12.0) (2.1.1)
Requirement already satisfied, skipping upgrade: setuptools in /usr/lib/python2.7/dist-packages (from kiwisolver>=1.0.1->matplotlib->evo==1.12.0) (20.7.0)
Requirement already satisfied, skipping upgrade: contextlib2; python_version < "3" in /home/lin/.local/lib/python2.7/site-packages (from importlib-metadata<4,>=0.23; python_version == "2.7"->argcomplete->evo==1.12.0) (0.6.0.post1)
Requirement already satisfied, skipping upgrade: pathlib2; python_version < "3" in /home/lin/.local/lib/python2.7/site-packages (from importlib-metadata<4,>=0.23; python_version == "2.7"->argcomplete->evo==1.12.0) (2.3.5)
Requirement already satisfied, skipping upgrade: zipp>=0.5 in /home/lin/.local/lib/python2.7/site-packages (from importlib-metadata<4,>=0.23; python_version == "2.7"->argcomplete->evo==1.12.0) (1.2.0)
Requirement already satisfied, skipping upgrade: configparser>=3.5; python_version < "3" in /home/lin/.local/lib/python2.7/site-packages (from importlib-metadata<4,>=0.23; python_version == "2.7"->argcomplete->evo==1.12.0) (4.0.2)
Requirement already satisfied, skipping upgrade: scandir; python_version < "3.5" in /home/lin/.local/lib/python2.7/site-packages (from pathlib2; python_version < "3"->importlib-metadata<4,>=0.23; python_version == "2.7"->argcomplete->evo==1.12.0) (1.10.0)
Installing collected packages: evoRunning setup.py develop for evo
Successfully installed evo######################pip uninstall evoWARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Found existing installation: evo 1.12.0
Uninstalling evo-1.12.0:Would remove:/usr/local/lib/python2.7/dist-packages/evo.egg-link
Proceed (y/n)? ^CERROR: Operation cancelled by user

 

 

修改mskcf 保存轨迹

参考 https://github.com/symao/msckf_vio/blob/evaluation/src/msckf_vio.cpp

https://github.com/symao/vio_evaluation

修改msckf源码,用tum格式(为了便于用evo 进行euroc的评价)

在msckf_vio.cpp开头增加如下

#在头文件增加
#include <thread>  #在这一句map<int, double> MsckfVio::chi_squared_test_table; 大概50行之后增加:
#if 1
static const int p_max_cnt = 10000;
static const int p_cols = 8;
static double *p_log_data = new double[p_max_cnt * p_cols];
static int p_cnt = 0;
void mylog()
{FILE* fp = fopen("/home/lincent/s_msckf_ws/vio.txt","w");int k = 0;while(1){if(k < p_cnt){for(int i=0; i<p_cols; i++){if(i > 0) fprintf(fp, " ");fprintf(fp, "%f", p_log_data[p_cols * k + i]);}fprintf(fp, "\n");fflush(fp);k++;}else{usleep(100000);}}fclose(fp);
}
static std::thread th_log(mylog);
#endif

完成上述 大约在470行

if (processing_time > 1.0/frame_rate) { ...}   后增加:

#if 1const auto& s = state_server.imu_state;const auto& p = s.position;const auto& q = s.orientation;const auto& v = s.velocity;const auto& ba = s.acc_bias;const auto& bg = s.gyro_bias;double *lp = p_log_data + p_cnt * p_cols;lp[0] = s.time;lp[1] = p(0);lp[2] = p(1);lp[3] = p(2);lp[4] = q.w();lp[5] = q.x();lp[6] = q.y();lp[7] = q.z();//lp[8] = v(0);//lp[9] = v(1);//lp[10] = v(2);//lp[11] = ba(0);//lp[12] = ba(1);//lp[13] = ba(2);//lp[14] = bg(0);//lp[15] = bg(1);//lp[16] = bg(2);//lp[17] = processing_time;p_cnt++;
#endif

重新编译msckf,运行得到结果vio.txt

#!!!注意:这里一定要用release进行make,不然运行会出现大问题
catkin_make --pkg msckf_vio --cmake-args -DCMAKE_BUILD_TYPE=Release
source devel/setup.bash
#运行,结束得到 位姿txt
roslaunch msckf_vio msckf_vio_euroc.launch
rosbag play ~/dataset/Euroc/MH_04_difficult.bag 

evo评价步骤

#先把euroc的真值转换为tum
evo_traj euroc ~/dataset/Euroc/MH_04_difficult/state_groundtruth_estimate0/data.csv --save_as_tum#输出轨迹、ape、rpe, p表示plot, va进行轨迹对齐
evo_traj tum ours.txt --ref ground\ truth.tum -p -va
evo_ape tum ground\ truth.tum ours.txt -p -va
evo_rpe tum ground\ truth.tum ours.txt -p -va

参考:

官方文档 https://github.com/MichaelGrupp/evo/wiki/evo_traj

APE、RPE的计算:

EVO使用方法详解 https://blog.csdn.net/dcq1609931832/article/details/102465071

https://blog.csdn.net/weixin_41969600/article/details/89891610

https://zhuanlan.zhihu.com/p/88223106

使用 evo 工具评测 VI ORB SLAM2 在 EuRoC 上的结果
http://www.liuxiao.org/2017/11/%E4%BD%BF%E7%94%A8-evo-%E5%B7%A5%E5%85%B7%E8%AF%84%E6%B5%8B-vi-orb-slam2-%E5%9C%A8-euroc-%E4%B8%8A%E7%9A%84%E7%BB%93%E6%9E%9C/

vins-mono保存、重载地图、evo工具测试

https://blog.csdn.net/Hanghang_/article/details/104535370#evo_84

另外,评价TUM数据集的另外两个评价工具:evaluate_ate.py evaluate_rpe.py
参考 https://blog.csdn.net/Darlingqiang/article/details/89059466

RGB-D SLAM系统评估的基准---TUM https://blog.csdn.net/weixin_36662031/article/details/83088781

视觉SLAM基础:算法精度评价指标(ATE、RPE)https://zhuanlan.zhihu.com/p/105428199

各数据集的格式: https://blog.csdn.net/Darlingqiang/article/details/102631102

KITTI评价说明

 

解决pip下载速度慢的问题

https://blog.csdn.net/wolflikeinnocence/article/details/80140064

C++多线程(一)thread类

https://blog.csdn.net/coolwriter/article/details/79883253

这篇关于python2 安装evo 与 评价MSKCF 等slam系统的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/589376

相关文章

Mac系统下卸载JAVA和JDK的步骤

《Mac系统下卸载JAVA和JDK的步骤》JDK是Java语言的软件开发工具包,它提供了开发和运行Java应用程序所需的工具、库和资源,:本文主要介绍Mac系统下卸载JAVA和JDK的相关资料,需... 目录1. 卸载系统自带的 Java 版本检查当前 Java 版本通过命令卸载系统 Java2. 卸载自定

gitlab安装及邮箱配置和常用使用方式

《gitlab安装及邮箱配置和常用使用方式》:本文主要介绍gitlab安装及邮箱配置和常用使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1.安装GitLab2.配置GitLab邮件服务3.GitLab的账号注册邮箱验证及其分组4.gitlab分支和标签的

MySQL MCP 服务器安装配置最佳实践

《MySQLMCP服务器安装配置最佳实践》本文介绍MySQLMCP服务器的安装配置方法,本文结合实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下... 目录mysql MCP 服务器安装配置指南简介功能特点安装方法数据库配置使用MCP Inspector进行调试开发指

在Windows上使用qemu安装ubuntu24.04服务器的详细指南

《在Windows上使用qemu安装ubuntu24.04服务器的详细指南》本文介绍了在Windows上使用QEMU安装Ubuntu24.04的全流程:安装QEMU、准备ISO镜像、创建虚拟磁盘、配置... 目录1. 安装QEMU环境2. 准备Ubuntu 24.04镜像3. 启动QEMU安装Ubuntu4

Python UV安装、升级、卸载详细步骤记录

《PythonUV安装、升级、卸载详细步骤记录》:本文主要介绍PythonUV安装、升级、卸载的详细步骤,uv是Astral推出的下一代Python包与项目管理器,主打单一可执行文件、极致性能... 目录安装检查升级设置自动补全卸载UV 命令总结 官方文档详见:https://docs.astral.sh/

Nexus安装和启动的实现教程

《Nexus安装和启动的实现教程》:本文主要介绍Nexus安装和启动的实现教程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、Nexus下载二、Nexus安装和启动三、关闭Nexus总结一、Nexus下载官方下载链接:DownloadWindows系统根

Java SWT库详解与安装指南(最新推荐)

《JavaSWT库详解与安装指南(最新推荐)》:本文主要介绍JavaSWT库详解与安装指南,在本章中,我们介绍了如何下载、安装SWTJAR包,并详述了在Eclipse以及命令行环境中配置Java... 目录1. Java SWT类库概述2. SWT与AWT和Swing的区别2.1 历史背景与设计理念2.1.

基于Python实现一个简单的题库与在线考试系统

《基于Python实现一个简单的题库与在线考试系统》在当今信息化教育时代,在线学习与考试系统已成为教育技术领域的重要组成部分,本文就来介绍一下如何使用Python和PyQt5框架开发一个名为白泽题库系... 目录概述功能特点界面展示系统架构设计类结构图Excel题库填写格式模板题库题目填写格式表核心数据结构

Linux系统中的firewall-offline-cmd详解(收藏版)

《Linux系统中的firewall-offline-cmd详解(收藏版)》firewall-offline-cmd是firewalld的一个命令行工具,专门设计用于在没有运行firewalld服务的... 目录主要用途基本语法选项1. 状态管理2. 区域管理3. 服务管理4. 端口管理5. ICMP 阻断

安装centos8设置基础软件仓库时出错的解决方案

《安装centos8设置基础软件仓库时出错的解决方案》:本文主要介绍安装centos8设置基础软件仓库时出错的解决方案,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录安装Centos8设置基础软件仓库时出错版本 8版本 8.2.200android4版本 javas