Recalibrated camera to be sure everything is alright. Made a new dataset, with which Kalibr can calibrate!
Started camera with:
$ rosrun uvc_camera uvc_camera_node _frame_id:=logitech _device:=/dev/video1 _width:=640 _fps:=20 __ns:=logitech_camera __name:=logitech_camera
I calibrated with the chessboard of Toby’s lab. Executed command:
$ rosrun camera_calibration cameracalibrator.py -s 9x6 -p chessboard -q 0.025 image:=/logitech_camera/image_raw camera:=/logitech_camera
The calibration is stored in ~/.ros/camera_info/logitech.yaml
.
I created a new dataset today to calibrate my camera-IMU combo. This time, it contained a lot more fast motions, as seen in the example dataset of Kalibr (Toby discovered that one today). Errors in the output seem to come from the fact that the calibration was performed in a headless session (no X server connected to the ssh’d session):
$ rosrun kalibr kalibr_calibrate_imu_camera --bag bags/2014-09-16_MTi_Logitech.bag --cam repos/kalibr/config/camera/logitech.yaml --imu repos/kalibr/config/imu/MTx.yaml --target repos/kalibr/config/calibration_target/aprilgrid.yaml
importing libraries
Initializing IMUs:
Update rate: 100
Accelerometer:
Noise density: 0.004
Noise density (discrete): 0.04
Random walk: 0.02
Gyroscope:
Noise density: 0.1
Noise density (discrete): 1.0
Random walk: 1.0
Initializing imu rosbag dataset reader:
Dataset: bags/2014-09-16_MTi_Logitech.bag
Topic: /MTi/imu/data
Number of messages: 6326
Reading IMU data (/MTi/imu/data)
Read 6326 imu readings over 32.2 seconds
Initializing calibration target:
Type: aprilgrid
Tags:
Rows: 6
Cols: 6
Size: 0.024 [m]
Spacing 0.00700008 [m]
Initializing camera chain:
Camera chain - cam0:
Camera model: pinhole
Focal length: [552.357544, 319.346027]
Principal point: [553.012817, 242.821647]
Distortion model: radtan
Distortion coefficients: [-0.010014, -0.046626, 0.001439, -0.010307]
baseline: no data available
Initializing camera rosbag dataset reader:
Dataset: bags/2014-09-16_MTi_Logitech.bag
Topic: /logitech_camera/image_mono
Number of images: 542
Extracting calibration target corners
Extracted corners for 234 images (of 542 images)
Building the problem
Spline order: 6
Pose knots per second: 70
Do pose motion regularization: False
xddot translation variance: 1000000.000000
xddot rotation variance: 100000.000000
Bias knots per second: 50
Do bias motion regularization: True
Blake-Zisserman on reprojection errors -1
Acceleration Huber width (m/s^2): -1.000000
Gyroscope Huber width (rad/s): -1.000000
Do time calibration: False
Max iterations: 30
Time offset padding: 0.020000
Estimating imu-camera rotation prior
Initializing a pose spline with 3209 knots (100.000000 knots per second over 32.089584 seconds)
Orientation prior camera-imu found as: (T_i_c)
[[ 0.46025562 -0.86734089 -0.18943216]
[-0.43555497 -0.03467324 -0.8994941 ]
[ 0.77359979 0.49650533 -0.39373319]]
Gyro bias prior found as: (b_gyro)
[ 0.00002854 0.02020249 0.00716996]
Initializing a pose spline with 3217 knots (100.000000 knots per second over 32.169584 seconds)
Initializing the bias splines with 1608 knots
Adding camera error terms (/logitech_camera/image_mono)
Added 234 camera error terms
Adding accelerometer error terms (/MTi/imu/data)
Added 6308 of 6326 accelerometer error terms (skipped 18 out-of-bounds measurements)
Adding gyroscope error terms (/MTi/imu/data)
Added 6308 of 6326 gyroscope error terms (skipped 18 out-of-bounds measurements)
Before Optimization
===================
Reprojection error squarred (cam0): mean 260.458975185, median 44.9971194751, std: 1521.79897212
Gyro error squarred (imu0): mean 2.73860466658, median 0.31017762183, std: 12.6021372468
Accelerometer error squarred (imu0): mean 56959.4726276, median 11277.4307951, std: 206568.294371
Transformation T_cam0_imu0 (imu0 to cam0, T_ci): [m]
[[ 0.46025562 -0.86734089 -0.18943216 0. ]
[-0.43555497 -0.03467324 -0.8994941 0. ]
[ 0.77359979 0.49650533 -0.39373319 0. ]
[ 0. 0. 0. 1. ]]
Optimizing...
No linear system solver set in the options. Defaulting to the sparse_cholesky solver
Using the sparse_cholesky linear system solver
Using the levenberg_marquardt trust region policy
No linear system solver set in the options. Defaulting to the sparse_cholesky solver
Using the sparse_cholesky linear system solver
Using the levenberg_marquardt trust region policy
Initializing
Optimization problem initialized with 6451 design variables and 39543 error terms
The Jacobian matrix is 143158 x 29018
[0.0]: J: 3.65493e+08
[1]: J: 8.03805e+07, dJ: 2.85113e+08, deltaX: 0.954535, LM - lambda:100 mu:2
[2]: J: 1.91358e+07, dJ: 6.12447e+07, deltaX: 1.0771, LM - lambda:73.6945 mu:2
[3]: J: 5.28811e+06, dJ: 1.38477e+07, deltaX: 0.633379, LM - lambda:57.6911 mu:2
[4]: J: 2.59335e+06, dJ: 2.69476e+06, deltaX: 0.662232, LM - lambda:39.6069 mu:2
[5]: J: 2.305e+06, dJ: 288347, deltaX: 0.625848, LM - lambda:13.2023 mu:2
[6]: J: 2.22895e+06, dJ: 76052.6, deltaX: 0.69984, LM - lambda:10.6619 mu:2
[7]: J: 2.0712e+06, dJ: 157744, deltaX: 0.481966, LM - lambda:10.8057 mu:2
[8]: J: 2.04691e+06, dJ: 24289, deltaX: 1.84833, LM - lambda:4.72456 mu:2
[9]: J: 2.02451e+06, dJ: 22401.3, deltaX: 1.77223, LM - lambda:4.3185 mu:2
[10]: J: 2.02027e+06, dJ: 4241.26, deltaX: 1.73887, LM - lambda:3.29367 mu:2
Last step was a regression. Reverting
[11]: J: 2.02336e+06, dJ: -3086.09, deltaX: 0.924633, LM - lambda:3.56018 mu:2
[12]: J: 2.01346e+06, dJ: 6814.27, deltaX: 0.283551, LM - lambda:14.2407 mu:4
[13]: J: 2.01087e+06, dJ: 2583.69, deltaX: 0.514764, LM - lambda:4.74691 mu:2
[14]: J: 2.00984e+06, dJ: 1032.71, deltaX: 0.461089, LM - lambda:4.77602 mu:2
[15]: J: 2.00811e+06, dJ: 1731.46, deltaX: 0.235375, LM - lambda:5.99634 mu:2
[16]: J: 2.00708e+06, dJ: 1024.98, deltaX: 0.210649, LM - lambda:6.21577 mu:2
[17]: J: 2.00613e+06, dJ: 955.506, deltaX: 0.242431, LM - lambda:6.84046 mu:2
[18]: J: 2.00402e+06, dJ: 2105.12, deltaX: 0.227686, LM - lambda:7.81715 mu:2
Last step was a regression. Reverting
[19]: J: 2.00441e+06, dJ: -391.066, deltaX: 0.158958, LM - lambda:7.81715 mu:2
Last step was a regression. Reverting
[20]: J: 2.005e+06, dJ: -972.775, deltaX: 0.0810729, LM - lambda:31.2686 mu:4
Last step was a regression. Reverting
[21]: J: 2.00506e+06, dJ: -1033.01, deltaX: 0.00879375, LM - lambda:250.149 mu:8
Last step was a regression. Reverting
[22]: J: 2.00505e+06, dJ: -1030.7, deltaX: 9.39473e-05, LM - lambda:4002.38 mu:16
After Optimization (Results)
==================
Reprojection error squarred (cam0): mean 78.5482118772, median 30.7082427419, std: 155.944587191
Gyro error squarred (imu0): mean 10.4191277827, median 0.822735147641, std: 35.2401288105
Accelerometer error squarred (imu0): mean 4.61415182016, median 1.01756821991, std: 28.3758421756
Transformation T_cam0_imu0 (imu0 to cam0, T_ci): [m]
[[-0.01321562 -0.93926668 -0.3429336 -0.18742504]
[-0.12249658 0.34190103 -0.93171791 0.41159008]
[ 0.99238094 0.02969496 -0.11957539 0.17331581]
[ 0. 0. 0. 1. ]]
Saving calibration to file: camchain-imucam-bags2014-09-16_MTi_Logitech.yaml
Detailed results written to file: results-imucam-bags2014-09-16_MTi_Logitech.txt
Generating result report...
Traceback (most recent call last):
File "/home/pkok/ros/repos/kalibr/src/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 206, in <module>
main()
File "/home/pkok/ros/repos/kalibr/src/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 202, in main
util.generateReport(iCal, filename=reportFile, showOnScreen=not parsed.dontShowReport)
File "/home/pkok/ros/repos/kalibr/src/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccUtil.py", line 77, in generateReport
f = pl.figure(3010+iidx)
File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 423, in figure
**kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.py", line 79, in new_figure_manager
return new_figure_manager_given_figure(num, figure)
File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.py", line 87, in new_figure_manager_given_figure
window = Tk.Tk()
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1767, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable