小觅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

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

官方源速度有些慢,添加中科大源

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'

或清华源

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

sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116

添加公钥(官方文档没有这一步,但是不添加公钥会报不信任错误

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654

1.2.4 安装

sudo apt-get update

安装桌面完整版

sudo apt-get install ros-kinetic-desktop-full

1.2.5 初始化rosdep

sudo rosdep init
rosdep update

1.2.6 环境配置

echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc

1.2.7 构建工厂依赖

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

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

  1. 下载并编译安装SDK

    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
  2. 添加路径

    echo "source ~/MYNT/SDK/wrappers/ros/devel/setup.bash" >> ~/.bashrc
    source ~/.bashrc
  3. 测试相机

    1. 不使用ROS
     cd ~/MYNT/SDK                        #cd <sdk>
    ./samples/_output/bin/api/camera_a
    1. 使用ROS
    cd <sdk>
    source wrappers/ros/devel/setup.bash
    roslaunch mynt_eye_ros_wrapper mynteye.launch     #开摄像头,但默认不显示图像
    roslaunch mynt_eye_ros_wrapper display.launch    #也可以运行这个节点,会打开 RViz 显示图像
    1. 获取参数
    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

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

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

配置路径

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参数

cd MYNT-EYE-S-SDK        #进入小觅相机SDK目录
./samples/_output/bin/tutorials/get_img_params

根据获得的参数修改left_equ.yamlright_equ.yaml

4. 运行VINS-FUSION

4.1 mono+imu fusion

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

cd ~/catkin_ws
source ./devel/setup.bash
roslaunch vins mynteye-s-mono-imu.launch

4.2 Stereo fusion

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

cd ~/catkin_ws
source ./devel/setup.bash
roslaunch vins mynteye-s-stereo.launch

4.3 Stereo+imu fusion

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

cd ~/catkin_ws
source ./devel/setup.bash
roslaunch vins mynteye-s-stereo-imu.launch
Last modification:March 11th, 2020 at 06:11 pm