Skip to content

5.工具手标定

1,设置需要标定的工具手编号

cpp
int toolNum = 3;   //工具手编号
set_tool_hand_number(fd, 1);

2,将机械臂移动到标定的点位后,标记点位

tool_hand_7_point_calibrate(fd, i, toolNum);

// i为标记的位置编号,7点标定中i的范围为[1,7]

3,7个点全部标记完成后,计算标定结果

cpp
tool_hand_7_point_calibrate_caculate(fd, toolNum, 7);

7点标定示例:

cpp
  int toolNum = 3;   //工具手编号
  set_tool_hand_number(fd, toolNum);
  for(int i = 1; i < 8; i++)
  {
    sleep(5);   //等待机械臂移动到标定点位
    tool_hand_7_point_calibrate(fd, i, toolNum);
    printf("标定第%d个点\n", i);
  }
  //点位标定完成后需计算标定结果
  tool_hand_7_point_calibrate_caculate(fd, toolNum, 7);

20点标定示例:

cpp
  int toolNum = 4;   //工具手编号
  set_tool_hand_number(fd, toolNum);
  for(int i = 1; i < 21; i++)
  {
    sleep(3);   //等待机械臂移动到标定点位
    tool_hand_2_or_20_point_calibrate(fd, i);
    printf("标定第%d个点\n", i);
  }
  //点位标定完成后需计算标定结果
  tool_hand_2_or_20_point_calibrate_caculate(fd, toolNum, false);