参考网址
https://github.com/kuankuan-yue/VINS-FUSION-leanrning
1、Ceres Solver
安装依赖项
# CMake
sudo apt-get install cmake
# google-glog + gflags
sudo apt-get install libgoogle-glog-dev libgflags-dev
# BLAS & LAPACK
sudo apt-get install libatlas-base-dev
# Eigen3
sudo apt-get install libeigen3-dev
# SuiteSparse and CXSparse (optional)
sudo apt-get install libsuitesparse-dev
源码安装
git clone https://ceres-solver.googlesource.com/ceres-solver
tar zxf ceres-solver-2.0.0.tar.gz
mkdir build
cd build
cmake ..
make -j4
make test
# Optionally install Ceres, it can also be exported using CMake which
# allows Ceres to be used without requiring installation, see the documentation
# for the EXPORT_BUILD_DIR option for more information.
make install
- Build VINS-Fusion
cd ~/catkin_ws/src
git clone https://github.com/HKUST-Aerial-Robotics/VINS-Fusion.git
cd ..
catkin_make
source ~/catkin_ws/devel/setup.bash
realsense-sdk的作用是在电脑端运行官方界面,然后实现建图和定点的作用但是我们只需要使用到ros代码,所以非必要安装
安装ros-realsense驱动
sudo apt-get install ros-noetic-realsense2-camera
编译realsense-ros功能包
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src/
# git clone https://github.com/IntelRealSense/realsense-ros.git
# 使用gitee代理
git clone https://gitee.com/olderking/realsense-ros.git
cd realsense-ros/
git checkout `git tag | sort -V | grep -P "^2.\d+\.\d+" | tail -1`
cd ..
catkin_init_workspace
cd ..
catkin_make clean
catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release
catkin_make install
安装vins
cd ~/catkin_ws/src
# git clone https://github.com/HKUST-Aerial-Robotics/VINS-Fusion.git
# gitee
git clone https://gitee.com/stancy_sun/vins_fusion.git
cd ../
catkin_make
source ~/catkin_ws/devel/setup.bash
启动vins
roslaunch realsense2_camera rs_camera_vins.launch
roslaunch vins vins_rviz.launch # 用于启动界面,应该可以不用
rosrun vins vins_node ~/catkin_ws/src/VINS-Fusion/config/realsense_d435i/realsense_stereo_imu_config.yaml