This is a ROS2 python handeye calibration package. It is hardware-independent and can be applied to any depth/RGB camera with ROS2 wrappers available.
In summary, it provides functionality includes:
- Sample and save the robot pose and tracking object pose with a simple keyboard click.
- Compute and save the result of the eye-in-hand calibration through the Tsai-Lenz method implemented with OpenCV.
- Publish the hand-eye calibration result and visualize it rviz.
We also provided a simulation demo where you can add a virtual camera to start using the package. Please find the pkg handeye_calibration_ros2_sim
To adapt to your usage, you only need to modify all the information in a single file:
- The camera image topic
- The name of the robot link names
- The camera matrix and distortion coefficient
You can also modify other parameters as per your preference in the information file.
Please feel free to raise an issue as we seek to test the package performance under different hardware software environments. This would help us improve the package and make it truly universal!
- Robot: KUKA LBR iiwa 7
- Camera:
- Intel RealSense D415
- Microsoft Azure Kinect
- Chessboard
- ArUco Marker:
- ID: 365
- Side Length: 150mm
- Robot Driver: lbr_fri_ros2_stack
- Camera Drivers:
- realsense-ros
- Azure_Kinect_ROS_Driver
- Operating System: Ubuntu 22.04
- ROS 2: Humble
This package provides a solution for hand-eye calibration between a robot arm and a camera in a ROS2 environment. It is designed to support various robotic and vision systems, offering flexibility for different hardware configurations.
-
Create your workspace and clone this repository:
mkdir -p handeye_calibration_ws/src cd handeye_calibration_ws/src git clone https://github.com/shengyangzhuang/handeye_calibration_ros2.git
-
Install dependencies:
rosdep install --from-paths src --ignore-src -r -y
-
Build the package
RealSense:
colcon build --packages-select handeye_realsense
Azure Kinect:
colcon build --packages-select handeye_ak
-
Source your ROS2 workspace:
source install/setup.bash
- Install the RealSense ROS2 wrapper.
-
Calibrate the camera intrinsics and record the intrinsic matrix
K
and distortion coefficientD
atrealsense_info.yaml
. We also provided a package using the chessboard to calibrate the camera intrinsics, seecamera_calibration
. -
Change the parameters at
config.yaml
-
Start the camera node
RealSense:
ros2 run realsense2_camera realsense2_camera_node
-
To start the hand-eye calibration, launch the node as follows and press key q to record marker and robot poses:
ros2 launch handeye_realsense taking_sample_launch.py
-
To calculate the hand-eye calibration result:
ros2 run handeye_realsense handeye
-
To visualize the result in rviz, publish the hand-eye transformation by:
ros2 run handeye_realsense eye2hand
We provided an example usage with RealSense camera. Please refer here.
A video of hand-eye calibration process can be seen here, where we demonstrated ensuring calibration accuracy through simulation and replicating the similar poses in real LBR iiwa 7 robot and RealSense depth camera.
We welcome contributions from the community! If you'd like to contribute, please follow these steps:
-
Fork the repository: Click the "Fork" button at the top of this repository to create a copy on your GitHub account.
-
Create a feature branch: Clone the forked repository to your local machine and create a new branch for your feature or bug fix:
git checkout -b feature/my-feature
-
Make your changes: Implement your changes in the code, and don't forget to write tests if applicable.
-
Commit your changes: Once your changes are ready, commit them with a descriptive commit message:
git commit -m 'Add some feature'
Push your changes: Push your changes to the branch on your forked repository:
git push origin feature/my-feature
Open a Pull Request: Go to the original repository on GitHub and open a Pull Request (PR). Make sure to describe your changes in detail and explain why they are necessary.
If you enjoyed using this package, we would really appreciate it if you could leave a ⭐ and / or cite it!
@mastersthesis{zhuang2024multirobot,
author = {Zhuang, Shengyang},
title = {Multi-Robot System Prototyping for Cooperative Control in Robot-Assisted Spine Surgery},
school = {Imperial College London},
year = {2024},
}