Ubuntu16.04搭建和运行DSO

简介: Ubuntu16.04搭建和运行DSO

DSO的GitHub链接:https://github.com/JakobEngel/dso


本博客基于VMware搭建的Ubuntu16.04实现DSO


1. 克隆DSO


sudo apt install git


git clone https://github.com/JakobEngel/dso.git


2. 搭配环境


eigen3


sudo apt install libsuitesparse-dev libeigen3-dev libboost-all-dev


opencv


sudo apt install libopencv-dev


Pangolin


github:https://github.com/stevenlovegrove/Pangolin


  1. 克隆


git clone https://github.com/stevenlovegrove/Pangolin.git


  1. 安装Pangolin需要的依赖项:


tar -zxvf Pangolin.tar.gz


  1. 编译和安装Pangolin


cd [path-to-pangolin]
mkdir build
cd build
cmake ..
make
sudo make install


ziplib


sudo apt-get install zlib1g-dev
cd dso/thirdparty
tar -zxvf libzip-1.1.1.tar.gz
cd libzip-1.1.1/
./configure
make
sudo make install
sudo cp lib/zipconf.h /usr/local/include/zipconf.h   # (no idea why that is needed).


3. 编译DSO


cd dso
  mkdir build
  cd build
  cmake ..
  make -j4


4. make可能出现的错误


错误一


virtual memory exhausted: 无法分配内存
CMakeFiles/dso.dir/build.make:62: recipe for target 'CMakeFiles/dso.dir/src/FullSystem/FullSystem.cpp.o' failed
make[2]: *** [CMakeFiles/dso.dir/src/FullSystem/FullSystem.cpp.o] Error 1
make[2]: *** 正在等待未完成的任务....
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/dso.dir/all' failed
make[1]: *** [CMakeFiles/dso.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2


解决方法:


将make -j4该低点 ,改成make -j2


错误二


[ 96%] Linking CXX executable bin/dso_dataset
/usr/bin/ld: CMakeFiles/dso_dataset.dir/src/main_dso_pangolin.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/dso_dataset.dir/build.make:129: recipe for target 'bin/dso_dataset' failed
make[2]: *** [bin/dso_dataset] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/dso_dataset.dir/all' failed
make[1]: *** [CMakeFiles/dso_dataset.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2


解决方法:


参考博客:https://blog.csdn.net/qq_17232031/article/details/79540286


修改CMakeLists.txt有关于Thread,首先在CMakeLists.txt中添加一条:


FIND_PACKAGE(Threads QUIET)


然后将:


if (OpenCV_FOUND AND Pangolin_FOUND)
    message("--- compiling dso_dataset.")
    add_executable(dso_dataset ${PROJECT_SOURCE_DIR}/src/main_dso_pangolin.cpp )
   target_link_libraries(dso_dataset dso boost_system boost_thread cxsparse ${LIBZIP_LIBRARY} ${Pangolin_LIBRARIES} ${OpenCV_LIBS} )
else()
    message("--- not building dso_dataset, since either don't have openCV or Pangolin.")
endif()


改为:


if (OpenCV_FOUND AND Pangolin_FOUND)
    message("--- compiling dso_dataset.")
    add_executable(dso_dataset ${PROJECT_SOURCE_DIR}/src/main_dso_pangolin.cpp )
    target_link_libraries(dso_dataset dso boost_system boost_thread cxsparse ${LIBZIP_LIBRARY} ${Pangolin_LIBRARIES} ${OpenCV_LIBS} ${CMAKE_THREAD_LIBS_INIT})
else()
    message("--- not building dso_dataset, since either don't have openCV or Pangolin.")
endif()


然后重新编译:


cmake ..
make -j2


5. 运行数据集


数据来源:https://vision.in.tum.de/data/datasets/mono-dataset?redirect=1


输入以下内容;但是导致了报错



原因:没有解压


所以我们先加压一下;解压suquence_14和里面的images,并删除压缩文件


输入:


./dso_dataset files=./sequence_14/images calib=./sequence_14/camera.txt gamma=./sequence_14/pcalib.txt vignette=./sequence_14/vignette.png preset=0 mode=0


又报了以下错误:



原因:Pangolin没有装好;重新安装Pangolin;参考


https://blog.csdn.net/qq_39236499/article/details/122722038里面的Pangolin报错解决方法,两个是一模一样的错误


再次输入上面指令!成功!!!



参考博客


https://blog.csdn.net/qq_17232031/article/details/79540286


https://blog.csdn.net/qq_37568167/article/details/106384458


https://blog.csdn.net/qq_39236499/article/details/109010081


https://blog.csdn.net/weixin_40941966/article/details/107408299


目录
相关文章
|
Web App开发 存储 Linux
Linux(33)Rockchip RK3568 Ubuntu22.04上通过SSH运行Qt程序和关闭Chrome的密钥提示
Linux(33)Rockchip RK3568 Ubuntu22.04上通过SSH运行Qt程序和关闭Chrome的密钥提示
2307 0
|
Ubuntu Linux
Win10 Ubuntu子系统(内嵌ubuntu18.04)运行32bit Linux原生程序 解决Exec format error错误
Win10 Ubuntu子系统(内嵌ubuntu18.04)运行32bit Linux原生程序 解决Exec format error错误
639 0
|
存储 Ubuntu 自动驾驶
运行Udacity的MPC控制项目指南(project_10)在Ubuntu 18.04环境下
以上步骤应该能够帮助您成功设置并运行Udacity MPC控制项目,在此过程中您将学习如何应用模型预测控制理论去指导车辆沿着轨迹自主驾驶,在模拟环境下测试其效果。这个过程不但涵盖了理论知识也有实践操作,对于学习自动驾驶车辆控制系统非常有帮助。
456 15
|
Ubuntu 定位技术 TensorFlow
源码编译安装ROCm以运行tensorflow-rocm(适用于Ubuntu 23.04)
总结一番,完成这趟奇妙的技术之旅后,乐趣多多,还能享受 tensorflow-rocm 带来的便利和速度。这趟旅程需要耐心,勇气,以及对技术的热爱。朋友,做好准备,让你的Ubuntu系统展翅高飞吧!
852 9
|
Ubuntu 安全
Ubuntu中遇到"无法创建临时文件"/tmp/..."在普通或root用户运行apt-get update时的错误解决办法
这些步骤当然不能涵盖所有可能出现问题的场合,但是能覆盖大多数常见的情景。希望这些信息能帮到你解决"无法创建临时文件"/tmp/..."这样的问题。不过,请记住,因为修改系统文件和目录的权限,清理临时文件,或者运行磁盘检查,都可能对系统造成影响,所以执行这些操作前要先确认这是安全的,必要时最好先做好数据备份。
1160 10
|
监控 Ubuntu Linux
ubuntu中设置开机自动运行的(sudo)指令
通过合理选择和配置上述方法,您可以确保在系统启动时自动执行所需的命令,并具备sudo权限,从而提高系统自动化管理的能力。
2881 8
|
监控 Ubuntu Java
如何在Ubuntu上运行Jar包?
【7月更文挑战第9天】
1834 0
如何在Ubuntu上运行Jar包?
|
Ubuntu 关系型数据库 MySQL
ubuntu apt 安装wordpress所需所有的 一键脚本 扩展您的PHP似乎没有安装运行WordPress所必需的MySQL扩展。
ubuntu apt 安装wordpress所需所有的 一键脚本 扩展您的PHP似乎没有安装运行WordPress所必需的MySQL扩展。
454 0
ubuntu apt 安装wordpress所需所有的 一键脚本 扩展您的PHP似乎没有安装运行WordPress所必需的MySQL扩展。
|
NoSQL Ubuntu Oracle
在Ubuntu 14.04上安装Cassandra并运行单节点集群的方法
在Ubuntu 14.04上安装Cassandra并运行单节点集群的方法
433 0
|
NoSQL Ubuntu Oracle
如何在 Ubuntu VPS 上安装 Cassandra 并运行单节点集群
如何在 Ubuntu VPS 上安装 Cassandra 并运行单节点集群
315 0