Calibration of T265 Stereo Camera and IMU Intrinsic and Extrinsic Parameters

IMU Data Calibration

Installing Ceres Solver

sudo apt-get install liblapack-dev libsuitesparse-dev libcxsparse3.1.2 libgflags-dev
sudo apt-get install libgoogle-glog-dev libgtest-dev
git clone https://github.com/ceres-solver/ceres-solver.git
cd ceres-solver
mkdir build
cd build
cmake ..
make
sudo make install

Setting Up Workspace

mkdir -p ~/calibration_ws/src
cd calibration_ws/
catkin_make

Installing Code Utilities

sudo apt-get install libdw-dev
cd ~/calibration_ws/src
git clone https://github.com/gaowenliang/code_utils.git
cd ..
catkin_make

Modify code_utils/src/sumpixel_test.cpp:

#include "code_utils/backward.hpp"

Udpate CMakeLists:

set(CMAKE_CXX_STANDARD 11)

Installing IMU Utilities

cd ~/calibration_ws/src
git clone https://github.com/gaowenliang/imu_utils.git
cd ..
catkin_make

Add header to imu_an.cpp:

#include <fstream>

Collecting and Calibrating IMU Data

rosbag record /mavros/imu/data -O imu_xsens.bag

Configure xsens.launch:

<launch>
    <node pkg="imu_utils" type="imu_an" name="imu_an" output="screen">
        <param name="imu_topic" type="string" value="/imu/data"/>
        <param name="imu_name" type="string" value="xsens"/>
        <param name="data_save_path" type="string" value="$(find imu_utils)/data/"/>
        <param name="max_time_min" type="int" value="120"/>
        <param name="max_cluster" type="int" value="100"/>
    </node>
</launch>
roslaunch imu_utils xsens.launch
rosbag play -r 200 imu.bag

Stereo Camera Intrinsic Calibration

Building Workspace

mkdir -p ~/kalibr_ws/src

Installing Dependencies

sudo apt-get install python-setuptools python-rosinstall ipython libeigen3-dev libboost-all-dev doxygen libopencv-dev
sudo apt-get install libopencv-dev ros-melodic-vision-opencv ros-melodic-image-transport-plugins ros-melodic-cmake-modules software-properties-common software-properties-common libpoco-dev python-matplotlib python-scipy python-git python-pip ipython libtbb-dev libblas-dev liblapack-dev python-catkin-tools libv4l-dev
sudo apt-get install python-igraph

Compiling Kalibr

cd ~/kalibr_ws/src
git clone https://github.com/ethz-asl/Kalibr.git
cd ~/kalibr_ws
catkin build -DCMAKE_BUILD_TYPE=Release -j32
source ~/kalibr_ws/devel/setup.bash

Data Collection and Calibration

rosrun topic_tools throttle messages /stereo_left_node/left 20.0 /left
rosrun topic_tools throttle messages /stereo_right_node/right 20.0 /right
rosbag record -O stereo_calib.bag /left /right

Calibration board configuration:

target_type: 'aprilgrid'
tagCols: 6
tagRows: 6
tagSize: 0.088
tagSpacing: 0.3
rosrun kalibr kalibr_calibrate_cameras --bag ~/bag/calib.bag --topics /left /right --models omni-radtan omni-radtan --target ~/kalibr_ws/config/aprilgrid.yaml

Camera-IMU Extrinsic Calibration

Data Collection

rosbag record -O cam_imu_calib.bag /image_raw1_th /image_raw2_th /mavros/imu/data

Calibration

IMU parameters:

accelerometer_noise_density: 4.86e-03
accelerometer_random_walk: 2.39e-04
gyroscope_noise_density: 5.46e-04
gyroscope_random_walk: 6.20e-06
rostopic: /imu
update_rate: 100.0
rosrun kalibr kalibr_calibrate_imu_camera --target ~/kalibr_ws/config/aprilgrid.yaml --bag ~/bag/cam_imu_calib.bag --cam ~/kalibr_ws/config/cam_params.yaml --imu ~/kalibr_ws/config/imu_params.yaml

Transformation Interpretation

Output transformation matrices represent the transformation between camera and IMU frames.

Troubleshooting

Mutex Lock Error

Remove --show-extraction flag during calibration.

Synchronization Error

--approx-sync 0.1

Flat IMU Error Curve

Incresae IMU and camera samplnig rates.

Technical Notes

ROS Bag Commands

rosbag record -a
rosbag play -r 3 calibration.bag
rosbag info calibration.bag

PX4 IMU Frequency Adjustment

mavlink stream -d /dev/ttyS3 -s HIGHRES_IMU -r 100

Tags: Kalibr ceres-solver IMU stereo-camera ROS

Posted on Mon, 07 Sep 2026 16:03:03 +0000 by madolia