小觅 MYNTEYE-S1030
Ubuntu 16.04
1.ROS Kinetic
2.MYNT-EYE-S-SDK
3.kalibr
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full
sudo rosdep init
rosdep update
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
roscore
rosrun turtlesim turtlesim_node
rosrun turtlesim turtle_teleop_key
rosrun rqt_graph rqt_graph
sudo apt-get install git
git clone https://github.com/slightech/MYNT-EYE-S-SDK.git
cd <sdk> # <sdk> 是指sdk路径
make init
make install
make samples
./samples/_output/bin/camera_with_junior_device_api
cd ~/MYNT-EYE-S-SDK
make ros
#依赖项
sudo apt-get install python-setuptools python-rosinstall ipython libeigen3-dev libboost-all-dev doxygen libopencv-dev ros-kinetic-vision-opencv ros-kinetic-image-transport-plugins ros-kinetic-cmake-modules python-software-properties software-properties-common libpoco-dev python-matplotlib python-scipy python-git python-pip ipython libtbb-dev libblas-dev liblapack-dev python-catkin-tools libv4l-dev
sudo pip install python-igraph --upgrade#可能要升级pip或者换源
#创建空间
mkdir -p ~/kalibr_workspace/src
cd ~/kalibr_workspace
source /opt/ros/kinetic/setup.bash
catkin init
catkin config --extend /opt/ros/kinetic
catkin config --merge-devel # Necessary for catkin_tools >= 0.4.
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release
#编译
cd ~/kalibr_workspace/src
git clone https://github.com/ethz-asl/Kalibr.git
cd ..
catkin build -DCMAKE_BUILD_TYPE=Release -j4
#下载标定板
有需要的可以在下面百度云盘下载:
链接: https://pan.baidu.com/s/1PGuf0P_Ta8x9Qhod_byq3g 提取码: r4ts
4.1 相机-相机
#1.打开相机
source wrappers/ros/devel/setup.bash
roslaunch mynt_eye_ros_wrapper display.launch
#2.调整频率 发布topic为/mynteye/left/image_raw /mynteye/right/image_raw
rosrun topic_tools throttle messages /mynteye/left/image_raw 4.0 /mynteye/left/image_raw
rosrun topic_tools throttle messages /mynteye/right/image_raw 4.0 /mynteye/right/image_raw
#3.录像
rosbag record -O stereo_calib.bag /mynteye/left/image_raw /mynteye/right/image_raw
文件在~/下
#4.采集方式:
可以打印标定板,也可以直接在电脑上显示。
将标定目标AprilGrid置于相机前方合理距离范围内,然后缓慢移动标定目标,让所有摄像头均能看到标定物。
一定不要太远,不然无法检测到标定目标的特征,在标定算法中需要检测是否有足够数量图片检测到标定特征,
否则直接无法标定。移动标定物时候不要过快导致运动模糊,我们只需要获取不同位置和角度的图像,
确保图像清晰和特征完整即可。另外要尽可能多角度和多位置(上下左右等)甚至到摄像头捕捉图像的边缘,
这样移动目标1min左右即可。
#5.标定 april_6x6_80x80cm.yaml是和标定板文件配套的,修改里面的参数tagSize为实际显示尺寸(m)
source ~/kalibr_workspace/devel/setup.bash
kalibr_calibrate_cameras --bag ~/MYNT-EYE-S-SDK/stereo_calib.bag --topics /mynteye/left/image_raw /mynteye/right/image_raw --models pinhole-radtan pinhole-radtan --target ~/board/april_6x6_80x80cm.yaml
可以添加
--bag-from-to 10 100 选择10-100s之间的数据.
--max-iter 15 设置优化迭代次数为15次,默认30.
--show-extraction 展示特征提取情况.
#6.结果:得到三个文件
results-cam-homesloanMYNT-EYE-S-SDKstereo_calib.txt
report-cam-homesloanMYNT-EYE-S-SDKstereo_calib.pdf
camchain-homesloanMYNT-EYE-S-SDKstereo_calib.yaml
#遇到的问题:
[ERROR] [1609848071.122935]: initialization of focal length for cam with topic /mynteye/right/image_raw failed
#解决方案:
https://github.com/ethz-asl/kalibr/issues/110
https://github.com/ethz-asl/kalibr/issues/99
--将pinhole-radtan改为omni-radtan即可。
这样就得到各个相机的内参和外参
4.2 相机-IMU联合标定
#1.打开相机
source wrappers/ros/devel/setup.bash
roslaunch mynt_eye_ros_wrapper display.launch
#2.调整参数#200Hz
修改文件wrappers/ros/src/mynt_eye_ros_wrapper/config/device/standard.yaml里面的standard/imu_frequency: 200 tandard/frame_rate: 20
rosrun topic_tools throttle messages /mynteye/imu 200 /mynteye/imu/data_raw
rosrun topic_tools throttle messages /mynteye/left/image_raw_imu 20 /mynteye/left/image_raw
rosrun topic_tools throttle messages /mynteye/right/image_raw_imu 20 /mynteye/right/image_raw
#3.录像
rosbag record -O camera_imu_calibration.bag /mynteye/left/image_raw /mynteye/right/image_raw /mynteye /mynteye/imu/data_raw
#4.采集方式:
采集数据的最佳频率为图像20Hz, IMU 200 Hz 。采集90 mins。
采集数据的起始和结束阶段注意别晃动太大,如从桌子上拿起或者放下。如果有这样的动作,在标定阶段应该跳过bag数据集的首尾的数据.
采集数据的时候应该给imu各个轴足够的激励,如先依次绕各个轴运动,运动完后来个在空中画8字之类的操作,当然也要注意别运动太剧烈,图像都模糊了。
#5.计算
source ~/kalibr_workspace/devel/setup.bash
kalibr_calibrate_imu_camera --target ~/board/april_6x6_80x80cm.yaml --cam ~/MYNT-EYE-S-SDK/camchain-homesloanMYNT-EYE-S-SDKstereo_calib.yaml --imu ~/board/imu.yaml --bag ~/MYNT-EYE-S-SDK/camera_imu_calibration.bag
其中
--bag-from-to 10 100 选择10-100s之间的数据.
--max-iter 15 设置优化迭代次数为15次,默认30.
--show-extraction 展示特征提取情况.
--target是和标定办板对应的文件
--cam的文件是双目标定得到的文件
--bag文件是录像文件
--imu文件是下载下来的(imu.yaml 中注意修改imu的rostopic和)命令中的一致
文件可以从https://github.com/ethz-asl/kalibr/wiki/downloads下载
或者手写,差不了很多,就是为了提供一个初值:
rostopic: /mynteye/imu/data_raw #这里小修改为上面对应的topic
update_rate: 200.0 #Hz
accelerometer_noise_density: 2.3786845794688424e-02 #白噪声
accelerometer_random_walk: 5.9166889270489845e-04 #偏置
gyroscope_noise_density: 2.1732068912927271e-03 #continous
gyroscope_random_walk: 1.7797900203083191e-05
如果出现问题提示:“Spline Coefficient Buffer Exceeded. Set larger buffer margins”
在标定命令最后添加 --timeoffset-padding 0.1 即可
至此,标定完毕