5. Tool Hand Calibration
1. Set the Tool Hand Number to be Calibrated
cpp
int toolNum = 3; // Tool hand number
set_tool_hand_number(fd, 1);2. After Moving the Robot Arm to the Calibration Point, Mark the Point
tool_hand_7_point_calibrate(fd, i, toolNum);// i is the marked point index. In 7-point calibration, i ranges from [1, 7]
3. After All 7 Points are Marked, Calculate the Calibration Result
cpp
tool_hand_7_point_calibrate_caculate(fd, toolNum, 7);7-Point Calibration Example:
cpp
int toolNum = 3; // Tool hand number
set_tool_hand_number(fd, toolNum);
for(int i = 1; i < 8; i++)
{
sleep(5); // Wait for the robot arm to move to the calibration point
tool_hand_7_point_calibrate(fd, i, toolNum);
printf("Calibrating point %d\n", i);
}
// After all points are marked, calculate the calibration result
tool_hand_7_point_calibrate_caculate(fd, toolNum, 7);20-Point Calibration Example:
cpp
int toolNum = 4; // Tool hand number
set_tool_hand_number(fd, toolNum);
for(int i = 1; i < 21; i++)
{
sleep(3); // Wait for the robot arm to move to the calibration point
tool_hand_2_or_20_point_calibrate(fd, i);
printf("Calibrating point %d\n", i);
}
// After all points are marked, calculate the calibration result
tool_hand_2_or_20_point_calibrate_caculate(fd, toolNum, false);