Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python API to Move/Rotate in the tool frame
#1
In RoboDK GUI it is possible to choose "Tool Frame" and then using the virtual knob one can change the position and rotate accordingly.

I need this functionality to retract/approach the welding torch from the start welding point
#2
Hi Edo, 

I'm not so sure that I'm following you. 

Quote:In RoboDK GUI it is possible to choose "Tool Frame" 


Do you mean in a "Curve follow project" or just by double-clicking the tool in the station?


Quote:I need this functionality to retract/approach the welding torch from the start welding point

As I'm not so sure what you mean in the first sentence, this one doesn't make sense to me. 
Could you add a print screen showing what you do with the GUI? It would help us help you. 

Jeremy
#3
   
In the figure you can see the steps of making the welding gun retract from the weld position:
1/ choose the ToolFrame
2/ Set to axis Z
3/ Turn the knob
4/ Result is that the welding gun will retract in the tool -Z direction

I want to do the same thing but with Python API.

I know I can calculate the tools position and get the angles compare to the reference frame, but for sure you have some build-in command to do this.

I hope this clears my question.

Regards,
Edo
#4
Hi Edo,

I recommend you to use the RelTool function:
https://robodk.com/doc/en/PythonAPI/robo...at.RelTool
It is very similar to ABB's RelTool function in Rapid.

You can take a look at the source code to better understand how to do such transformations:
Code:
def RelTool(target_pose, x, y, z, rx=0,ry=0,rz=0):
   """Calculates a relative target with respect to the tool coordinates. This procedure has exactly the same behavior as ABB's RelTool instruction.
   X,Y,Z are in mm, W,P,R are in degrees."""
   new_target = target_pose*transl(x,y,z)*rotx(rx*pi/180)*roty(ry*pi/180)*rotz(rz*pi/180)
   return new_target

Albert
#5
Hi Edo,
Thanks for the clarification.
Albert's answer is your goto here.

Jeremy
  




Users browsing this thread:
1 Guest(s)