ethz-asl / kalibr

The Kalibr visual-inertial calibration toolbox
Other
4.28k stars 1.39k forks source link

Wrong distance between imu0 and cam0 #591

Closed ericdonatyy closed 1 year ago

ericdonatyy commented 1 year ago

Hi all,

I ran the code below. While I thought I had good results, I realized that the Transformation of imu0 and cam0 was 2-3 cm. but that's not the case. In fact, the distance between them should be 1 m, but it shows that they are on top of each other. How can I fix this?

rosrun kalibr kalibr_calibrate_imu_camera --bag /home/aaa/Desktop/xxx.bag --cam /home/aaa/Desktop/33/camchain.yaml --imu /home/aaa/Desktop/33/sensor.yaml --target chessboard.yaml

bagfile: https://drive.google.com/file/d/17sETWosLCwWjgPZ0Zsb0ajKXjCGloDJN/view?usp=sharing

yaml files: https://drive.google.com/file/d/17OXIXrPkLcLUgDf1weMGikR-pbKUnT2P/view?usp=sharing

WhatsApp Image 2021-04-19 at 20 38 37


Calibration results
===================
Normalized Residuals
----------------------------
Reprojection error (cam0): mean 3.43651242902, median 2.45586921196, std: 3.35827255274
Reprojection error (cam1): mean 4.30642687675, median 3.3893443818, std: 3.37940826105
Gyroscope error (imu0): mean 3.73189059031, median 3.0925484531, std: 2.36157134307
Accelerometer error (imu0): mean 3.90902025204, median 3.47302697175, std: 2.35598444205
Residuals
----------------------------
Reprojection error (cam0) [px]: mean 3.43651242902, median 2.45586921196, std: 3.35827255274
Reprojection error (cam1) [px]: mean 4.30642687675, median 3.3893443818, std: 3.37940826105
Gyroscope error (imu0) [rad/s]: mean 0.0167188698446, median 0.0138546170699, std: 0.010579839617
Accelerometer error (imu0) [m/s^2]: mean 0.0687987564358, median 0.0611252747028, std: 0.0414653261801
Transformation (cam0):
-----------------------
T_ci: (imu0 to cam0):
[[ 0.43843526 0.76837964 0.46622661 0.03420043]
[ 0.50826897 0.2158497 -0.83370952 -0.08425894]
[-0.7412403 0.60249617 -0.29590741 -0.02835275]
[ 0. 0. 0. 1. ]]
T_ic: (cam0 to imu0):
[[ 0.43843526 0.50826897 -0.7412403 0.00681533]
[ 0.76837964 0.2158497 0.60249617 0.00899078]
[ 0.46622661 -0.83370952 -0.29590741 -0.09458242]
[ 0. 0. 0. 1. ]]
timeshift cam0 to imu0: [s] (t_imu = t_cam + shift)
-0.00761201855087
Transformation (cam1):
-----------------------
T_ci: (imu0 to cam1):
[[ 0.73704243 0.61644238 0.27706905 1.13958079]
[ 0.40015446 -0.06765327 -0.91394718 -0.26245273]
[-0.54465114 0.78448826 -0.2965355 0.14199755]
[ 0. 0. 0. 1. ]]
T_ic: (cam1 to imu0):
[[ 0.73704243 0.40015446 -0.54465114 -0.65755863]
[ 0.61644238 -0.06765327 0.78448826 -0.83163709]
[ 0.27706905 -0.91394718 -0.2965355 -0.51350318]
[ 0. 0. 0. 1. ]]
timeshift cam1 to imu0: [s] (t_imu = t_cam + shift)
0.0506908937432
Baselines:
----------
Baseline (cam0 to cam1):
[[ 0.92598412 0.2766796 -0.25690816 1.12394042]
[-0.30264806 0.95074962 -0.06692771 -0.17389047]
[ 0.2257378 0.13972675 0.96411559 0.17338578]
[ 0. 0. 0. 1. ]]
baseline norm: 1.15045320652 [m]
Gravity vector in target coords: [m/s^2]
[ 9.1229722 -3.54875937 -0.58830956]
Calibration configuration
=========================
cam0
-----
Camera model: pinhole
Focal length: [1433.6578215106601, 1461.9000384708388]
Principal point: [1393.3805858113324, 762.6942287441339]
Distortion model: equidistant
Distortion coefficients: [0.32035094215343773, -0.4643930550231533, 3.9907429115087187, -7.412372991359346]
Type: checkerboard
Rows
Count: 6
Distance: 0.1 [m]
Cols
Count: 9
Distance: 0.1 [m]
cam1
-----
Camera model: pinhole
Focal length: [1445.590453512298, 1470.2730109479771]
Principal point: [1306.0213652117839, 870.5095979233218]
Distortion model: equidistant
Distortion coefficients: [0.05922964197054631, 1.346456032547938, -5.0541328430314945, 7.374066578634135]
Type: checkerboard
Rows
Count: 6
Distance: 0.1 [m]
Cols
Count: 9
Distance: 0.1 [m]
IMU configuration
=================
IMU0:
----------------------------
Model: calibrated
Update rate: 400.0
Accelerometer:
Noise density: 0.00088
Noise density (discrete): 0.0176
Random walk: 2.1e-05
Gyroscope:
Noise density: 0.000224
Noise density (discrete): 0.00448
Random walk: 5e-06
T_ib (imu0 to imu0)
[[ 1. 0. 0. 0.]
[ 0. 1. 0. 0.]
[ 0. 0. 1. 0.]
[ 0. 0. 0. 1.]]
time offset with respect to IMU0: 0.0 [s]
goldbattle commented 1 year ago

Make sure to excite all axes with large accelerations and angular rotations. Calibration fixed to a car will not work since the IMU will not be excited enough (unless you are holding the rig).