└── README.md /README.md: -------------------------------------------------------------------------------- 1 | 2 | This tutorial will use Kalibr calibration tool, for more details: 3 | Kalibr on github: https://github.com/ethz-asl/kalibr 4 | 5 | ## In short 6 | 7 | If using Kalibr https://github.com/ethz-asl/kalibr you can follow the youtube video https://www.youtube.com/watch?app=desktop&v=puNXsnrYWTY or the article https://support.stereolabs.com/hc/en-us/articles/360012749113-How-can-I-use-Kalibr-with-the-ZED-Mini-camera-in-ROS- to do the calibration. 8 | Then refer to https://github.com/ethz-asl/kalibr/wiki/yaml-formats to read the yaml file. 9 | Note that the translation matrices are: T_camX_imu and need to be inverted to obtain: T_imu_camX for use in VINS_Fusion 10 | 11 | ## Detailed tutorial 12 | 13 | You can use your device's own factory calibration files (for zed can be found in /usr/local/zed/settings/) which should be more accurate since they use sophisticated equipment (in theory) 14 | (more info about zed calibration file: https://support.stereolabs.com/hc/en-us/articles/360007497173-What-is-the-calibration-file-) 15 | 16 | Otherwise, Kalibr calibration is a great tool for calibration, and is compatible with ROS which makes it really easy to use. 17 | 18 | First, you need to print the april grid https://github.com/ethz-asl/kalibr/wiki/downloads on a sheet of paper (A4 is good), and then change line 4 in the yaml file to the size of apriltag (the big squares) you printed 19 | tagSize: 0.055 #size of apriltag, edge to edge [m] 20 | 21 | Second, you need to record a ROS bag with a appropriate data, follow the instructions in the youtube video https://www.youtube.com/watch?app=desktop&v=puNXsnrYWTY for what type of data (footage) you need to record, and refer to the article https://support.stereolabs.com/hc/en-us/articles/360012749113-How-can-I-use-Kalibr-with-the-ZED-Mini-camera-in-ROS- to copy command line commands from. 22 | 23 | Third, Perform the calibration, firstly for the camera(s) only, then for the camera(s) and imu. This may take a while :) 24 | 25 | example using ZED mini: 26 | 27 | $ kalibr_calibrate_cameras --bag Kalibr_data.bag --topics /zed/zed_node/left/image_rect_color /zed/zed_node/right/image_rect_color --models pinhole-radtan pinhole-radtan --target april_grid.yaml 28 | 29 | $ kalibr_calibrate_imu_camera --bag Kalibr_data.bag --cam camchain-Kalibr_data.yaml --imu imu-params.yaml --target april_grid.yaml 30 | 31 | You can find the ROS topic of your ZED camera when launching ZED wrapper since it may be different. 32 | 33 | Finally, you need to read the calibration file to use it for your VINS-Fusion calibration. 34 | 35 | For cameras' intrinsic and parameters (camX.yaml file, or camX_calib): 36 | intrinsics vector: [fx fy px py] 37 | distortion_coeffs: [k1 k2 r1 r2] 38 | 39 | For main config.yaml file: 40 | VINS-Fusion requires the matrix T_imu_cam for each camera, which means where each camera if the we set the imu to be at point (0, 0, 0) 41 | But Kalibr provides us with T_cam_imu. 42 | To find T_imu_cam, we need to take the T_cam_imu matrices and inverse them. 43 | You can do that by inputing the array as a 4x4 numpy array and using numpy.linalg.inv() function in python. 44 | 45 | Then replace the matrices body_T_camX in the config file with the inversed matrix. (note that the matrix should be in 1D array format for that to work) 46 | 47 | For other imu parameters you don't need to change them much for the system to work fine. 48 | 49 | 50 | Don't forget to change the resolution in both the main config file and imageX_topic files. 51 | --------------------------------------------------------------------------------