队列运动接口

1. queue_motion_set_status - 开启/关闭队列模式

方法: queue_motion_set_status(socket_fd, status)

参数:

  • socket_fd:连接句柄
  • status:True表示开启队列模式,False表示关闭

返回值:

  • int:0表示成功,非0表示失败

使用示例:

Python
nrc.queue_motion_set_status(fd, status=True)   # 开启
# ... 添加指令 ...
nrc.queue_motion_set_status(fd, status=False)  # 关闭

2. queue_motion_push_back_moveJ - 添加MoveJ指令到本地队列

方法: queue_motion_push_back_moveJ(socket_fd, coord, vel, acc, dec, pl, pos_list)

参数:

  • socket_fd:连接句柄
  • coord:坐标系类型(0=关节坐标系)
  • vel:速度百分比
  • acc:加速度百分比
  • dec:减速度百分比
  • pl:平滑度
  • pos_list:目标位置列表(7个关节角度)

使用示例:

Python
pos = [50.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
nrc.queue_motion_push_back_moveJ(fd, coord=0, vel=20, acc=10, dec=10, pl=0, pos_list=pos)

3. queue_motion_push_back_moveL - 添加MoveL指令到本地队列

方法: queue_motion_push_back_moveL(socket_fd, coord, vel, acc, dec, pl, pos_list)

参数:

  • socket_fd:连接句柄
  • coord:坐标系类型(1=直角坐标系)
  • vel:速度百分比
  • acc:加速度百分比
  • dec:减速度百分比
  • pl:平滑度
  • pos_list:目标位置列表([x, y, z, rx, ry, rz, 0])

使用示例:

Python
nrc.queue_motion_push_back_moveL(fd, coord=1, vel=20, acc=10, dec=10, pl=0, pos_list=[200,100,300,0,0,0,0])

4. queue_motion_push_back_moveC - 添加MoveC指令到本地队列

方法: queue_motion_push_back_moveC(socket_fd, coord, vel, acc, dec, pl, pos_list)

参数:

  • socket_fd:连接句柄
  • coord:坐标系类型(1=直角坐标系)
  • vel:速度百分比
  • acc:加速度百分比
  • dec:减速度百分比
  • pl:平滑度
  • pos_list:目标位置(圆弧中间点+终点)

使用示例:

Python
nrc.queue_motion_push_back_moveC(fd, coord=1, vel=20, acc=10, dec=10, pl=0, pos_list=[250,100,300,0,0,0,0])

5. queue_motion_push_back_moveS - 添加MoveS指令到本地队列

方法: queue_motion_push_back_moveS(socket_fd, coord, vel, acc, dec, pl, pos_list)

参数:

  • socket_fd:连接句柄
  • coord:坐标系类型(1=直角坐标系)
  • vel:速度百分比
  • acc:加速度百分比
  • dec:减速度百分比
  • pl:平滑度
  • pos_list:目标位置列表

使用示例:

Python
nrc.queue_motion_push_back_moveS(fd, coord=1, vel=20, acc=10, dec=10, pl=0, pos_list=[300,100,300,0,0,0,0])

6. queue_motion_send_to_controller - 发送队列到控制器

方法: queue_motion_send_to_controller(socket_fd, max_size, clear_old)

参数:

  • socket_fd:连接句柄
  • max_size:最大发送数量
  • clear_old:是否清除旧数据

使用示例:

Python
nrc.queue_motion_send_to_controller(fd, max_size=3, clear_old=False)