I want to move TCP along X, or Y or Z axis of tool coordinate by script. I know how to move TCP in base by script. The following is the function to move TCP in Z direction in base by script. Can anybody tell me what to do in tool coordinate instead of base coordinate?
def CUR_MoveZ(a, b, c):
pos = get_actual_tcp_pose() pos=pos+a movel(pos, b, c)
Please take a look at the pose_trans() command in the URScript manual. If you pass the result of get_actual_tcp_pose() to pose trans as the first argument, any X, Y or Z offsets specified in a pose as the second argument will be relative to the tool frame. You can then pass the result of this to your move command.
Or you could nest them all together in one line: