Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Set tool offset orientation using python

#1
Using the "machining project" plugin in RoboDK it is possible to specify a rotation in the section "Path to tool offset". Now I'm creating the machining project using python, which works fine, except that I'm not able to set the tool offset orientation. Currently I have to do this manual, after the program is created. The code I'm use:
Code:
path_settings = RDK.AddMachiningProject("milling")
prog, status = path_settings.setMachiningParameters(ncfile="Milling Bowl 3x.nc", part=RDK.Item('FrameTest'), params="RotZ_Range=45 RotZ_Step=5 rotz(90) NormalApproach=50 Optim_Turntable=Yes Offset_Turntable=90")


I guess the orientation needs to be set in the params section, but I can't find a solution in the python documentation. Using setPoseTool() did not work, since this just change the pose of the tool.
Does someone have a hint, how the tool offset can be modified?
#2
Yes, you can change the Path to tool offset by using setPose. For example, for a 180 deg rotation around the Z axis you can do:

Code:
milling_settings = RDK.AddMachiningProject("Machining Settings")
milling_settings.setMachiningParameters(...)
milling_settings.setPose(rotz(pi)) # set the path to tool offset
milling_settings.setJoints(robot.Joints()) # set the preferred start joints

Among other things you can also do:
  • Set the preferred start joints using setJoints as shown in the same example.
  • Select the tool by using milling_settings.setPoseTool(tool).
  • Select the reference frame using milling_settings.setPoseFrame(reference).
  • Set the NC file (CAM) by using: milling_settings.setParam('FileNC', path-to-NC-file)
  • Get the current robot/tool/reference using milling_settings.getLink(ITEM_TYPE_TOOL).
  




Users browsing this thread:
1 Guest(s)