lidar_camera_calib is a robust, high accuracy extrinsic calibration tool between high resolution LiDAR (e.g. Livox) and camera in targetless environment. Our algorithm can run in both indoor and outdoor scenes, and only requires edge information in the scene. If the scene is suitable, we can achieve pixel-level accuracy similar to or even beyond the target based method.
Ubuntu 64-bit 16.04 or 18.04. ROS Kinetic or Melodic. ROS Installation and its additional ROS pacakge:
sudo apt-get install ros-XXX-cv-bridge ros-xxx-pcl-conversions
Follow Eigen Installation
Follow Ceres Installation.
Follow PCL Installation. (Our code is tested with PCL1.7)
Clone the repository and catkin_make:
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
source /opt/ros/(ros-version)/setup.sh
git clone this repo
cd ../
catkin_make
source ~/catkin_ws/devel/setup.bash
Record the point cloud and image with rosbag. You need to record about 20 seconds of an environment that is not moving and has no dynamic objects.
rosbag record <topic_name1> <topic_name2> ...
Convert the data in the rosbag to pcd file.
Change the file path and topic name. Lidar points must be filtered by the FoV of the camera.
min_angle, max_angle : filter your horizon angle of pointcloud.
blind : removes surrounding lidar points with a radius of x(m).
roslaunch livox_camera_calib bag_to_pcd.launch
You need to extract image on your rosbag file.
Change the file path and topic name. Run the extract_img.py after running roscore
roscore
cd ~/catkin_ws/src/livox_camera_calib/pylib
python extract_img.py
Change the data path to your local data path.
Provide the instrinsic matrix and distort coeffs for your camera.
Change the params in multi_calib.yaml, name the image file and pcd file from 0 to (data_num-1).
roslaunch livox_camera_calib single_calib.launch
roslaunch livox_camera_calib multi_calib.launch
The projected images obtained by initial extrinsic parameters.
Rough calibration is used to deal with the bad extrinsic. Then we finally get a fine extrinsic after final optimization.