1、kalibr 源碼編譯
ROS編譯
見kalibr install wiki: https://github.com/ethz-asl/kalibr/wiki/installation
注意:按照wiki步驟安裝所有依賴包,不然編譯會各種報錯,安裝後也可能會提示缺少python依賴包,按照提示安裝即可。
ImportError: No module named sm
pip install sm
2、準備標定板
我使用的標定板是Aprilgrid標定板,下載地址https://github.com/ethz-asl/kalibr/wiki/downloads,每個標定板對應一個pdf文件和一個ymal文件,ymal文件裏保存着標定板的尺寸信息。
3、準備雙目相機bag包
<1> 啓動相機
roslaunch mynt_eye_ros_wrapper display.launch
通常設備採集的頻率爲 20-60 hz, 這會使得標定的圖像過多, 而導致計算量太大. 最好將rostopic的頻率降低到4hz左右進行採集。要確保圖像不要模糊,運動不要太快!!!
rosrun topic_tools throttle messages /mynteye/left/image_color 4.0 /left
rosrun topic_tools throttle messages /mynteye/right/image_color 4.0 /right
然後採集不同姿態下的相機數據:
rosbag record -O stereo_calibra.bag /left /right
4、標定過程
cd ~/kalibr_
source devel/setup.bash
rosrun kalibr kalibr_calibrate_cameras --bag '/home/cjn/stereo_calibra.bag' --topics /left /right --models pinhole-radtan pinhole-radtan --target '/home/cjn/下載/april_6x6_80x80cm.yaml' --show-extraction --approx-sync 0.1
指令參考:Multiple camera calibration
標定過程中報錯:
Cameras are not connected through mutual observations, please check the dataset. Maybe adjust the approx. sync. tolerance.
應該是兩個相機時間不同步導致的,需要調整參數:--approx-sync