[双目相机]Ubuntu SDK 源码安装MYNT_EYE (小觅双目惯导传感器使用)

Ubuntu SDK 源码安装MYNT_EYE

如果是其他 Linux 发行版,不是用的 apt-get 包管理工具,那你准备依赖时不能 make init 自动安装,得自己手动安装了。必要安装项如下:

Linux How to install required packages
Debian based sudo apt-get install build-essential cmake git libv4l-dev
Red Hat based sudo yum install make gcc gcc-c++ kernel-devel cmake git libv4l-devel
Arch Linux sudo pacman -S base-devel cmake git v4l-utils

获取代码

sudo apt-get install git
git clone https://github.com/slightech/MYNT-EYE-SDK-2.git

准备依赖

cd 
make init
  • OpenCV

Tip  (如果之前安装过opencv,此处略去)

OpenCV 如何编译安装,请见官方文档 Installation in Linux 。或参考如下命令:

[compiler] sudo apt-get install build-essential
[required] sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
[optional] sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

$ git clone https://github.com/opencv/opencv.git
$ cd opencv/
$ git checkout tags/3.4.1

$ mkdir _build
$ cd _build/

$ cmake \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=/usr/local \
\
-DWITH_CUDA=OFF \
\
-DBUILD_DOCS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_TESTS=OFF \
-DBUILD_PERF_TESTS=OFF \
..

$ make -j4
$ sudo make install

编译代码

Tip

如果 OpenCV 安装到了自定义目录或想指定某一版本,编译前可如下设置路径:

# OpenCV_DIR 为 OpenCVConfig.cmake 所在目录
export OpenCV_DIR=~/opencv

不然, CMake 会提示找不到 OpenCV 。如果不想依赖 OpenCV ,请阅读 OpenCV 不依赖 。

编译并安装:

cd 
make install

最终,默认会安装在 /_install 目录。

编译样例

cd 
make samples

检查链接

ls /dev/video*(显示是否链接了摄像头)

运行样例:

./samples/_output/bin/api/camera_a

[双目相机]Ubuntu SDK 源码安装MYNT_EYE (小觅双目惯导传感器使用)_第1张图片

显示界面

教程样例,请阅读 MYNT® EYE 数据 和 MYNT® EYE 控制 。

编译工具

cd 
make tools

安装脚本依赖:

cd /tools/
sudo pip install -r requirements.txt

工具和脚本的使用,后续会有介绍。

结语

工程要引入 SDK 的话,CMake 可参考 samples/CMakeLists.txt 里的配置。不然,就是直接引入安装目录里的头文件和动态库。

ROS 安装 MYNT® EYE SDK

环境准备

  • ROS

ROS Kinetic (Ubuntu 16.04)

wget https://raw.githubusercontent.com/oroca/oroca-ros-pkg/master/ros_install.sh && \
chmod 755 ./ros_install.sh && bash ./ros_install.sh catkin_ws kinetic

ROS Indigo (Ubuntu 14.04)

wget https://raw.githubusercontent.com/oroca/oroca-ros-pkg/master/ros_install.sh && \
chmod 755 ./ros_install.sh && bash ./ros_install.sh catkin_ws indigo

编译代码

cd 
make ros

运行节点

source wrappers/ros/devel/setup.bash
roslaunch mynt_eye_ros_wrapper mynteye.launch

运行节点,同时打开 RViz 预览:

source wrappers/ros/devel/setup.bash
roslaunch mynt_eye_ros_wrapper display.launch

测试服务

运行节点,有提供获取设备信息服务,如下测试:

$ source wrappers/ros/devel/setup.bash
$ rosrun mynt_eye_ros_wrapper get_device_info.py
LENS_TYPE: 0000
SPEC_VERSION: 1.0
NOMINAL_BASELINE: 120
HARDWARE_VERSION: 2.0
IMU_TYPE: 0000
SERIAL_NUMBER: 0610243700090720
FIRMWARE_VERSION: 2.0
DEVICE_NAME: MYNT-EYE-S1000

常见问题 - ROS Indigo

make roslibopencv 找不到

make[3]: *** No rule to make target `/usr/lib/x86_64-linux-gnu/libopencv_videostab.so.2.4.8', needed by `/home/john/Workspace/mynt-eye-sdk-2/wrappers/ros/devel/lib/libmynteye_wrapper.so'.  Stop.

Solution 1) 安装 OpenCV 2:

sudo apt-get update
sudo apt-get install libcv-dev

Solution 2) 安装 OpenCV 3 并重编 cv_bridge:

sudo apt-get install ros-indigo-opencv3

git clone https://github.com/ros-perception/vision_opencv.git
mv vision_opencv/cv_bridge/ mynt-eye-sdk-2/wrappers/ros/src/

然后,重新 make ros

结语

附:

运行节点

source wrappers/ros/devel/setup.bash

roslaunch mynt_eye_ros_wrapper mynteye.launch

[双目相机]Ubuntu SDK 源码安装MYNT_EYE (小觅双目惯导传感器使用)_第2张图片

 

新开一个终端,运行节点,同时打开 RViz 预览:

source wrappers/ros/devel/setup.bash

roslaunch mynt_eye_ros_wrapper display.launch

[双目相机]Ubuntu SDK 源码安装MYNT_EYE (小觅双目惯导传感器使用)_第3张图片

[双目相机]Ubuntu SDK 源码安装MYNT_EYE (小觅双目惯导传感器使用)_第4张图片

查找录制数据的topic

rostopic list (-v会显示发布者和订阅者)

(找到图像信息和IMU信息的topics)

/mynteye/left/camera_info

/mynteye/left/image_raw

 

录制数据(保存.bag格式,后期解析)

rosbag record /mynteye/left/image_raw /mynteye/right/image_raw /mynteye/imu/data_raw

 

查看.bag包的信息(会得到你需要的各种信息)

rosbag info *.bag

你可能感兴趣的:(位姿测量,视觉SLAM,三维重建,立体视觉,SLAM)