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

相关文章

JWT + 拦截器实现无状态登录系统

《JWT+拦截器实现无状态登录系统》JWT(JSONWebToken)提供了一种无状态的解决方案:用户登录后,服务器返回一个Token,后续请求携带该Token即可完成身份验证,无需服务器存储会话... 目录✅ 引言 一、JWT 是什么? 二、技术选型 三、项目结构 四、核心代码实现4.1 添加依赖(pom

RabbitMQ 延时队列插件安装与使用示例详解(基于 Delayed Message Plugin)

《RabbitMQ延时队列插件安装与使用示例详解(基于DelayedMessagePlugin)》本文详解RabbitMQ通过安装rabbitmq_delayed_message_exchan... 目录 一、什么是 RabbitMQ 延时队列? 二、安装前准备✅ RabbitMQ 环境要求 三、安装延时队

基于Python实现自动化邮件发送系统的完整指南

《基于Python实现自动化邮件发送系统的完整指南》在现代软件开发和自动化流程中,邮件通知是一个常见且实用的功能,无论是用于发送报告、告警信息还是用户提醒,通过Python实现自动化的邮件发送功能都能... 目录一、前言:二、项目概述三、配置文件 `.env` 解析四、代码结构解析1. 导入模块2. 加载环

linux系统上安装JDK8全过程

《linux系统上安装JDK8全过程》文章介绍安装JDK的必要性及Linux下JDK8的安装步骤,包括卸载旧版本、下载解压、配置环境变量等,强调开发需JDK,运行可选JRE,现JDK已集成JRE... 目录为什么要安装jdk?1.查看linux系统是否有自带的jdk:2.下载jdk压缩包2.解压3.配置环境

Python库 Django 的简介、安装、用法入门教程

《Python库Django的简介、安装、用法入门教程》Django是Python最流行的Web框架之一,它帮助开发者快速、高效地构建功能强大的Web应用程序,接下来我们将从简介、安装到用法详解,... 目录一、Django 简介 二、Django 的安装教程 1. 创建虚拟环境2. 安装Django三、创

linux安装、更新、卸载anaconda实践

《linux安装、更新、卸载anaconda实践》Anaconda是基于conda的科学计算环境,集成1400+包及依赖,安装需下载脚本、接受协议、设置路径、配置环境变量,更新与卸载通过conda命令... 目录随意找一个目录下载安装脚本检查许可证协议,ENTER就可以安装完毕之后激活anaconda安装更

Jenkins的安装与简单配置过程

《Jenkins的安装与简单配置过程》本文简述Jenkins在CentOS7.3上安装流程,包括Java环境配置、RPM包安装、修改JENKINS_HOME路径及权限、启动服务、插件安装与系统管理设置... 目录www.chinasem.cnJenkins安装访问并配置JenkinsJenkins配置邮件通知

Linux查询服务器系统版本号的多种方法

《Linux查询服务器系统版本号的多种方法》在Linux系统管理和维护工作中,了解当前操作系统的版本信息是最基础也是最重要的操作之一,系统版本不仅关系到软件兼容性、安全更新策略,还直接影响到故障排查和... 目录一、引言:系统版本查询的重要性二、基础命令解析:cat /etc/Centos-release详

更改linux系统的默认Python版本方式

《更改linux系统的默认Python版本方式》通过删除原Python软链接并创建指向python3.6的新链接,可切换系统默认Python版本,需注意版本冲突、环境混乱及维护问题,建议使用pyenv... 目录更改系统的默认python版本软链接软链接的特点创建软链接的命令使用场景注意事项总结更改系统的默

在Linux系统上连接GitHub的方法步骤(适用2025年)

《在Linux系统上连接GitHub的方法步骤(适用2025年)》在2025年,使用Linux系统连接GitHub的推荐方式是通过SSH(SecureShell)协议进行身份验证,这种方式不仅安全,还... 目录步骤一:检查并安装 Git步骤二:生成 SSH 密钥步骤三:将 SSH 公钥添加到 github