Ubuntu18.04配置ORB-SLAM2过程中的问题
Posted Haijian
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu18.04配置ORB-SLAM2过程中的问题相关的知识,希望对你有一定的参考价值。
https://www.imooc.com/article/details/id/29136
1. 提示“CMAKE_CXX_COMPILER-NOTFOUND ”
具体形式:
Check for working CXX compiler: CMAKE_CXX_COMPILER-NOTFOUND
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.
Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
解决方法:
sudo apt-get install g++
2. 在ubuntu18.04系统上安装opencv但是在安装依赖包的过程中,有一个依赖包,libjasper-dev在使用命令
sudo apt-get install libjaster-dev
提示:无法定位软件包 libjasper-dev
后来google到解决办法,复制到这里
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
sudo apt install libjasper1 libjasper-dev
成功的解决了问题,其中libjasper1是libjasper-dev的依赖包
3. 注意eigen 本人亲测Eigen3.2.10
wget https://bitbucket.org/eigen/eigen/get/3.2.10.tar.bz2 tar -xjf 3.2.10.tar.bz2
改文件夹名字
cd eigen mkdir build cd build cmake .. make sudo make install
4. ImportError: No module named catkin_pkg.package
注意Python版本 ros-melodic对应Python3
5. 编译安装python3.7时
提示“ModuleNotFoundError: No module named ‘_ctypes‘”
解决办法
sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus sudo apt-get install build-essential libncursesw5-dev libgdbm-dev libc6-dev sudo apt-get install zlib1g-dev libsqlite3-dev tk-dev sudo apt-get install libssl-dev openssl sudo apt-get install libffi-dev
安装完libffi后在编译安装就不报错了
6. 编译./build_ros.sh
提示[rosbuild] rospack found package "ORB_SLAM2" at "", but the current directory is "/home/angelo/ORB_SLAM2/Examples/ROS/ORB_SLAM2". You should double-check your ROS_PACKAGE_PATH to ensure that packages are found in the correct precedence order.
解决办法:输入
sudo ln -s ~/ORB_SLAM2/Examples/ROS/ORB_SLAM2 /opt/ros/<ros版本名>/share/ORB_SLAM2
7. 编译遇到找不到#include<Eigen/Dense>
解决办法:进入usr/local/include/eigen3将eigen3中的Eigen文件递归地复制到上一层文件夹(直接放到include):因为在很多程序中include时经常使用#include <Eigen/Dense>而不是使用的#include <eigen3/Eigen/Dense>所以要做下处理,否则一些程序在编译时会因找不到Eigen/Dense而报错。
8. 编译遇到libboost_system.so: 无法添加符号: DSO missing from command line
解决办法:在Examples/ROS/ORB_SLAM2/Cmakelist.txt 的文件后面加入两句话:
target_link_libraries(Stereo boost_system boost_filesystem) target_link_libraries(RGBD boost_system boost_filesystem)
以上是关于Ubuntu18.04配置ORB-SLAM2过程中的问题的主要内容,如果未能解决你的问题,请参考以下文章