This repository contains the code for simultaneous kinematic calibration and calibrating the hand-eye transformation of an eye surgicl spherical paralell robot called diamond. The calibration is performed using a graph based appraaoch called factor graph and performed by using GTSAM and the Symforce library for symbolic computation and code generation. Paper for this work publishied form ICROM2023 Link
The project is organized into the following folders:
- cpp/symforce/sym: Contains the Symforce-generated C++ code for the error model function and its Jacobians.
- data: Contains the ground truth data and joint values used for calibration.
- lib: Contains the C++ header files for the GTSAM factors used in the calibration process.
- system_model: Contains the Symforce Python code for defining the error model function and generating the C++ code.
- verification: Contains the Python code for verifying the calibration results.
The calibration process involves the following steps:
- Data Acquisition: Collect data of the robot arm's joint values and the corresponding ground truth poses of the camera.
- Error Model Definition: Define the error model function that calculates the difference between the predicted camera pose based on the robot's kinematics and the ground truth camera pose.
- Code Generation: Use Symforce to generate C++ code for the error model function and its Jacobians.
- Factor Graph Construction: Construct a GTSAM factor graph using the generated C++ code and the collected data.
- Optimization: Optimize the factor graph to estimate the hand-eye transformation.
- Verification: Verify the calibration results by comparing the predicted camera poses with the ground truth poses.
To use the code, follow these steps:
- Install Dependencies: Install the required dependencies, including Symforce, GTSAM, and Eigen.
- Generate C++ Code: Run the
Diamon_model_symforce.py
script in thesystem_model
folder to generate the C++ code for the error model function and its Jacobians. - Compile C++ Code: Compile the generated C++ code and link it with the GTSAM library.
- Run Calibration: Run the
DiamondFactor.cpp
file to perform the calibration process. - Verify Results: Run the
Hand_Eye_Verification.py
script to verify the calibration results.
The data
folder contains two CSV files:
- GT_data_and_joint_values_for_factor_graph_base_on_symforce.csv: Contains the ground truth data and joint values for a specific calibration experiment.
- GT_data_and_joint_values_for_factor_graph_base_on_symforce_20.csv: Contains the ground truth data and joint values for a different calibration experiment.
The DiamondFactor.cpp
file uses the data from the GT_data_and_joint_values_for_factor_graph_base_on_symforce_20.csv
file to perform the calibration. The Hand_Eye_Verification.py
script then verifies the calibration results using the data from both CSV files.
- The calibration process assumes that the diamond calibration pattern is known and that the camera's intrinsic parameters are calibrated.
- The
DiamondCalibrationFactor
class in thelib
folder implements the GTSAM factor for the diamond calibration error model. - The
Hand_Eye_Verification.py
script uses the Symforce library to symbolically calculate the error between the predicted and ground truth camera poses.
- Extend the calibration process to include other robot arm parameters, such as joint offsets and link lengths.
- Develop a user-friendly interface for data acquisition and calibration.