双目IMU标定
xhost +local:root
FOLDER=/media/kobosp/T7/BafFileExt/CalibraStereoImu/data/K522D
sudo docker run -it -e "DISPLAY" -e "QT_X11_NO_MITSHM=1" -v "/tmp/.X11-unix:/tmp/.X11-unix:rw" -v "$FOLDER:/data" kalibr
source devel/setup.bash
rosrun kalibr kalibr_calibrate_cameras --models pinhole-equi pinhole-equi --topics /camera/left/image_raw /camera/right/image_raw --bag ../data/SC.bag --target ../data/april6.yaml
rosrun kalibr kalibr_calibrate_cameras --models pinhole-radtan pinhole-radtan --topics /camera/left/image_raw /camera/right/image_raw --bag ../data/SC.bag --target ../data/april6.yaml
NUC12
xhost +local:root
FOLDER=/home/kobosp/kalibr/K522D
sudo docker run -it -e "DISPLAY" -e "QT_X11_NO_MITSHM=1" -v "/tmp/.X11-unix:/tmp/.X11-unix:rw" -v "$FOLDER:/data" kalibr
source devel/setup.bash
rosrun kalibr kalibr_calibrate_cameras --models pinhole-radtan pinhole-radtan --topics /camera/left/image_raw /camera/right/image_raw --bag ../data/StereoCalib.bag --target ../data/april6.yaml
xhost +local:root
FOLDER=/home/kobosp/kalibr/K522D
sudo docker run -it -e "DISPLAY" -e "QT_X11_NO_MITSHM=1" -v "/tmp/.X11-unix:/tmp/.X11-unix:rw" -v "$FOLDER:/data" kalibr
source devel/setup.bash
rosrun kalibr kalibr_calibrate_imu_camera --cam ../data/data/K522D/Stereo-camchain.yaml --target ../data/data/K522D/april6.yaml --imu ../data/data/K522D/ImuPX4.yaml --bag ../data/StereoImuRaw.bag
rosrun kalibr kalibr_calibrate_imu_camera --cam ../data/Stereo-camchain.yaml --target ../data/april6.yaml --imu ../data/ImuPX4.yaml --bag ../data/StereoImuRestamp.bag
rosrun kalibr kalibr_calibrate_imu_camera --cam ../data/cam_april-camchain.yaml --target ../data/april_6x6_80x80cm.yaml --imu ../data/imu_adis16448.yaml --bag ../data/imu_april.bag
kobosp@NUC8i5:~/ETHkalibr$ xhost +local:root
non-network local connections being added to access control list
kobosp@NUC8i5:~/ETHkalibr$ FOLDER=/home/kobosp/ETHkalibr/data/K522D/
kobosp@NUC8i5:~/ETHkalibr$ sudo docker run -it -e "DISPLAY" -e "QT_X11_NO_MITSHM=1" -v "/tmp/.X11-unix:/tmp/.X11-unix:rw" -v "$FOLDER:/data" kalibr
[sudo] kobosp 的密码:
102对不起,请重试。
[sudo] kobosp 的密码:
root@9dae1e48b945:/catkin_ws# exit
exit
kobosp@NUC8i5:~/ETHkalibr$ sudo docker run -it -e "DISPLAY" -e "QT_X11_NO_MITSHM=1" -v "/tmp/.X11-unix:/tmp/.X11-unix:rw" -v "$FOLDER:/data" kalibr
root@daec1d724e26:/catkin_ws# source devel/setup.bash
root@daec1d724e26:/catkin_ws# rosrun kalibr kalibr_calibrate_imu_camera --cam ../data/Stereo-camchain.yaml --target ../data/april6.yaml --imu ../data/ImuPX4.yaml --bag ../data/RestampStereoImu.bag
importing libraries
Initializing IMUs:
Update rate: 200.0
Accelerometer:
Noise density: 0.013178197378576464
Noise density (discrete): 0.18636785460412406
Random walk: 0.0003957063244250979
Gyroscope:
Noise density: 0.0007561898045069295
Noise density (discrete): 0.01069413877261959
Random walk: 3.64801041874673e-05
Initializing imu rosbag dataset reader:
Dataset: ../data/RestampStereoImu.bag
Topic: /mavros/imu/data_raw
Traceback (most recent call last):
File "/catkin_ws/devel/lib/kalibr/kalibr_calibrate_imu_camera", line 15, in <module>
exec(compile(fh.read(), python_script, 'exec'), context)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 247, in <module>
main()
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 154, in main
imus.append( sens.IccImu(imuConfig, parsed, isReferenceImu=(not imus), \
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 593, in __init__
self.dataset = initImuBagDataset(parsed.bagfile[0], imuConfig.getRosTopic(), \
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 34, in initImuBagDataset
reader = kc.BagImuDatasetReader(bagfile, topic, bag_from_to=from_to, \
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_common/ImuDatasetReader.py", line 31, in __init__
self.bag = rosbag.Bag(bagfile)
File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 467, in __init__
self._open(f, mode, allow_unindexed)
File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 1428, in _open
if mode == 'r': self._open_read(f, allow_unindexed)
File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 1450, in _open_read
self._file = open(f, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '../data/RestampStereoImu.bag'
root@daec1d724e26:/catkin_ws# rosrun kalibr kalibr_calibrate_imu_camera --cam ../data/Stereo-camchain.yaml --target ../data/april6.yaml --imu ../data/ImuPX4.yaml --bag ../data/RestampStereoImu.bagexit
importing libraries
Initializing IMUs:
Update rate: 200.0
Accelerometer:
Noise density: 0.013178197378576464
Noise density (discrete): 0.18636785460412406
Random walk: 0.0003957063244250979
Gyroscope:
Noise density: 0.0007561898045069295
Noise density (discrete): 0.01069413877261959
Random walk: 3.64801041874673e-05
Initializing imu rosbag dataset reader:
Dataset: ../data/RestampStereoImu.bagexit
Topic: /mavros/imu/data_raw
Traceback (most recent call last):
File "/catkin_ws/devel/lib/kalibr/kalibr_calibrate_imu_camera", line 15, in <module>
exec(compile(fh.read(), python_script, 'exec'), context)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 247, in <module>
main()
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 154, in main
imus.append( sens.IccImu(imuConfig, parsed, isReferenceImu=(not imus), \
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 593, in __init__
self.dataset = initImuBagDataset(parsed.bagfile[0], imuConfig.getRosTopic(), \
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 34, in initImuBagDataset
reader = kc.BagImuDatasetReader(bagfile, topic, bag_from_to=from_to, \
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_common/ImuDatasetReader.py", line 31, in __init__
self.bag = rosbag.Bag(bagfile)
File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 467, in __init__
self._open(f, mode, allow_unindexed)
File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 1428, in _open
if mode == 'r': self._open_read(f, allow_unindexed)
File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 1450, in _open_read
self._file = open(f, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '../data/RestampStereoImu.bagexit'
root@daec1d724e26:/catkin_ws# exit
exit
kobosp@NUC8i5:~/ETHkalibr$ FOLDER=/home/kobosp/ETHkalibr/data/K522D/
kobosp@NUC8i5:~/ETHkalibr$ sudo docker run -it -e "DISPLAY" -e "QT_X11_NO_MITSHM=1" -v "/tmp/.X11-unix:/tmp/.X11-unix:rw" -v "$FOLDER:/data" kalibr
source devel/setup.bash
root@026e7d150c80:/catkin_ws# source devel/setup.bash
root@026e7d150c80:/catkin_ws# rosrun kalibr kalibr_calibrate_imu_camera --cam ../data/Stereo-camchain.yaml --target ../data/april6.yaml --imu ../data/ImuPX4.yaml --bag ../data/RestampStereoImu.bag
importing libraries
Initializing IMUs:
Update rate: 200.0
Accelerometer:
Noise density: 0.013178197378576464
Noise density (discrete): 0.18636785460412406
Random walk: 0.0003957063244250979
Gyroscope:
Noise density: 0.0007561898045069295
Noise density (discrete): 0.01069413877261959
Random walk: 3.64801041874673e-05
Initializing imu rosbag dataset reader:
Dataset: ../data/RestampStereoImu.bag
Topic: /mavros/imu/data_raw
Traceback (most recent call last):
File "/catkin_ws/devel/lib/kalibr/kalibr_calibrate_imu_camera", line 15, in <module>
exec(compile(fh.read(), python_script, 'exec'), context)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 247, in <module>
main()
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 154, in main
imus.append( sens.IccImu(imuConfig, parsed, isReferenceImu=(not imus), \
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 593, in __init__
self.dataset = initImuBagDataset(parsed.bagfile[0], imuConfig.getRosTopic(), \
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 34, in initImuBagDataset
reader = kc.BagImuDatasetReader(bagfile, topic, bag_from_to=from_to, \
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_common/ImuDatasetReader.py", line 31, in __init__
self.bag = rosbag.Bag(bagfile)
File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 467, in __init__
self._open(f, mode, allow_unindexed)
File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 1428, in _open
if mode == 'r': self._open_read(f, allow_unindexed)
File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 1450, in _open_read
self._file = open(f, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '../data/RestampStereoImu.bag'
root@026e7d150c80:/catkin_ws# ls
build devel logs src
root@026e7d150c80:/catkin_ws# cd ..
root@026e7d150c80:/# ls
bin data home lib64 mnt root sbin tmp
boot dev lib libx32 opt ros_entrypoint.sh srv usr
catkin_ws etc lib32 media proc run sys var
root@026e7d150c80:/# cd data/
root@026e7d150c80:/data# ls
ImuPX4.yaml Stereo-results-cam.txt StereoImuRestamp.bag
Stereo-camchain.yaml Stereo.bag april6.yaml
Stereo-report-cam.pdf StereoImu.bag restamp_bag.py
root@026e7d150c80:/data# cd ../catkin_ws/
root@026e7d150c80:/catkin_ws# rosrun kalibr kalibr_calibrate_imu_camera --cam ../data/Stereo-camchain.yaml --target ../data/april6.yaml --imu ../data/ImuPX4.yaml --bag ../data/StereoImu
../data/StereoImu.bag ../data/StereoImuRestamp.bag
root@026e7d150c80:/catkin_ws# rosrun kalibr kalibr_calibrate_imu_camera --cam ../data/Stereo-camchain.yaml --target ../data/april6.yaml --imu ../data/ImuPX4.yaml --bag ../data/StereoImuRestamp.bag
importing libraries
Initializing IMUs:
Update rate: 200.0
Accelerometer:
Noise density: 0.013178197378576464
Noise density (discrete): 0.18636785460412406
Random walk: 0.0003957063244250979
Gyroscope:
Noise density: 0.0007561898045069295
Noise density (discrete): 0.01069413877261959
Random walk: 3.64801041874673e-05
Initializing imu rosbag dataset reader:
Dataset: ../data/StereoImuRestamp.bag
Topic: /mavros/imu/data_raw
Number of messages: 63496
Reading IMU data (/mavros/imu/data_raw)
Read 63496 imu readings over 322.1 seconds
Initializing calibration target:
Type: aprilgrid
Tags:
Rows: 6
Cols: 6
Size: 0.088 [m]
Spacing 0.026487999999999998 [m]
Initializing camera chain:
Camera chain - cam0:
Camera model: pinhole
Focal length: [773.03583, 777.516443]
Principal point: [672.617788, 372.522376]
Distortion model: equidistant
Distortion coefficients: [-0.297926, 0.077062, 3e-05, -0.000558]
baseline: no data available
Camera chain - cam1:
Camera model: pinhole
Focal length: [773.934111, 778.673235]
Principal point: [599.921196, 373.44009]
Distortion model: equidistant
Distortion coefficients: [-0.303576, 0.082196, 0.000697, -0.001685]
baseline: [[ 0.99997573 0.0011333 -0.00687465 0.07017293]
[-0.00120622 0.99994295 -0.01061327 -0.00005874]
[ 0.00686223 0.01062131 0.99992005 -0.0001976 ]
[ 0. 0. 0. 1. ]]
Initializing camera rosbag dataset reader:
Dataset: ../data/StereoImuRestamp.bag
Topic: /camera/left/image_raw
Number of images: 1610
Extracting calibration target corners
Extracted corners for 1574 images (of 1610 images)
Initializing camera rosbag dataset reader:
Dataset: ../data/StereoImuRestamp.bag
Topic: /camera/right/image_raw
Number of images: 1610
Extracting calibration target corners
Extracted corners for 1581 images (of 1610 images)
Baseline between cam0 and cam1 set to:
T= [[ 0.99997573 0.0011333 -0.00687465 0.07017293]
[-0.00120622 0.99994295 -0.01061327 -0.00005874]
[ 0.00686223 0.01062131 0.99992005 -0.0001976 ]
[ 0. 0. 0. 1. ]]
Baseline: 0.07017323260714177 [m]
Building the problem
Spline order: 6
Pose knots per second: 100
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 (sigma): -1.000000
Gyroscope Huber width (sigma): -1.000000
Do time calibration: True
Max iterations: 30
Time offset padding: 0.030000
Estimating time shift camera to imu:
Initializing a pose spline with 0 knots (100.000000 knots per second over 0.000000 seconds)
Traceback (most recent call last):
File "/catkin_ws/devel/lib/kalibr/kalibr_calibrate_imu_camera", line 15, in <module>
exec(compile(fh.read(), python_script, 'exec'), context)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 247, in <module>
main()
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 189, in main
iCal.buildProblem(splineOrder=6,
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccCalibrator.py", line 105, in buildProblem
cam.findTimeshiftCameraImuPrior(self.ImuList[0], verbose)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 221, in findTimeshiftCameraImuPrior
poseSpline = self.initPoseSplineFromCamera( timeOffsetPadding=0.0 )
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 315, in initPoseSplineFromCamera
pose.initPoseSplineSparse(times, curve, knots, 1e-4)
RuntimeError: [Exception] /catkin_ws/src/kalibr/aslam_nonparametric_estimation/bsplines/src/BSpline.cpp:970: initSplineSparse() assert(numSegments >= 1) failed [0 >= 1]: There must be at least one time segment
root@026e7d150c80:/catkin_ws# rosrun kalibr kalibr_calibrate_imu_camera --cam ../data/Stereo-camchain.yaml --target ../data/april6.yaml --imu ../data/ImuPX4.yaml --bag ../data/StereoImuRestamp.bag
importing libraries
Initializing IMUs:
Update rate: 200.0
Accelerometer:
Noise density: 0.013178197378576464
Noise density (discrete): 0.18636785460412406
Random walk: 0.0003957063244250979
Gyroscope:
Noise density: 0.0007561898045069295
Noise density (discrete): 0.01069413877261959
Random walk: 3.64801041874673e-05
Initializing imu rosbag dataset reader:
Dataset: ../data/StereoImuRestamp.bag
Topic: /mavros/imu/data_raw
Number of messages: 63496
Reading IMU data (/mavros/imu/data_raw)
Read 63496 imu readings over 322.1 seconds
Initializing calibration target:
Type: aprilgrid
Tags:
Rows: 6
Cols: 6
Size: 0.088 [m]
Spacing 0.026487999999999998 [m]
Initializing camera chain:
Camera chain - cam0:
Camera model: pinhole
Focal length: [773.03583, 777.516443]
Principal point: [672.617788, 372.522376]
Distortion model: equidistant
Distortion coefficients: [-0.297926, 0.077062, 3e-05, -0.000558]
baseline: no data available
Camera chain - cam1:
Camera model: pinhole
Focal length: [773.934111, 778.673235]
Principal point: [599.921196, 373.44009]
Distortion model: equidistant
Distortion coefficients: [-0.303576, 0.082196, 0.000697, -0.001685]
baseline: [[ 0.99997573 0.0011333 -0.00687465 0.07017293]
[-0.00120622 0.99994295 -0.01061327 -0.00005874]
[ 0.00686223 0.01062131 0.99992005 -0.0001976 ]
[ 0. 0. 0. 1. ]]
Initializing camera rosbag dataset reader:
Dataset: ../data/StereoImuRestamp.bag
Topic: /camera/left/image_raw
Number of images: 1610
Extracting calibration target corners
Extracted corners for 1574 images (of 1610 images)
Initializing camera rosbag dataset reader:
Dataset: ../data/StereoImuRestamp.bag
Topic: /camera/right/image_raw
Number of images: 1610
Extracting calibration target corners
Extracted corners for 1581 images (of 1610 images)
Baseline between cam0 and cam1 set to:
T= [[ 0.99997573 0.0011333 -0.00687465 0.07017293]
[-0.00120622 0.99994295 -0.01061327 -0.00005874]
[ 0.00686223 0.01062131 0.99992005 -0.0001976 ]
[ 0. 0. 0. 1. ]]
Baseline: 0.07017323260714177 [m]
Building the problem
Spline order: 6
Pose knots per second: 100
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 (sigma): -1.000000
Gyroscope Huber width (sigma): -1.000000
Do time calibration: True
Max iterations: 30
Time offset padding: 0.030000
Estimating time shift camera to imu:
Initializing a pose spline with 0 knots (100.000000 knots per second over 0.000000 seconds)
Traceback (most recent call last):
File "/catkin_ws/devel/lib/kalibr/kalibr_calibrate_imu_camera", line 15, in <module>
exec(compile(fh.read(), python_script, 'exec'), context)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 247, in <module>
main()
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 189, in main
iCal.buildProblem(splineOrder=6,
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccCalibrator.py", line 105, in buildProblem
cam.findTimeshiftCameraImuPrior(self.ImuList[0], verbose)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 221, in findTimeshiftCameraImuPrior
poseSpline = self.initPoseSplineFromCamera( timeOffsetPadding=0.0 )
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 315, in initPoseSplineFromCamera
pose.initPoseSplineSparse(times, curve, knots, 1e-4)
RuntimeError: [Exception] /catkin_ws/src/kalibr/aslam_nonparametric_estimation/bsplines/src/BSpline.cpp:970: initSplineSparse() assert(numSegments >= 1) failed [0 >= 1]: There must be at least one time segment
root@026e7d150c80:/catkin_ws# rosrun kalibr kalibr_calibrate_imu_camera --cam ../data/Stereo-camchain.yaml --target ../data/april6.yaml --imu ../data/ImuPX4.yaml --bag ../data/StereoImuRestamp.bag
importing libraries
Initializing IMUs:
Update rate: 200.0
Accelerometer:
Noise density: 0.013178197378576464
Noise density (discrete): 0.18636785460412406
Random walk: 0.0003957063244250979
Gyroscope:
Noise density: 0.0007561898045069295
Noise density (discrete): 0.01069413877261959
Random walk: 3.64801041874673e-05
Initializing imu rosbag dataset reader:
Dataset: ../data/StereoImuRestamp.bag
Topic: /mavros/imu/data_raw
Number of messages: 63496
Reading IMU data (/mavros/imu/data_raw)
Read 63496 imu readings over 322.1 seconds
Initializing calibration target:
Type: aprilgrid
Tags:
Rows: 6
Cols: 6
Size: 0.088 [m]
Spacing 0.026487999999999998 [m]
Initializing camera chain:
Camera chain - cam0:
Camera model: pinhole
Focal length: [773.03583, 777.516443]
Principal point: [672.617788, 372.522376]
Distortion model: equidistant
Distortion coefficients: [-0.297926, 0.077062, 3e-05, -0.000558]
baseline: no data available
Camera chain - cam1:
Camera model: pinhole
Focal length: [773.934111, 778.673235]
Principal point: [599.921196, 373.44009]
Distortion model: equidistant
Distortion coefficients: [-0.303576, 0.082196, 0.000697, -0.001685]
baseline: [[ 0.99997573 0.0011333 -0.00687465 0.07017293]
[-0.00120622 0.99994295 -0.01061327 -0.00005874]
[ 0.00686223 0.01062131 0.99992005 -0.0001976 ]
[ 0. 0. 0. 1. ]]
Initializing camera rosbag dataset reader:
Dataset: ../data/StereoImuRestamp.bag
Topic: /camera/left/image_raw
Number of images: 1610
Extracting calibration target corners
Extracted corners for 1574 images (of 1610 images)
Initializing camera rosbag dataset reader:
Dataset: ../data/StereoImuRestamp.bag
Topic: /camera/right/image_raw
Number of images: 1610
Extracting calibration target corners
Extracted corners for 1581 images (of 1610 images)
Baseline between cam0 and cam1 set to:
T= [[ 0.99997573 0.0011333 -0.00687465 0.07017293]
[-0.00120622 0.99994295 -0.01061327 -0.00005874]
[ 0.00686223 0.01062131 0.99992005 -0.0001976 ]
[ 0. 0. 0. 1. ]]
Baseline: 0.07017323260714177 [m]
Building the problem
Spline order: 6
Pose knots per second: 100
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 (sigma): -1.000000
Gyroscope Huber width (sigma): -1.000000
Do time calibration: True
Max iterations: 30
Time offset padding: 0.030000
Estimating time shift camera to imu:
Initializing a pose spline with 0 knots (100.000000 knots per second over 0.000000 seconds)
Traceback (most recent call last):
File "/catkin_ws/devel/lib/kalibr/kalibr_calibrate_imu_camera", line 15, in <module>
exec(compile(fh.read(), python_script, 'exec'), context)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 247, in <module>
main()
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 189, in main
iCal.buildProblem(splineOrder=6,
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccCalibrator.py", line 105, in buildProblem
cam.findTimeshiftCameraImuPrior(self.ImuList[0], verbose)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 221, in findTimeshiftCameraImuPrior
poseSpline = self.initPoseSplineFromCamera( timeOffsetPadding=0.0 )
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 315, in initPoseSplineFromCamera
pose.initPoseSplineSparse(times, curve, knots, 1e-4)
RuntimeError: [Exception] /catkin_ws/src/kalibr/aslam_nonparametric_estimation/bsplines/src/BSpline.cpp:970: initSplineSparse() assert(numSegments >= 1) failed [0 >= 1]: There must be at least one time segment
root@026e7d150c80:/catkin_ws# rosrun kalibr kalibr_calibrate_imu_camera --cam ../data/Stereo-camchain.yaml --target ../data/april6.yaml --imu ../data/ImuPX4.yaml --bag ../data/StereoImuRestamp.bag
importing libraries
Initializing IMUs:
Update rate: 200.0
Accelerometer:
Noise density: 0.013178197378576464
Noise density (discrete): 0.18636785460412406
Random walk: 0.0003957063244250979
Gyroscope:
Noise density: 0.0007561898045069295
Noise density (discrete): 0.01069413877261959
Random walk: 3.64801041874673e-05
Initializing imu rosbag dataset reader:
Dataset: ../data/StereoImuRestamp.bag
Topic: /mavros/imu/data_raw
Number of messages: 63496
Reading IMU data (/mavros/imu/data_raw)
Read 63496 imu readings over 322.1 seconds
Initializing calibration target:
Type: aprilgrid
Tags:
Rows: 6
Cols: 6
Size: 0.088 [m]
Spacing 0.026487999999999998 [m]
Initializing camera chain:
Camera chain - cam0:
Camera model: pinhole
Focal length: [773.03583, 777.516443]
Principal point: [672.617788, 372.522376]
Distortion model: equidistant
Distortion coefficients: [-0.297926, 0.077062, 3e-05, -0.000558]
baseline: no data available
Camera chain - cam1:
Camera model: pinhole
Focal length: [773.934111, 778.673235]
Principal point: [599.921196, 373.44009]
Distortion model: equidistant
Distortion coefficients: [-0.303576, 0.082196, 0.000697, -0.001685]
baseline: [[ 0.99997573 0.0011333 -0.00687465 0.07017293]
[-0.00120622 0.99994295 -0.01061327 -0.00005874]
[ 0.00686223 0.01062131 0.99992005 -0.0001976 ]
[ 0. 0. 0. 1. ]]
Initializing camera rosbag dataset reader:
Dataset: ../data/StereoImuRestamp.bag
Topic: /camera/left/image_raw
Number of images: 1610
Extracting calibration target corners
Extracted corners for 1574 images (of 1610 images)
Initializing camera rosbag dataset reader:
Dataset: ../data/StereoImuRestamp.bag
Topic: /camera/right/image_raw
Number of images: 1610
Extracting calibration target corners
Extracted corners for 1581 images (of 1610 images)
Baseline between cam0 and cam1 set to:
T= [[ 0.99997573 0.0011333 -0.00687465 0.07017293]
[-0.00120622 0.99994295 -0.01061327 -0.00005874]
[ 0.00686223 0.01062131 0.99992005 -0.0001976 ]
[ 0. 0. 0. 1. ]]
Baseline: 0.07017323260714177 [m]
Building the problem
Spline order: 6
Pose knots per second: 100
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 (sigma): -1.000000
Gyroscope Huber width (sigma): -1.000000
Do time calibration: True
Max iterations: 30
Time offset padding: 0.030000
Estimating time shift camera to imu:
Initializing a pose spline with 0 knots (100.000000 knots per second over 0.000000 seconds)
Traceback (most recent call last):
File "/catkin_ws/devel/lib/kalibr/kalibr_calibrate_imu_camera", line 15, in <module>
exec(compile(fh.read(), python_script, 'exec'), context)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 247, in <module>
main()
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 189, in main
iCal.buildProblem(splineOrder=6,
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccCalibrator.py", line 105, in buildProblem
cam.findTimeshiftCameraImuPrior(self.ImuList[0], verbose)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 221, in findTimeshiftCameraImuPrior
poseSpline = self.initPoseSplineFromCamera( timeOffsetPadding=0.0 )
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 315, in initPoseSplineFromCamera
pose.initPoseSplineSparse(times, curve, knots, 1e-4)
RuntimeError: [Exception] /catkin_ws/src/kalibr/aslam_nonparametric_estimation/bsplines/src/BSpline.cpp:970: initSplineSparse() assert(numSegments >= 1) failed [0 >= 1]: There must be at least one time segment
root@026e7d150c80:/catkin_ws# rosrun kalibr kalibr_calibrate_imu_camera --cam ../data/Stereo-camchain.yaml --target ../data/april6.yaml --imu ../data/ImuPX4.yaml --bag ../data/StereoImuRestamp.bag --timeoffset-padding 0.1
importing libraries
Initializing IMUs:
Update rate: 200.0
Accelerometer:
Noise density: 0.013178197378576464
Noise density (discrete): 0.18636785460412406
Random walk: 0.0003957063244250979
Gyroscope:
Noise density: 0.0007561898045069295
Noise density (discrete): 0.01069413877261959
Random walk: 3.64801041874673e-05
Initializing imu rosbag dataset reader:
Dataset: ../data/StereoImuRestamp.bag
Topic: /mavros/imu/data_raw
Number of messages: 63496
Reading IMU data (/mavros/imu/data_raw)
Read 63496 imu readings over 322.1 seconds
Initializing calibration target:
Type: aprilgrid
Tags:
Rows: 6
Cols: 6
Size: 0.088 [m]
Spacing 0.026487999999999998 [m]
Initializing camera chain:
Camera chain - cam0:
Camera model: pinhole
Focal length: [773.03583, 777.516443]
Principal point: [672.617788, 372.522376]
Distortion model: equidistant
Distortion coefficients: [-0.297926, 0.077062, 3e-05, -0.000558]
baseline: no data available
Camera chain - cam1:
Camera model: pinhole
Focal length: [773.934111, 778.673235]
Principal point: [599.921196, 373.44009]
Distortion model: equidistant
Distortion coefficients: [-0.303576, 0.082196, 0.000697, -0.001685]
baseline: [[ 0.99997573 0.0011333 -0.00687465 0.07017293]
[-0.00120622 0.99994295 -0.01061327 -0.00005874]
[ 0.00686223 0.01062131 0.99992005 -0.0001976 ]
[ 0. 0. 0. 1. ]]
Initializing camera rosbag dataset reader:
Dataset: ../data/StereoImuRestamp.bag
Topic: /camera/left/image_raw
Number of images: 1610
Extracting calibration target corners
Extracted corners for 1574 images (of 1610 images)
Initializing camera rosbag dataset reader:
Dataset: ../data/StereoImuRestamp.bag
Topic: /camera/right/image_raw
Number of images: 1610
Extracting calibration target corners
Extracted corners for 1581 images (of 1610 images)
Baseline between cam0 and cam1 set to:
T= [[ 0.99997573 0.0011333 -0.00687465 0.07017293]
[-0.00120622 0.99994295 -0.01061327 -0.00005874]
[ 0.00686223 0.01062131 0.99992005 -0.0001976 ]
[ 0. 0. 0. 1. ]]
Baseline: 0.07017323260714177 [m]
Building the problem
Spline order: 6
Pose knots per second: 100
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 (sigma): -1.000000
Gyroscope Huber width (sigma): -1.000000
Do time calibration: True
Max iterations: 30
Time offset padding: 0.100000
Estimating time shift camera to imu:
Initializing a pose spline with 0 knots (100.000000 knots per second over 0.000000 seconds)
Traceback (most recent call last):
File "/catkin_ws/devel/lib/kalibr/kalibr_calibrate_imu_camera", line 15, in <module>
exec(compile(fh.read(), python_script, 'exec'), context)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 247, in <module>
main()
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 189, in main
iCal.buildProblem(splineOrder=6,
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccCalibrator.py", line 105, in buildProblem
cam.findTimeshiftCameraImuPrior(self.ImuList[0], verbose)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 221, in findTimeshiftCameraImuPrior
poseSpline = self.initPoseSplineFromCamera( timeOffsetPadding=0.0 )
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 315, in initPoseSplineFromCamera
pose.initPoseSplineSparse(times, curve, knots, 1e-4)
RuntimeError: [Exception] /catkin_ws/src/kalibr/aslam_nonparametric_estimation/bsplines/src/BSpline.cpp:970: initSplineSparse() assert(numSegments >= 1) failed [0 >= 1]: There must be at least one time segment
root@026e7d150c80:/catkin_ws# rosrun kalibr kalibr_calibrate_imu_camera --cam ../data/Stereo-camchain.yaml --target ../data/april6.yaml --imu ../data/ImuPX4.yaml --bag ../data/StereoImuRestamp.bag --timeoffset-padding 0.005
importing libraries
Initializing IMUs:
Update rate: 200.0
Accelerometer:
Noise density: 0.013178197378576464
Noise density (discrete): 0.18636785460412406
Random walk: 0.0003957063244250979
Gyroscope:
Noise density: 0.0007561898045069295
Noise density (discrete): 0.01069413877261959
Random walk: 3.64801041874673e-05
Initializing imu rosbag dataset reader:
Dataset: ../data/StereoImuRestamp.bag
Topic: /mavros/imu/data_raw
Number of messages: 63496
Reading IMU data (/mavros/imu/data_raw)
Read 63496 imu readings over 322.1 seconds
Initializing calibration target:
Type: aprilgrid
Tags:
Rows: 6
Cols: 6
Size: 0.088 [m]
Spacing 0.026487999999999998 [m]
Initializing camera chain:
Camera chain - cam0:
Camera model: pinhole
Focal length: [773.03583, 777.516443]
Principal point: [672.617788, 372.522376]
Distortion model: equidistant
Distortion coefficients: [-0.297926, 0.077062, 3e-05, -0.000558]
baseline: no data available
Camera chain - cam1:
Camera model: pinhole
Focal length: [773.934111, 778.673235]
Principal point: [599.921196, 373.44009]
Distortion model: equidistant
Distortion coefficients: [-0.303576, 0.082196, 0.000697, -0.001685]
baseline: [[ 0.99997573 0.0011333 -0.00687465 0.07017293]
[-0.00120622 0.99994295 -0.01061327 -0.00005874]
[ 0.00686223 0.01062131 0.99992005 -0.0001976 ]
[ 0. 0. 0. 1. ]]
Initializing camera rosbag dataset reader:
Dataset: ../data/StereoImuRestamp.bag
Topic: /camera/left/image_raw
Number of images: 1610
Extracting calibration target corners
Extracted corners for 1574 images (of 1610 images)
Initializing camera rosbag dataset reader:
Dataset: ../data/StereoImuRestamp.bag
Topic: /camera/right/image_raw
Number of images: 1610
Extracting calibration target corners
Extracted corners for 1581 images (of 1610 images)
Baseline between cam0 and cam1 set to:
T= [[ 0.99997573 0.0011333 -0.00687465 0.07017293]
[-0.00120622 0.99994295 -0.01061327 -0.00005874]
[ 0.00686223 0.01062131 0.99992005 -0.0001976 ]
[ 0. 0. 0. 1. ]]
Baseline: 0.07017323260714177 [m]
Building the problem
Spline order: 6
Pose knots per second: 100
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 (sigma): -1.000000
Gyroscope Huber width (sigma): -1.000000
Do time calibration: True
Max iterations: 30
Time offset padding: 0.005000
Estimating time shift camera to imu:
Initializing a pose spline with 0 knots (100.000000 knots per second over 0.000000 seconds)
Traceback (most recent call last):
File "/catkin_ws/devel/lib/kalibr/kalibr_calibrate_imu_camera", line 15, in <module>
exec(compile(fh.read(), python_script, 'exec'), context)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 247, in <module>
main()
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 189, in main
iCal.buildProblem(splineOrder=6,
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccCalibrator.py", line 105, in buildProblem
cam.findTimeshiftCameraImuPrior(self.ImuList[0], verbose)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 221, in findTimeshiftCameraImuPrior
poseSpline = self.initPoseSplineFromCamera( timeOffsetPadding=0.0 )
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 315, in initPoseSplineFromCamera
pose.initPoseSplineSparse(times, curve, knots, 1e-4)
RuntimeError: [Exception] /catkin_ws/src/kalibr/aslam_nonparametric_estimation/bsplines/src/BSpline.cpp:970: initSplineSparse() assert(numSegments >= 1) failed [0 >= 1]: There must be at least one time segment
root@026e7d150c80:/catkin_ws# rosrun kalibr kalibr_calibrate_imu_camera --h
importing libraries
Calibrate the spatial and temporal parameters of an IMU to a camera chain.
usage:
Example usage to calibrate a camera system against an IMU using an aprilgrid.
Temporal calibration is enabled by default.
kalibr_calibrate_imu_camera --bag MYROSBAG.bag --cam camchain.yaml --imu imu.yaml \
--target aprilgrid.yaml
camchain.yaml: is the camera-system calibration output of the multiple-camera
calibratin tool (kalibr_calibrate_cameras)
example aprilgrid.yaml: | example imu.yaml: (ADIS16448)
target_type: 'aprilgrid' | accelerometer_noise_density: 0.006
tagCols: 6 | accelerometer_random_walk: 0.0002
tagRows: 6 | gyroscope_noise_density: 0.0004
tagSize: 0.088 | gyroscope_random_walk: 4.0e-06
tagSpacing: 0.3 | update_rate: 200.0
optional arguments:
-h, --help show this help message and exit
Dataset source:
--bag BAGFILE Ros bag file containing image and imu data (rostopics
specified in the yamls)
--bag-from-to bag_from_to bag_from_to
Use the bag data starting from up to this time [s]
--bag-freq bag_freq Frequency to extract features at [hz]
--perform-synchronization
Perform a clock synchronization according to 'Clock
synchronization algorithms for network measurements'
by Zhang et al. (2002).
Camera system configuration:
--cams CHAIN_YAML Camera system configuration as yaml file
--recompute-camera-chain-extrinsics
Recompute the camera chain extrinsics. This option is
exclusively recommended for debugging purposes in
order to identify problems with the camera chain
extrinsics.
--reprojection-sigma REPROJECTION_SIGMA
Standard deviation of the distribution of reprojected
corner points [px]. (default: 1.0)
IMU configuration:
--imu IMU_YAMLS [IMU_YAMLS ...]
Yaml files holding the IMU noise parameters. The first
IMU will be the reference IMU.
--imu-delay-by-correlation
Estimate the delay between multiple IMUs by
correlation. By default, no temporal calibration
between IMUs will be performed.
--imu-models IMU_MODELS [IMU_MODELS ...]
The IMU models to estimate. Currently supported are
'calibrated', 'scale-misalignment' and 'scale-
misalignment-size-effect'.
Calibration target:
--target TARGET_YAML Calibration target configuration as yaml file
Optimization options:
--no-time-calibration
Disable the temporal calibration
--max-iter MAX_ITER Max. iterations (default: 30)
--recover-covariance Recover the covariance of the design variables.
--timeoffset-padding TIMEOFFSET_PADDING
Maximum range in which the timeoffset may change
during estimation [s] (default: 0.03)
Output options:
--show-extraction Show the calibration target extraction. (disables
plots)
--extraction-stepping
Show each image during calibration target extraction
(disables plots)
--verbose Verbose output (disables plots)
--dont-show-report Do not show the report on screen after calibration.
--export-poses Also export the optimized poses.
root@026e7d150c80:/catkin_ws# exit
exit
kobosp@NUC8i5:~/ETHkalibr$ FOLDER=/home/kobosp/ETHkalibr/data/Sample/
kobosp@NUC8i5:~/ETHkalibr$ sudo docker run -it -e "DISPLAY" -e "QT_X11_NO_MITSHM=1" -v "/tmp/.X11-unix:/tmp/.X11-unix:rw" -v "$FOLDER:/data" kalibr
[sudo] kobosp 的密码:
root@dd9c9d890ee0:/catkin_ws# source devel/setup.bash
root@dd9c9d890ee0:/catkin_ws# rosrun kalibr kalibr_calibrate_imu_camera --cam ../data/cam_april-camchain.yaml --target ../data/april_6x6_80x80cm.yaml --imu ../data/imu_adis16448.yaml --bag ../data/imu_april.bag
importing libraries
Initializing IMUs:
Update rate: 200.0
Accelerometer:
Noise density: 0.01
Noise density (discrete): 0.1414213562373095
Random walk: 0.0002
Gyroscope:
Noise density: 0.005
Noise density (discrete): 0.07071067811865475
Random walk: 4e-06
Initializing imu rosbag dataset reader:
Dataset: ../data/imu_april.bag
Topic: /imu0
Number of messages: 14381
Reading IMU data (/imu0)
Read 14381 imu readings over 71.9 seconds
Initializing calibration target:
Type: aprilgrid
Tags:
Rows: 6
Cols: 6
Size: 0.088 [m]
Spacing 0.026399999999999996 [m]
Initializing camera chain:
Camera chain - cam0:
Camera model: pinhole
Focal length: [458.9432286546919, 457.5637533402653]
Principal point: [367.0272509347057, 249.3128033381081]
Distortion model: radtan
Distortion coefficients: [-0.2879529995338575, 0.0781311194952221, 0.00021265916642721963, -0.0001221450347654466]
baseline: no data available
Initializing camera rosbag dataset reader:
Dataset: ../data/imu_april.bag
Topic: /cam0/image_raw
Number of images: 1439
Extracting calibration target corners
Extracted corners for 1399 images (of 1439 images)
Building the problem
Spline order: 6
Pose knots per second: 100
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 (sigma): -1.000000
Gyroscope Huber width (sigma): -1.000000
Do time calibration: True
Max iterations: 30
Time offset padding: 0.030000
Estimating time shift camera to imu:
Initializing a pose spline with 7190 knots (100.000000 knots per second over 71.900000 seconds)
Time shift camera to imu (t_imu = t_cam + shift):
0.0
Estimating imu-camera rotation prior
Initializing a pose spline with 7190 knots (100.000000 knots per second over 71.900000 seconds)
Gravity was intialized to [-0.07968517 -9.56930933 -2.14252003] [m/s^2]
Orientation prior camera-imu found as: (T_i_c)
[[ 0.01540089 0.99947646 -0.02845369]
[-0.99986 0.01558051 0.00610171]
[ 0.00654184 0.02835574 0.99957649]]
Gyro bias prior found as: (b_gyro)
[-0.00315449 0.02495663 0.07872229]
Initializing a pose spline with 7202 knots (100.000000 knots per second over 72.020000 seconds)
Initializing the bias splines with 3601 knots
Adding camera error terms (/cam0/image_raw)
Added 1399 camera error terms
Adding accelerometer error terms (/imu0)
Added 14381 of 14381 accelerometer error terms (skipped 0 out-of-bounds measurements)
Adding gyroscope error terms (/imu0)
Added 14381 of 14381 gyroscope error terms (skipped 0 out-of-bounds measurements)
Before Optimization
===================
Normalized Residuals
----------------------------
Reprojection error (cam0): mean 1.4750965187964908, median 1.1164274136943468, std: 1.275962492544892
Gyroscope error (imu0): mean 1.5735893087893817, median 1.07738778908564, std: 2.0302734131968565
Accelerometer error (imu0): mean 5.596232978580502, median 3.9880924156602364, std: 5.727625438992933
Residuals
----------------------------
Reprojection error (cam0) [px]: mean 1.4750965187964908, median 1.1164274136943468, std: 1.275962492544892
Gyroscope error (imu0) [rad/s]: mean 0.1112695671047624, median 0.07618282116300379, std: 0.14356200981342546
Accelerometer error (imu0) [m/s^2]: mean 0.7914268576508128, median 0.5640014382223985, std: 0.8100085576016959
Optimizing...
Using the block_cholesky linear system solver
Using the levenberg_marquardt trust region policy
Using the block_cholesky linear system solver
Using the levenberg_marquardt trust region policy
Initializing
Optimization problem initialized with 14423 design variables and 203069 error terms
The Jacobian matrix is 434898 x 64887
[0.0]: J: 1.6801e+06
[1]: J: 55315.6, dJ: 1.62479e+06, deltaX: 0.534876, LM - lambda:10 mu:2
[2]: J: 44083.6, dJ: 11232, deltaX: 0.130086, LM - lambda:3.33333 mu:2
[3]: J: 43975.7, dJ: 107.897, deltaX: 0.0919146, LM - lambda:1.11111 mu:2
[4]: J: 43975.1, dJ: 0.572779, deltaX: 0.0324899, LM - lambda:0.37037 mu:2
Last step was a regression. Reverting
[5]: J: 43975.1, dJ: -0.000337646, deltaX: 0.0675993, LM - lambda:0.123457 mu:2
After Optimization (Results)
==================
Normalized Residuals
----------------------------
Reprojection error (cam0): mean 0.4068389856313736, median 0.35019152049973784, std: 0.2681391818575475
Gyroscope error (imu0): mean 0.11010219799507329, median 0.0949146151684012, std: 0.06756248689227881
Accelerometer error (imu0): mean 0.3517593093338472, median 0.31929933142341543, std: 0.19736850118762259
Residuals
----------------------------
Reprojection error (cam0) [px]: mean 0.4068389856313736, median 0.35019152049973784, std: 0.2681391818575475
Gyroscope error (imu0) [rad/s]: mean 0.007785401082586021, median 0.006711476801928803, std: 0.004777389263535758
Accelerometer error (imu0) [m/s^2]: mean 0.04974627859509194, median 0.04515574449556558, std: 0.027912121116478616
Transformation T_cam0_imu0 (imu0 to cam0, T_ci):
[[ 0.01477499 0.99954017 -0.02647936 0.06553522]
[-0.99988927 0.01481672 0.00138036 -0.0199015 ]
[ 0.00177206 0.02645603 0.99964841 -0.00491211]
[ 0. 0. 0. 1. ]]
cam0 to imu0 time: [s] (t_imu = t_cam + shift)
-5.358274956430555e-05
IMU0:
----------------------------
Model: calibrated
Update rate: 200.0
Accelerometer:
Noise density: 0.01
Noise density (discrete): 0.1414213562373095
Random walk: 0.0002
Gyroscope:
Noise density: 0.005
Noise density (discrete): 0.07071067811865475
Random walk: 4e-06
T_i_b
[[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]
Saving camera chain calibration to file: ../data/imu_april-camchain-imucam.yaml
Saving imu calibration to file: ../data/imu_april-imu.yaml
Detailed results written to file: ../data/imu_april-results-imucam.txt
Generating result report...
/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccPlots.py:187: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
ax=pl.subplot(3, 1, r+1)
/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccPlots.py:106: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
pl.subplot(3, 1, i+1)
/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccPlots.py:156: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
ax=pl.subplot(3, 1, r+1)
/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccPlots.py:126: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
pl.subplot(3, 1, i+1)
(kalibr_calibrate_imu_camera:32): dbind-WARNING **: 05:50:43.099: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-Y82OJPuqKt: Connection refused
(kalibr_calibrate_imu_camera:32): Gtk-WARNING **: 05:50:43.386: Error loading theme icon 'dialog-error' for stock: Icon 'dialog-error' not present in theme Yaru
(kalibr_calibrate_imu_camera:32): Gtk-WARNING **: 05:50:43.391: Error loading theme icon 'dialog-error' for stock: Icon 'dialog-error' not present in theme Yaru
(kalibr_calibrate_imu_camera:32): Gtk-WARNING **: 05:50:43.392: Error loading theme icon 'dialog-warning' for stock: Icon 'dialog-warning' not present in theme Yaru
(kalibr_calibrate_imu_camera:32): Gtk-WARNING **: 05:50:43.392: Error loading theme icon 'dialog-information' for stock: Icon 'dialog-information' not present in theme Yaru
Report written to ../data/imu_april-report-imucam.pdf
root@dd9c9d890ee0:/catkin_ws# exit
exit
kobosp@NUC8i5:~/ETHkalibr$ FOLDER=/home/kobosp/ETHkalibr/data/K522D/
kobosp@NUC8i5:~/ETHkalibr$ sudo docker run -it -e "DISPLAY" -e "QT_X11_NO_MITSHM=1" -v "/tmp/.X11-unix:/tmp/.X11-unix:rw" -v "$FOLDER:/data" kalibr
root@e9491cc5700e:/catkin_ws# source devel/setup.bash
root@e9491cc5700e:/catkin_ws# rosrun kalibr kalibr_calibrate_imu_camera --cam ../data/Stereo-camchain.yaml --target ../data/april6.yaml --imu ../data/ImuPX4.yaml --bag ../data/RestampStereoImu.bag
importing libraries
Initializing IMUs:
Update rate: 200.0
Accelerometer:
Noise density: 0.013178197378576464
Noise density (discrete): 0.18636785460412406
Random walk: 0.0003957063244250979
Gyroscope:
Noise density: 0.0007561898045069295
Noise density (discrete): 0.01069413877261959
Random walk: 3.64801041874673e-05
Initializing imu rosbag dataset reader:
Dataset: ../data/RestampStereoImu.bag
Topic: /mavros/imu/data_raw
Traceback (most recent call last):
File "/catkin_ws/devel/lib/kalibr/kalibr_calibrate_imu_camera", line 15, in
exec(compile(fh.read(), python_script, ' exec'), context)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 247, in
main()
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 154, in main
imus.append( sens.IccImu(imuConfig, parsed, isReferenceImu=(not imus), \
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 593, in __init__
self.dataset = initImuBagDataset(parsed.bagfile[0], imuConfig.getRosTopic(), \
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 34, in initImuBagDataset
reader = kc.BagImuDatasetReader(bagfile, topic, bag_from_to=from_to, \
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_common/ImuDatasetReader.py", line 31, in __init__
self.bag = rosbag.Bag(bagfile)
File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 467, in __init__
self._open(f, mode, allow_unindexed)
File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 1428, in _open
if mode == ' r': self._open_read(f, allow_unindexed)
File "/opt/ros/noetic/lib/python3/dist-packages/rosbag/bag.py", line 1450, in _open_read
self._file = open(f, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '../data/RestampStereoImu.bag'
root@e9491cc5700e:/catkin_ws# rosrun kalibr kalibr_calibrate_imu_camera --cam ../data/Stereo-camchain.yaml --target ../data/april6.yaml --imu ../data/ImuPX4.yaml --bag ../data/StereoImuRestamp.bag
importing libraries
Initializing IMUs:
Update rate: 200.0
Accelerometer:
Noise density: 0.013178197378576464
Noise density (discrete): 0.18636785460412406
Random walk: 0.0003957063244250979
Gyroscope:
Noise density: 0.0007561898045069295
Noise density (discrete): 0.01069413877261959
Random walk: 3.64801041874673e-05
Initializing imu rosbag dataset reader:
Dataset: ../data/StereoImuRestamp.bag
Topic: /mavros/imu/data_raw
Number of messages: 1
Reading IMU data (/mavros/imu/data_raw)
Progress 1 / 1 Time remaining: [FATAL] [1659506386.591236]: Could not find any IMU messages. Please check the dataset.
root@e9491cc5700e:/catkin_ws# rosrun kalibr kalibr_calibrate_imu_camera --cam ../data/Stereo-camchain.yaml --target ../data/april6.yaml --imu ../data/ImuPX4.yaml --bag ../data/StereoImu.bag
importing libraries
Initializing IMUs:
Update rate: 150.0
Accelerometer:
Noise density: 0.013178197378576464
Noise density (discrete): 0.16139929653597607
Random walk: 0.0003957063244250979
Gyroscope:
Noise density: 0.0007561898045069295
Noise density (discrete): 0.009261395848684701
Random walk: 3.64801041874673e-05
Initializing imu rosbag dataset reader:
Dataset: ../data/StereoImu.bag
Topic: /mavros/imu/data_raw
Number of messages: 63496
Reading IMU data (/mavros/imu/data_raw)
Read 63496 imu readings over 322.1 seconds
Initializing calibration target:
Type: aprilgrid
Tags:
Rows: 6
Cols: 6
Size: 0.088 [m]
Spacing 0.026487999999999998 [m]
Initializing camera chain:
Camera chain - cam0:
Camera model: pinhole
Focal length: [773.03583, 777.516443]
Principal point: [672.617788, 372.522376]
Distortion model: equidistant
Distortion coefficients: [-0.297926, 0.077062, 3e-05, -0.000558]
baseline: no data available
Camera chain - cam1:
Camera model: pinhole
Focal length: [773.934111, 778.673235]
Principal point: [599.921196, 373.44009]
Distortion model: equidistant
Distortion coefficients: [-0.303576, 0.082196, 0.000697, -0.001685]
baseline: [[ 0.99997573 0.0011333 -0.00687465 0.07017293]
[-0.00120622 0.99994295 -0.01061327 -0.00005874]
[ 0.00686223 0.01062131 0.99992005 -0.0001976 ]
[ 0. 0. 0. 1. ]]
Initializing camera rosbag dataset reader:
Dataset: ../data/StereoImu.bag
Topic: /camera/left/image_raw
Number of images: 1610
Extracting calibration target corners
Extracted corners for 1574 images (of 1610 images)
Initializing camera rosbag dataset reader:
Dataset: ../data/StereoImu.bag
Topic: /camera/right/image_raw
Number of images: 1610
Extracting calibration target corners
Extracted corners for 1581 images (of 1610 images)
Baseline between cam0 and cam1 set to:
T= [[ 0.99997573 0.0011333 -0.00687465 0.07017293]
[-0.00120622 0.99994295 -0.01061327 -0.00005874]
[ 0.00686223 0.01062131 0.99992005 -0.0001976 ]
[ 0. 0. 0. 1. ]]
Baseline: 0.07017323260714177 [m]
Building the problem
Spline order: 6
Pose knots per second: 100
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 (sigma): -1.000000
Gyroscope Huber width (sigma): -1.000000
Do time calibration: True
Max iterations: 30
Time offset padding: 0.030000
Estimating time shift camera to imu:
Initializing a pose spline with 0 knots (100.000000 knots per second over 0.000000 seconds)
Traceback (most recent call last):
File "/catkin_ws/devel/lib/kalibr/kalibr_calibrate_imu_camera", line 15, in
exec(compile(fh.read(), python_script, ' exec'), context)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 247, in
main()
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 189, in main
iCal.buildProblem(splineOrder=6,
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccCalibrator.py", line 105, in buildProblem
cam.findTimeshiftCameraImuPrior(self.ImuList[0], verbose)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 221, in findTimeshiftCameraImuPrior
poseSpline = self.initPoseSplineFromCamera( timeOffsetPadding=0.0 )
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 315, in initPoseSplineFromCamera
pose.initPoseSplineSparse(times, curve, knots, 1e-4)
RuntimeError: [Exception] /catkin_ws/src/kalibr/aslam_nonparametric_estimation/bsplines/src/BSpline.cpp:970: initSplineSparse() assert(numSegments >= 1) failed [0 >= 1]: There must be at least one time segment
root@e9491cc5700e:/catkin_ws# rosrun kalibr kalibr_calibrate_imu_camera --cam ../data/Stereo-camchain.yaml --target ../data/april6.yaml --imu ../data/ImuPX4.yaml --bag ../data/StereoImu.bag
importing libraries
Initializing IMUs:
Update rate: 200.0
Accelerometer:
Noise density: 0.013178197378576464
Noise density (discrete): 0.18636785460412406
Random walk: 0.0003957063244250979
Gyroscope:
Noise density: 0.0007561898045069295
Noise density (discrete): 0.01069413877261959
Random walk: 3.64801041874673e-05
Initializing imu rosbag dataset reader:
Dataset: ../data/StereoImu.bag
Topic: /mavros/imu/data_raw
Number of messages: 63496
Reading IMU data (/mavros/imu/data_raw)
Read 63496 imu readings over 322.1 seconds
Initializing calibration target:
Type: aprilgrid
Tags:
Rows: 6
Cols: 6
Size: 0.088 [m]
Spacing 0.026399999999999996 [m]
Initializing camera chain:
Camera chain - cam0:
Camera model: pinhole
Focal length: [773.03583, 777.516443]
Principal point: [672.617788, 372.522376]
Distortion model: radtan
Distortion coefficients: [-0.297926, 0.077062, 3e-05, -0.000558]
baseline: no data available
Camera chain - cam1:
Camera model: pinhole
Focal length: [773.934111, 778.673235]
Principal point: [599.921196, 373.44009]
Distortion model: radtan
Distortion coefficients: [-0.303576, 0.082196, 0.000697, -0.001685]
baseline: [[ 0.99997573 0.0011333 -0.00687465 0.07017293]
[-0.00120622 0.99994295 -0.01061327 -0.00005874]
[ 0.00686223 0.01062131 0.99992005 -0.0001976 ]
[ 0. 0. 0. 1. ]]
Initializing camera rosbag dataset reader:
Dataset: ../data/StereoImu.bag
Topic: /camera/left/image_raw
Number of images: 1610
Extracting calibration target corners
Extracted corners for 1574 images (of 1610 images)
Initializing camera rosbag dataset reader:
Dataset: ../data/StereoImu.bag
Topic: /camera/right/image_raw
Number of images: 1610
Extracting calibration target corners
Extracted corners for 1581 images (of 1610 images)
Baseline between cam0 and cam1 set to:
T= [[ 0.99997573 0.0011333 -0.00687465 0.07017293]
[-0.00120622 0.99994295 -0.01061327 -0.00005874]
[ 0.00686223 0.01062131 0.99992005 -0.0001976 ]
[ 0. 0. 0. 1. ]]
Baseline: 0.07017323260714177 [m]
Building the problem
Spline order: 6
Pose knots per second: 100
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 (sigma): -1.000000
Gyroscope Huber width (sigma): -1.000000
Do time calibration: True
Max iterations: 30
Time offset padding: 0.030000
Estimating time shift camera to imu:
Initializing a pose spline with 0 knots (100.000000 knots per second over 0.000000 seconds)
Traceback (most recent call last):
File "/catkin_ws/devel/lib/kalibr/kalibr_calibrate_imu_camera", line 15, in
exec(compile(fh.read(), python_script, ' exec'), context)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 247, in <module>
main()
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_calibrate_imu_camera", line 189, in main
iCal.buildProblem(splineOrder=6,
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccCalibrator.py", line 105, in buildProblem
cam.findTimeshiftCameraImuPrior(self.ImuList[0], verbose)
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 221, in findTimeshiftCameraImuPrior
poseSpline = self.initPoseSplineFromCamera( timeOffsetPadding=0.0 )
File "/catkin_ws/src/kalibr/aslam_offline_calibration/kalibr/python/kalibr_imu_camera_calibration/IccSensors.py", line 315, in initPoseSplineFromCamera
pose.initPoseSplineSparse(times, curve, knots, 1e-4)
RuntimeError: [Exception] /catkin_ws/src/kalibr/aslam_nonparametric_estimation/bsplines/src/BSpline.cpp:970: initSplineSparse() assert(numSegments >= 1) failed [0 >= 1]: There must be at least one time segment
root@e9491cc5700e:/catkin_ws#
rosrun kalibr kalibr_camera_validator --target ../data/april6.yaml --cam ../data/Stereo-camchain.yaml
rosrun kalibr kalibr_calibrate_cameras --models pinhole-equi pinhole-equi --topics /camera/left/image_raw /camera/right/image_raw --bag src/kalibr/data
kalibr_calibrate_cameras --models pinhole-equi pinhole-equi --topics /cam0/image_raw /cam1/image_raw --bag static.bag --target aprilgrid_6x6.yaml
rosrun kalibr kalibr_calibrate_cameras \
--bag /data/cam_april.bag --target /data/april_6x6.yaml \
--models pinhole-radtan pinhole-radtan \
--topics /cam0/image_raw /cam1/image_raw
Skip to content
Search or jump to…
Pull requests
Issues
Marketplace
Explore
@KOBOSP
ethz-asl
/
kalibr
Public
Code
Issues
80
Pull requests
8
Actions
Projects
Wiki
Security
Insights
Calibrating the VI Sensor
Timo Hinzmann edited this page on 26 May 2017 · 19 revisions
Pages 17
Home
Downloads
Installation
Toolbox Tools
Multiple camera calibration
Camera-IMU calibration
Multi-IMU and IMU intrinsic calibration
Rolling Shutter camera calibration
(only ROS):
Camera focus
Calibration validator
ROS2 support
Formats
Supported camera models
Calibration targets
Bag format
YAML formats
IMU Noise Model
Tutorials
Example: Calibrating a VI-Sensor
Experimental
Camera-IMU-LRF calibration
Clone this wiki locally
https://github.com/ethz-asl/kalibr.wiki.git
VI-Sensor
This page will guide you through the calibration of the VI-Sensor (visual-inertial sensor). The intrinsics and extrinsics of the camera system and the transformation of each camera w.r.t. the IMU will be estimated.
More information about the VI-Sensor can be found here.
Procedure
prepare the sensor
setting the focus
collect calibration data
in-/extrinsics calibration (static calibration)
imu-camera calibration (dynamic calibration)
run the calibration
in-/extrinsic camera calibration
imu-camera calibration
collect results
Requirements
ROS sensor driver is running (image/imu data)
good Aprilgrid target (pdf, yaml)
Siemens star (or similar camera focus test pattern)
IMU configuration for ADIS16448 (yaml)
minimize the motion blur with a good light source and by reducing the shutter times.
Shutter times can be set using the following commands:
rosrun dynamic_reconfigure dynparam set /visensor_node “{‘cam0_agc_enable’: 0, ‘cam0_aec_enable’: 0, ‘cam0_coarse_shutter_width’: 300}”
rosrun dynamic_reconfigure dynparam set /visensor_node “{‘cam1_agc_enable’: 0, ‘cam1_aec_enable’: 0, ‘cam1_coarse_shutter_width’: 300}”
Observe the result on an image window and tweak the shutter until you get a good image:
rosrun image_view image_view image:=/cam0/image_raw &
rosrun image_view image_view image:=/cam1/image_raw &
start the focus tool
kalibr_camera_focus --topic /cam0/image_raw /cam1/image_raw
set the focus of both cameras by:
reducing the interference visible around the center of the Siemens star
minimizing the focus measure provided by the tool
Make sure a Teflon band or thread-locking glue prevents unintentional focus changes after this step.
static dataset (in-/extrinsic calibration of the cameras)
attach the sensor somewhere and move the target
limit the camera streams to ~4 Hz
make sure to cover the entire field of view of the camera
use skewed views and varying distances to the calibration target
view images with:
rosrun image_view image_view image:=/cam0/image_raw &
rosrun image_view image_view image:=/cam1/image_raw &
record bag with:
rosbag record /cam0/image_raw /cam1/image_raw -O static.bag
dynamic dataset (spatial camera-imu calibration)
move the sensor (target is fixed)
cameras should run at 20 Hz and IMU at 200 Hz
try to excite all rotation and acceleration axes of the IMU
avoid shocks (e.g. while picking up the sensor)
good illumination and shutter times are crucial here (to avoid motion blur while exciting the IMU)
view images with:
rosrun image_view image_view image:=/cam0/image_raw &
rosrun image_view image_view image:=/cam1/image_raw &
record bag with:
rosbag record /cam0/image_raw /cam1/image_raw /imu0 -O dynamic.bag
run calibration
kalibr_calibrate_cameras --models pinhole-equi pinhole-equi --topics /cam0/image_raw /cam1/image_raw --bag static.bag --target aprilgrid_6x6.yaml
inspect the result plots
verify calibration on the live image stream
reprojection errors should be in a normal range (0.1-0.2 px for a good calibration)
kalibr_camera_validator --chain chain.yaml --target aprilgrid_6x6.yaml
camera-imu calibration
run calibration
kalibr_calibrate_imu_camera --cam chain.yaml --target aprilgrid_6x6.yaml --imu imu0.yaml --bag dynamic.bag
inspect the result plots
make sure the predicted accelerations & angular velocities fit the IMU measurements
reprojection errors should be in a normal range (0.1-0.2 px for a good calibration)
4) Collect results
Both calibrators write reports to the working directory containing the plots shown at the end of the calibration. Further a camchain.yaml has been written by the camera calibrator and is extended by the imu-camera calibrator with imu-camera transformations to the file camchain_cimu.yaml. Please refer to the YAML formats page for the format.
Footer
© 2022 GitHub, Inc.
Footer navigation
Terms
Privacy
Security
Status
Docs
Contact GitHub
Pricing
API
Training
Blog
About
You have no unread notifications