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

相关文章

Python安装时常见报错以及解决方案

《Python安装时常见报错以及解决方案》:本文主要介绍在安装Python、配置环境变量、使用pip以及运行Python脚本时常见的错误及其解决方案,文中介绍的非常详细,需要的朋友可以参考下... 目录一、安装 python 时常见报错及解决方案(一)安装包下载失败(二)权限不足二、配置环境变量时常见报错及

在不同系统间迁移Python程序的方法与教程

《在不同系统间迁移Python程序的方法与教程》本文介绍了几种将Windows上编写的Python程序迁移到Linux服务器上的方法,包括使用虚拟环境和依赖冻结、容器化技术(如Docker)、使用An... 目录使用虚拟环境和依赖冻结1. 创建虚拟环境2. 冻结依赖使用容器化技术(如 docker)1. 创

MySQL8.2.0安装教程分享

《MySQL8.2.0安装教程分享》这篇文章详细介绍了如何在Windows系统上安装MySQL数据库软件,包括下载、安装、配置和设置环境变量的步骤... 目录mysql的安装图文1.python访问网址2javascript.点击3.进入Downloads向下滑动4.选择Community Server5.

CentOS系统Maven安装教程分享

《CentOS系统Maven安装教程分享》本文介绍了如何在CentOS系统中安装Maven,并提供了一个简单的实际应用案例,安装Maven需要先安装Java和设置环境变量,Maven可以自动管理项目的... 目录准备工作下载并安装Maven常见问题及解决方法实际应用案例总结Maven是一个流行的项目管理工具

MySql9.1.0安装详细教程(最新推荐)

《MySql9.1.0安装详细教程(最新推荐)》MySQL是一个流行的关系型数据库管理系统,支持多线程和多种数据库连接途径,能够处理上千万条记录的大型数据库,本文介绍MySql9.1.0安装详细教程,... 目录mysql介绍:一、下载 Mysql 安装文件二、Mysql 安装教程三、环境配置1.右击此电脑

在 Windows 上安装 DeepSeek 的完整指南(最新推荐)

《在Windows上安装DeepSeek的完整指南(最新推荐)》在Windows上安装DeepSeek的完整指南,包括下载和安装Ollama、下载DeepSeekRXNUMX模型、运行Deep... 目录在www.chinasem.cn Windows 上安装 DeepSeek 的完整指南步骤 1:下载并安装

C#实现系统信息监控与获取功能

《C#实现系统信息监控与获取功能》在C#开发的众多应用场景中,获取系统信息以及监控用户操作有着广泛的用途,比如在系统性能优化工具中,需要实时读取CPU、GPU资源信息,本文将详细介绍如何使用C#来实现... 目录前言一、C# 监控键盘1. 原理与实现思路2. 代码实现二、读取 CPU、GPU 资源信息1.

python管理工具之conda安装部署及使用详解

《python管理工具之conda安装部署及使用详解》这篇文章详细介绍了如何安装和使用conda来管理Python环境,它涵盖了从安装部署、镜像源配置到具体的conda使用方法,包括创建、激活、安装包... 目录pytpshheraerUhon管理工具:conda部署+使用一、安装部署1、 下载2、 安装3

在C#中获取端口号与系统信息的高效实践

《在C#中获取端口号与系统信息的高效实践》在现代软件开发中,尤其是系统管理、运维、监控和性能优化等场景中,了解计算机硬件和网络的状态至关重要,C#作为一种广泛应用的编程语言,提供了丰富的API来帮助开... 目录引言1. 获取端口号信息1.1 获取活动的 TCP 和 UDP 连接说明:应用场景:2. 获取硬

JAVA系统中Spring Boot应用程序的配置文件application.yml使用详解

《JAVA系统中SpringBoot应用程序的配置文件application.yml使用详解》:本文主要介绍JAVA系统中SpringBoot应用程序的配置文件application.yml的... 目录文件路径文件内容解释1. Server 配置2. Spring 配置3. Logging 配置4. Ma