小觅VINS-FUSION:https://github.com/slightech/MYNT-EYE-VINS-FUSION-Samples/tree/master
港科大VINS-FUSION:https://github.com/HKUST-Aerial-Robotics/Vins-Fusion
小觅相机标准版SDK:https://github.com/slightech/MYNT-EYE-S-SDK
安装标定以及运行教程参考:https://blog.csdn.net/CSDN_XCS/article/details/91039481
1. 环境准备
1.1 系统环境
Ubuntu 16.04 LTS,最好是干净的系统。
可以到阿里巴巴开源镜像站或其他下载站下载系统镜像。
https://mirrors.aliyun.com/ubuntu-releases/16.04/ubuntu-16.04.6-desktop-amd64.iso
安装git、cmake、vim、wget
1
2
3
4
5
sudo apt-get update
sudo apt-get install git
sudo apt-get install cmake
sudo apt-get install vim
sudo apt-get install wget
1.2 安装ROS Kinetic
安装说明:http://wiki.ros.org/cn/kinetic/Installation/Ubuntu
1.2.1 配置 Ubuntu 软件仓库
配置你的 Ubuntu 软件仓库(repositories) 以允许 “restricted”、“universe” 和 “multiverse"这三种安装模式。 你可以按照ubuntu中的配置指南 来完成配置。
1.2.2 添加 sources.list
官方源速度有些慢,添加中科大源
1
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'
或清华源
1
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'
1.2.3 添加key
1
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
添加公钥 (官方文档没有这一步,但是不添加公钥会报不信任错误 )
1
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654
1.2.4 安装
安装桌面完整版
1
sudo apt-get install ros-kinetic-desktop-full
1.2.5 初始化rosdep
1
2
sudo rosdep init
rosdep update
1.2.6 环境配置
1
2
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
1.2.7 构建工厂依赖
1
sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential
1.2.8 配置ROS环境,创建工作空间
参考:http://wiki.ros.org/cn/ROS/Tutorials/InstallingandConfiguringROSEnvironment
1
2
3
4
5
6
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws
catkin_make
source devel/setup.bash
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
1.3 安装小觅摄像头SDK
本部分参考官方文档SDK安装部分,安装到目录~/MYNT/SDK下(路径根据需要可自行修改)
https://mynt-eye-s-sdk.readthedocs.io/zh_CN/latest/src/sdk/install_ubuntu_src.html
下载并编译安装SDK
1
2
3
4
5
6
7
8
9
10
11
12
mkdir ~/MYNT
cd ~/MYNT
git clone https://github.com/slightech/MYNT-EYE-S-SDK.git SDK
cd SDK
make init
make
make install
make samples
make tools
make ros
# make all
添加路径
1
2
echo "source ~/MYNT/SDK/wrappers/ros/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
测试相机
不使用ROS 1
2
cd ~/MYNT/SDK #cd <sdk>
./samples/_output/bin/api/camera_a
使用ROS 1
2
3
4
cd <sdk>
source wrappers/ros/devel/setup.bash
roslaunch mynt_eye_ros_wrapper mynteye.launch #开摄像头,但默认不显示图像
roslaunch mynt_eye_ros_wrapper display.launch #也可以运行这个节点,会打开 RViz 显示图像
获取参数 1
2
3
cd <sdk>
./samples/_output/bin/tutorials/get_img_params #获取相机标定参数
./samples/_output/bin/tutorials/get_imu_params #获取IMU标定参数
1.4 安装依赖ceres
官方文档:http://www.ceres-solver.org/installation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
cd ~
git clone https://ceres-solver.googlesource.com/ceres-solver
sudo apt-get -y install cmake libgoogle-glog-dev libatlas-base-dev libeigen3-dev libsuitesparse-dev
sudo add-apt-repository ppa:bzindovic/suitesparse-bugfix-1319687
sudo apt-get update
sudo apt-get install libsuitesparse-dev
tar zxf ceres-solver-1.14.0.tar.gz
mkdir ceres-bin
cd ceres-bin
cmake ../ceres-solver
make -j3
sudo make install
2. 下载编译MYNT-EYE-VINS-FUSION
MYNT-EYE-VINS-FUSION默认分支要采用docker安装,这里切换到master分支 ,一定注意不要下错分支 ,我们不使用docker安装。
建立工作空间,下载并编译VINS-FUSION
1
2
3
4
5
mkdir -p ~/vins-fusion/src
cd ~/vins-fusion/src
git clone -b master https://github.com/slightech/MYNT-EYE-VINS-FUSION-Samples.git
cd ..
catkin_make
配置路径
1
2
echo "source ~/vins-fusion/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
3.修改相机参数
使用SDK的./samples/_output/bin/tutorials/get_img_params
获取左右相机的k2,k3,k4,k5,mu,mv,u0,v0
参数
1
2
cd MYNT-EYE-S-SDK #进入小觅相机SDK目录
./samples/_output/bin/tutorials/get_img_params
根据获得的参数修改left_equ.yaml
和right_equ.yaml
。
4. 运行VINS-FUSION
4.1 mono+imu fusion
1
2
3
cd path/to/MYNT-EYE-S-SDK #小觅SDK的路径
source wrappers/ros/devel/setup.bash
roslaunch mynt_eye_ros_wrapper vins_fusion.launch
Open another terminal
1
2
3
cd ~/catkin_ws
source ./devel/setup.bash
roslaunch vins mynteye-s-mono-imu.launch
4.2 Stereo fusion
1
2
3
cd path/to/MYNT-EYE-S-SDK #小觅SDK的路径
source wrappers/ros/devel/setup.bash
roslaunch mynt_eye_ros_wrapper vins_fusion.launch
Open another terminal
1
2
3
cd ~/catkin_ws
source ./devel/setup.bash
roslaunch vins mynteye-s-stereo.launch
4.3 Stereo+imu fusion
1
2
3
cd path/to/MYNT-EYE-S-SDK #小觅SDK的路径
source wrappers/ros/devel/setup.bash
roslaunch mynt_eye_ros_wrapper vins_fusion.launch
Open another terminal
1
2
3
cd ~/catkin_ws
source ./devel/setup.bash
roslaunch vins mynteye-s-stereo-imu.launch