Ubuntu配置ORB

Wesley13
• 阅读 1080

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.(1)在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的依赖包

(2)提示“ROS / OpenCV Ubuntu安装“usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: 没有那个文件或目录””

解决办法:

预编译的问题,在编译前加入命令屏蔽预编译就行了

-D ENABLE_PRECOMPILED_HEADERS=OFF

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)

9.安装Opencv的时候

提示

CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:85 (list):

list GET given empty list

Call Stack (most recent call first):

CMakeLists.txt:109 (include)

CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:86 (list):

list GET given empty list

Call Stack (most recent call first):

CMakeLists.txt:109 (include)

CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:89 (math):

math cannot parse the expression: "*100 + ": syntax error, unexpected

exp_TIMES, expecting exp_OPENPARENT or exp_NUMBER (1)

Call Stack (most recent call first):

CMakeLists.txt:109 (include)

解决办法:

在文件opencv/cmake/OpenCVDetectCXXCompiler.cmake中,将**“dumpversion”**改为**“dumpfullversion”**

10.编译ORB_SLAM2_ROS时

①提示以下错误:

/usr/bin/ld: CMakeFiles/Stereo.dir/src/ros_stereo.cc.o: undefined reference to symbol '_ZN5boost6system15system_categoryEv'
/usr/lib/x86_64-linux-gnu/libboost_system.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

解决方案:

将libboost_system.so与libboost_filesystem.so复制到ORB_SLAM2/lib下

locate  boost_system
locate boost_filesystem

并且将ORBSLAM2/Examples/ROS/ORBSLAM2下的Cmakelists.txt中加入库目录,具体为 

set(LIBS 
${OpenCV_LIBS} 
${EIGEN3_LIBS}
${Pangolin_LIBRARIES}
${PROJECT_SOURCE_DIR}/../../../Thirdparty/DBoW2/lib/libDBoW2.so
${PROJECT_SOURCE_DIR}/../../../Thirdparty/g2o/lib/libg2o.so
${PROJECT_SOURCE_DIR}/../../../lib/libORB_SLAM2.so
${PROJECT_SOURCE_DIR}/../../../lib/libboost_filesystem.so
${PROJECT_SOURCE_DIR}/../../../lib/libboost_system.so
)

 ②提示以下内容

[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.
Call Stack (most recent call first):
/opt/ros/kinetic/share/ros/core/rosbuild/public.cmake:177 (_rosbuild_check_package_location)
CMakeLists.txt:4 (rosbuild_init)

解决办法:

这通常是因为没有设置好 ORB_SLAM2 的环境变量或者前后设置存在冲突。请打开 ~/.bash.rc 文件,检查以下设置是否正确:

export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:PATH/ORB_SLAM2/Examples/ROS

 11.提示

error: static assertion failed: YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY

解决方法:

打开Thirdparty/g2o/g2o/solvers/linear_solver_eigen.h

typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, SparseMatrix::Index> PermutationMatrix;

改成

typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, int> PermutationMatrix;

 12.编译Build时,出现以下错误

../lib/libORB_SLAM2.so:对‘ORB_SLAM2::Frame::InitializeScaleLevels()’未定义的引用     collect2: error: ld returned 1 exit status     CMakeFiles/mono_kitti.dir/build.make:125: recipe for target '../Examples/Monocular/mono_kitti' failed

解决方法:将/ORB_SLAM2/src/Frame.cc中"inlier void Frame::InitializeScaleLeve " to " void Frame::InitializeScaleLevels()"

13.编译Build时,出现以下错误

error: ‘FAST’ was not declared in this scope
                 FAST(cellImage,cellKeyPoints[i][j],fastTh,true);
                                                               ^

解决方法:在src/ORBextractor.cc中添加

#include <opencv2/opencv.hpp>

14.遇到

Could not find a configuration file for package "OpenCV" that is compatible
with requested version "2.4.3".

解决办法:

将~/ORB_SLAM2/Examples/ROS/ORB_SLAM2中CMakeLists.txt的

find_package(OpenCV 2.3.9 REQUIRED)
>
find_package(OpenCV 3.2.0 REQUIRED)
点赞
收藏
评论区
推荐文章
blmius blmius
3年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Easter79 Easter79
3年前
swap空间的增减方法
(1)增大swap空间去激活swap交换区:swapoff v /dev/vg00/lvswap扩展交换lv:lvextend L 10G /dev/vg00/lvswap重新生成swap交换区:mkswap /dev/vg00/lvswap激活新生成的交换区:swapon v /dev/vg00/lvswap
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
Jacquelyn38 Jacquelyn38
3年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
Wesley13 Wesley13
3年前
Java获得今日零时零分零秒的时间(Date型)
publicDatezeroTime()throwsParseException{    DatetimenewDate();    SimpleDateFormatsimpnewSimpleDateFormat("yyyyMMdd00:00:00");    SimpleDateFormatsimp2newS
Wesley13 Wesley13
3年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
3年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Stella981 Stella981
3年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable
Wesley13 Wesley13
3年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
11个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这