你好。我目前需求是要实现类似于示教器里面“移动“选项卡的工具特征下,TCP方向RX,RY方向移动的编程实现,目前我的代码实现如下
os = get_tcp_offset()
set_tcp(p[{TcpOffsetX},0,{TcpOffsetZ + len},os[0],os[1],os[2]])
np = get_actual_tcp_pose()
tp = pose_trans(np, p[0,0,0,{offsetRx},{offsetRy},{offsetRz}])
while get_inverse_kin_has_solution(tp):
movej(tp, a ={_acc}, v = {_vel}, t = 0, r = 0)
tp = pose_trans(tp, p[0,0,0,{offsetRx},{offsetRy},{offsetRz}])
end
Program
BeforeStart
count≔0
directionFlag≔ False
originalPose≔get_actual_tcp_pose()
Robot Program
If directionFlag
movel(pose_trans(get_actual_tcp_pose(),p[0,0,0,d2r(-10),0,0]),a=1.2,v=0.25)
Else
movel(pose_trans(get_actual_tcp_pose(),p[0,0,0,d2r(10),0,0]),a=1.2,v=0.25)
count≔count + 1
If mod(count,4)==0
directionFlag≔ not directionFlag
Wait: 2.0
If count == 24
finalPose≔get_actual_tcp_pose()
halt