在TX2上安装VIINS-Mono——问题总结

1 ceres-solver

我们一般通过以下命令安装Eigen:

sudo apt-get install libeigen3-dev

默认安装在/usr/include/eigen3
在CMakeList.txt中一般用以下语句找到Eigen:

find_package(Eigen REQUIRED)

如果有时找不到,可以替换成:

include_directories(/usr/include/eigen3)

在TX2上安装ceres-solver时,出现以下错误:

– Found installed version of Eigen: /usr/lib/cmake/eigen3
– Found Eigen version 3.2.92: /usr/include/eigen3
CMake Error at CMakeLists.txt:240 (message):
– Ceres requires Eigen version >= 3.3.4 on aarch64. Detected version of
Eigen is: 3.2.92.

因此,需要升级Eigen版本,大于或等于3.3.4。
在Eigen官网下载大于或等于3.3.4的版本,解压后使用cmake安装。

cd eigen
mkdir build
cd build
cmake ..
sudo make install

默认安装路径为/usr/local/include/eigen3
在ceres-solver的CMakeList.txt中注释find_package(Eigen QUIET),然后添加:

include_directories(/usr/local/include/eigen3)
set(EIGEN_INCLUDE_DIRS "/usr/local/include/eigen3")

2 catkin_make时找不到Ceres

报错信息

CMake Error at MYNT-EYE-VINS-Sample/camera_model/CMakeLists.txt:19 (find_package):
Found package configuration file:
/usr/local/lib/cmake/Ceres/CeresConfig.cmake
but it set Ceres_FOUND to FALSE so package “Ceres” is considered to be NOT
FOUND.

CMake Error at /usr/local/lib/cmake/Ceres/CeresConfig.cmake:83 (message):
Failed to find Ceres - Found Eigen dependency, but the version of Eigen
found (3.3.5) does not exactly match the version of Eigen Ceres was
compiled with (). This can cause subtle bugs by triggering violations of
the One Definition Rule. See the Wikipedia article
http://en.wikipedia.org/wiki/One_Definition_Rule for more details
Call Stack (most recent call first):
/usr/local/lib/cmake/Ceres/CeresConfig.cmake:187 (ceres_report_not_found)

解决方法
打开/usr/local/lib/cmake/Ceres/CeresConfig.cmake,作以下修改:

set(Ceres_FOUND TRUE)  #将FALSE改为TRUE
set(EIGEN_INCLUDE_DIR "/usr/local/include/eigen3")  #添加此行
set(CERES_EIGEN_VERSION 3.3.5)  #添加此行,版本号与你安装的对应

3 stack smashing detected

编译成功后,运行报错:

stack smashing detected

发现还是Eigen的问题,在所有包含find_package(Eigen3)的CMakeList.txt中,将其替换为:

include_directories(/usr/local/include/eigen3)

然后重新编译,就可以成功运行了。

4 相机供电

由于TX2的USB接口有限,我使用了USB hub进行扩展,可能因为供电不足,相机很容易挂掉。

5 总结

综上,主要是Eigen的版本问题和在CMakeList.txt中找到需要的版本。
最后附一张截图,明天进行大场景测试。
在TX2上安装VIINS-Mono——问题总结_第1张图片

你可能感兴趣的:(SLAM)