之前一篇博客:“ubuntu16.04运行VINS-MONO实验总结” 已经在笔记本中成功运行了VINS-MONO。然后想在TX2上运行看看。
方法1:(ceres官网给的教程)
sudo apt-get install cmake
sudo apt-get install libgoogle-glog-dev
sudo apt-get install libatlas-base-dev
sudo apt-get install libeigen3-dev
sudo apt-get install libsuitesparse-dev
sudo add-apt-repository ppa:bzindovic/suitesparse-bugfix-1319687
sudo apt-get update
sudo apt-get install libsuitesparse-dev
下载ceres安装包,并安装。 github地址
tar zxf ceres-solver-1.14.0.tar.gz
mkdir ceres-bin
cd ceres-bin
cmake ../ceres-solver-1.14.0
make -j3
make test
make install
方法2:(按照视觉SLAM14讲高博给的方法)
sudo apt-get install liblapack-dev libsuitesparse-dev libcxsparse3.1.2 libgflags-dev libgoogle-glog-dev
注意ubun16.04系统需要将libcxsparse3.1.2换成libcxsparse3.1.4
tar zxf ceres-solver-1.14.0.tar.gz
mkdir build
cd build
cmake ..
make -j3
sudo make install
编译过程出现错误,eigen需要大于3.3.4版本,之前笔记本安装的eigen版本是3.2.10也能够通过编译,于是在网上下载eigen安装包,我选择的版本是eigen 3.3.7,重新安装。
tar zxf eigen-3.3.7.tar.gz
mkdir build
cd build
cmake ..
sudo make install
Ceres库的头文件安装在"/usr/local/include/ceres/“目录下,库文件安装在”/usr/local/lib/“目录;eigen库的头文件安装在”/usr/local/include/eigen3/"目录下。
1)运行 mynteye 节点
cd [path of mynteye-s-sdk]
make ros
source ./wrappers/ros/devel/setup.bash
roslaunch mynt_eye_ros_wrapper mynteye.launch
2)打开另一个命令行运行 VINS-MONO
cd ~/vins_mono_ws
source devel/setup.bash
roslaunch vins_estimator mynteye.launch
如下图所示,报错了!!!应该是调用ceres求解器不成功,系统初始化成功之后,轨迹一下子飘了。
问题解决思路:
1)卸载之前安装的ceres
sudo rm -rf /usr/local/include/ceres
sudo rm -rf /usr/local/lib/cmake/Ceres/
sudo rm -rf /usr/local/lib/libceres.a
2)卸御之后重新安装eigen(过程参考这篇文章“Ubuntu 16.04, 卸载&安装 Eigen”)
重新编译之后发现还是出现问题,如下图所示:
这是什么问题???用了catkin_make_isolated,编译能通过,不过在运行vins-mono的过程中还是和之前的问题一样,似乎无法调用ceres优化库。
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 7 packages in topological order:
-- ~~ - ceres-solver (plain cmake)
-- ~~ - benchmark_publisher
-- ~~ - camera_model
-- ~~ - ar_demo
-- ~~ - feature_tracker
-- ~~ - pose_graph
-- ~~ - vins_estimator
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkin_workspace.cmake:95 (message):
This workspace contains non-catkin packages in it, and catkin cannot build
a non-homogeneous workspace without isolation. Try the
'catkin_make_isolated' command instead.
Call Stack (most recent call first):
CMakeLists.txt:63 (catkin_workspace)
-- Configuring incomplete, errors occurred!
See also "/home/nvidia/vins-mono_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/nvidia/vins-mono_ws/build/CMakeFiles/CMakeError.log".
Makefile:1116: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
[/code]