All Projects → heethesh → Lidar_camera_calibration

heethesh / Lidar_camera_calibration

Licence: bsd-3-clause
Light-weight camera LiDAR calibration package for ROS using OpenCV and PCL (PnP + LM optimization)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Lidar camera calibration

Lidar camera calibration
ROS package to find a rigid-body transformation between a LiDAR and a camera for "LiDAR-Camera Calibration using 3D-3D Point correspondences"
Stars: ✭ 734 (+451.88%)
Mutual labels:  ros, point-cloud, lidar, camera-calibration
Depth clustering
🚕 Fast and robust clustering of point clouds generated with a Velodyne sensor.
Stars: ✭ 657 (+393.98%)
Mutual labels:  ros, point-cloud, lidar, pcl
Loam velodyne
Laser Odometry and Mapping (Loam) is a realtime method for state estimation and mapping using a 3D lidar.
Stars: ✭ 1,135 (+753.38%)
Mutual labels:  ros, lidar, pcl
Extrinsic lidar camera calibration
This is a package for extrinsic calibration between a 3D LiDAR and a camera, described in paper: Improvements to Target-Based 3D LiDAR to Camera Calibration. This package is used for Cassie Blue's 3D LiDAR semantic mapping and automation.
Stars: ✭ 149 (+12.03%)
Mutual labels:  point-cloud, lidar, camera-calibration
Grid map
Universal grid map library for mobile robotic mapping
Stars: ✭ 1,135 (+753.38%)
Mutual labels:  ros, opencv, pcl
Hdl graph slam
3D LIDAR-based Graph SLAM
Stars: ✭ 945 (+610.53%)
Mutual labels:  ros, point-cloud, lidar
Pclpy
Python bindings for the Point Cloud Library (PCL)
Stars: ✭ 212 (+59.4%)
Mutual labels:  point-cloud, lidar, pcl
Point Cloud Filter
Scripts showcasing filtering techniques applied to point cloud data.
Stars: ✭ 34 (-74.44%)
Mutual labels:  ros, point-cloud, pcl
urban road filter
Real-time LIDAR-based Urban Road and Sidewalk detection for Autonomous Vehicles 🚗
Stars: ✭ 134 (+0.75%)
Mutual labels:  point-cloud, ros, lidar
Ndt omp
Multi-threaded and SSE friendly NDT algorithm
Stars: ✭ 291 (+118.8%)
Mutual labels:  ros, point-cloud, pcl
Awesome Robotic Tooling
Tooling for professional robotic development in C++ and Python with a touch of ROS, autonomous driving and aerospace.
Stars: ✭ 1,876 (+1310.53%)
Mutual labels:  ros, point-cloud, lidar
cloud to map
Algorithm that converts point cloud data into an occupancy grid
Stars: ✭ 26 (-80.45%)
Mutual labels:  point-cloud, ros, pcl
Interactive slam
Interactive Map Correction for 3D Graph SLAM
Stars: ✭ 372 (+179.7%)
Mutual labels:  ros, point-cloud, lidar
Pcl Ros Cluster Segmentation
Cluster based segmentation of Point Cloud with PCL lib in ROS
Stars: ✭ 123 (-7.52%)
Mutual labels:  ros, point-cloud, pcl
Camera calibration api
A simple Python API for single camera calibration using opencv
Stars: ✭ 36 (-72.93%)
Mutual labels:  camera-calibration, opencv
Weakly Supervised 3d Object Detection
Weakly Supervised 3D Object Detection from Point Clouds (VS3D), ACM MM 2020
Stars: ✭ 61 (-54.14%)
Mutual labels:  point-cloud, lidar
Lego Loam
LeGO-LOAM: Lightweight and Ground-Optimized Lidar Odometry and Mapping on Variable Terrain
Stars: ✭ 1,138 (+755.64%)
Mutual labels:  ros, lidar
Pcl
Point Cloud Library (PCL)
Stars: ✭ 6,897 (+5085.71%)
Mutual labels:  point-cloud, pcl
Ev3dev Lang Java
A project to learn Java and create software for Mindstorms Robots using hardware supported by EV3Dev & the LeJOS way.
Stars: ✭ 79 (-40.6%)
Mutual labels:  ros, opencv
Ira laser tools
All laser type assemblers and manipulators.
Stars: ✭ 87 (-34.59%)
Mutual labels:  ros, pcl

ROS Camera LIDAR Calibration Package

Setup

Install dependencies.

sudo apt install ros-DISTRO-camera-calibration

Run the following to clone the lidar_camera_calibration package in ros_workspace/src directory.

cd ~/ros_workspace/src
git clone https://github.com/heethesh/lidar_camera_calibration

cd ~/ros_workspace/
catkin_make
source devel/setup.bash

Make sure you have the ROS bag file in lidar_camera_calibration/bagfiles folder. Then you can use the following launch files. This package assumes that the bag file has atleast the following topic names and message types by default, these can be modified in the launch scripts.

/sensors/velodyne_points    (sensor_msgs/PointCloud2)
/sensors/camera/image_color (sensor_msgs/Image)
/sensors/camera/camera_info (sensor_msgs/CameraInfo) (optionally generated by camera_calibration, see below)

Play ROS Bag File

This launch file will only play the rosbag record file.

roslaunch lidar_camera_calibration play_rosbag.launch bagfile:=/path/to/file.bag

Run Camera Calibration

This launch file will play the rosbag record and runs the camera_calibration package from ROS. The results are stored by default at ~/.ros/camera_info.

roslaunch lidar_camera_calibration camera_calibration.launch

23 images were automatically selected by the calibrator and the sample parameters obtained are stored here. The following results were obtained:

Camera Matrix

484.130454    0.000000  457.177461
  0.000000  484.452449  364.861413
  0.000000    0.000000    1.000000

Distortion Coefficients

-0.199619  0.068964  0.003371  0.000296  0.000000

Update the ROS Bag File

This script will update the camera matrices and the distortion coefficients in the /sensors/camera/camera_info topic and creates a new bag file in the same location. Note, if you did not have any camera calibration information before, ROS would automatically pick the camera info from ~/.ros/camera_info when playing the bag file and you can skip this step after verification (rostopic echo /<CAMERA_NAME>/camera_info).

rosrun lidar_camera_calibration update_camera_info.py <original_file.bag> <calibration_file.yaml>

Display Camera Calibration

This launch file will play the updated rosbag record, run image_proc for camera image rectification and displays the rectified and unrectified images.

roslaunch lidar_camera_calibration display_camera_calibration.launch

YouTube Link for Camera Calibration Demo

Calibrate Camera-LiDAR Point Correspondences

This script will perform calibration using the matplotlib GUI to pick correspondences in the camera and the LiDAR frames. You first need to play the rosbag record in another terminal.

roslaunch lidar_camera_calibration play_rosbag.launch bagfile:=/path/to/file.bag
rosrun lidar_camera_calibration calibrate_camera_lidar.py --calibrate

Press [ENTER] to launch the GUIs and pick the corresponding points by selecting the four corner points of the checkerboard in both the camera and the LiDAR frames. You may update the point cloud field-of-view to display here

OpenCV's PnP RANSAC + refinement using LM is used to find the rotation and translation transforms between the camera and the LiDAR. Since OpenCV's function rectifies the images internally, the 2D points are picked from the unrectified image. Additional, the rectify flag can be set to True while creating the GUI process to pick points from a rectified image.

NOTE: If you are using Ouster LiDAR, set OUSTER_LIDAR = True here. (see issue #26)

NOTE: The point files are appended and the extrinsics estimates are calculated and refined continuously using a RANSAC approach.

NOTE: To use solvePnPRefineLM, you need OpenCV >= 4.1.1, otherwise the LM pose refinement step will be skipped.

YouTube Link for Camera-LiDAR Calibration GUI Demo

The point correspondences are saved as following:

  • Image Points: lidar_camera_calibration/calibration_data/lidar_camera_calibration/img_corners.npy
  • LiDAR Points: lidar_camera_calibration/calibration_data/lidar_camera_calibration/pcl_corners.npy

The calibrated extrinsics are saved as following:

  • lidar_camera_calibration/calibration_data/lidar_camera_calibration/extrinsics.npz
    • 'euler' : Euler Angles (RPY rad)
    • 'R' : Rotation Matrix
    • 'T' : Translation Offsets (XYZ m)

The following calibrated extrinsics were obtained:

Rotation Matrix

-9.16347982e-02  -9.95792677e-01  -8.74577923e-05
 1.88123595e-01  -1.72252569e-02  -9.81994299e-01
 9.77861226e-01  -9.00013023e-02   1.88910532e-01

Euler Angles (RPY rad)

-0.44460865  -1.35998386   2.0240699

Translation Offsets (XYZ m)

-0.14614803  -0.49683771  -0.27546327

Display Camera-LiDAR Projection

This launch file will play the updated rosbag record, run calibrate_camera_lidar.py in projection mode and displays the LiDAR point cloud projected on to the image. A static transform is set up between the world and the velodyne frame which needs to be updates with the values above in the format X Y Z Y P R within the launch file. You may update the point cloud field-of-view to display here.

NOTE: If you are using Ouster LiDAR, set OUSTER_LIDAR = True here. (see issue #26)

roslaunch lidar_camera_calibration display_camera_lidar_calibration.launch

YouTube Link for Camera-LiDAR Projection Demo

TODO

  • [ ] Shift to Rviz point-picker for point cloud. Matplotlib GUI picker is not very convinient to use.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].