09-12-2019, 08:24 AM
I feel like this might be an obvious answer, but when moving the robot in the pythonapi over a rotating userframe from a turntable it looks like the tool aligns with the z-axis of the userframe instead of the normal of the target.
I have included an rdk file that illustrates this. This python code will not run as it is dependent on an external library, but I have generated the program 'rep_path' to review. I currently have an arbitrary tool offset of "orient_frame2tool=roty(pi/2)*rotz(pi/2)" inserted in to force the tool in the proper orientation so I can see what is going on, but I think I shouldn't have to add this in.
The relevant function isdef draw_path(rbt, uframe, utool, poses):
我相信我是德claring the userframe and toolframe correctly.
My goal is to keep the toolhead straight as the curve rotates underneath it. From adding the curve I believe my normals are correct. Experimenting with a machining project I also believe this to be the case.
The input data is a [x,y,z,r,p,w] list and I am converting it withxyzrpw_2_pose,and then modifying the external rotary axis with
wheretrans_path[j][0], andtrans_path[j][1] are the x,y coordinates respectively. This will rotate the turntable underneath the end effector as it completed the motion. Howeverthe toolframe does not seem to be aligned with the normals as the curve is rotating, however it does appear to be aligned with the rotating reference frame.
Can you explain what is going on here, and how I can fix it.
Your help is much appreciated :)
Thanks,
Matt
I have included an rdk file that illustrates this. This python code will not run as it is dependent on an external library, but I have generated the program 'rep_path' to review. I currently have an arbitrary tool offset of "orient_frame2tool=roty(pi/2)*rotz(pi/2)" inserted in to force the tool in the proper orientation so I can see what is going on, but I think I shouldn't have to add this in.
The relevant function isdef draw_path(rbt, uframe, utool, poses):
我相信我是德claring the userframe and toolframe correctly.
Code:
prog.setPoseFrame(uframe)
prog.setPoseTool(utool)
My goal is to keep the toolhead straight as the curve rotates underneath it. From adding the curve I believe my normals are correct. Experimenting with a machining project I also believe this to be the case.
The input data is a [x,y,z,r,p,w] list and I am converting it withxyzrpw_2_pose,and then modifying the external rotary axis with
Code:
hs_pos = atan2(trans_path[j][0], trans_path[j][1])* 180 / pi
external_axes = [rail_pos, hs_pos]
target.setJoints([0,0,0,0,0,0] + external_axes)
target.setPose(p_i*orient_frame2tool)
wheretrans_path[j][0], andtrans_path[j][1] are the x,y coordinates respectively. This will rotate the turntable underneath the end effector as it completed the motion. Howeverthe toolframe does not seem to be aligned with the normals as the curve is rotating, however it does appear to be aligned with the rotating reference frame.
Can you explain what is going on here, and how I can fix it.
Your help is much appreciated :)
Thanks,
Matt