ABB_RAPID_IRC5.py
Go to the documentation of this file.
1 # Copyright 2017 - RoboDK Software S.L. - http://www.robodk.com/
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at
5 # http://www.apache.org/licenses/LICENSE-2.0
6 # Unless required by applicable law or agreed to in writing, software
7 # distributed under the License is distributed on an "AS IS" BASIS,
8 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9 # See the License for the specific language governing permissions and
10 # limitations under the License.
11 
12 # ----------------------------------------------------
13 # This file is a POST PROCESSOR for Robot Offline Programming to generate programs
14 # for an ABB robot with RoboDK
15 #
16 # To edit/test this POST PROCESSOR script file:
17 # Select "Program"->"Add/Edit Post Processor", then select your post or create a new one.
18 # You can edit this file using any text editor or Python editor. Using a Python editor allows to quickly evaluate a sample program at the end of this file.
19 # Python should be automatically installed with RoboDK
20 #
21 # You can also edit the POST PROCESSOR manually:
22 # 1- Open the *.py file with Python IDLE (right click -> Edit with IDLE)
23 # 2- Make the necessary changes
24 # 3- Run the file to open Python Shell: Run -> Run module (F5 by default)
25 # 4- The "test_post()" function is called automatically
26 # Alternatively, you can edit this file using a text editor and run it with Python
27 #
28 # To use a POST PROCESSOR file you must place the *.py file in "C:/RoboDK/Posts/"
29 # To select one POST PROCESSOR for your robot in RoboDK you must follow these steps:
30 # 1- Open the robot panel (double click a robot)
31 # 2- Select "Parameters"
32 # 3- Select "Unlock advanced options"
33 # 4- Select your post as the file name in the "Robot brand" box
34 #
35 # To delete an existing POST PROCESSOR script, simply delete this file (.py file)
36 #
37 # ----------------------------------------------------
38 # More information about RoboDK Post Processors and Offline Programming here:
39 # http://www.robodk.com/help#PostProcessor
40 # http://www.robodk.com/doc/en/PythonAPI/postprocessor.html
41 # ----------------------------------------------------
42 
43 
44 # ----------------------------------------------------
45 # Import RoboDK tools
46 from robodk import *
47 
48 ONETAB = ' ' # one tab equals 4 spaces
49 
50 # Define a custom header (variable declaration)
51 CUSTOM_HEADER = '''
52  ! -------------------------------
53  ! Define your variables here
54  ! ...
55 '''
56 
57 # Define your custom programs (predefined functions, not altered by RoboDK):
58 CUSTOM_FUNCTIONS = '''
59  ! -------------------------------
60  ! Define your functions here
61  ! ...
62 '''
63 
64 # ----------------------------------------------------
65 def pose_2_str(pose):
66  """Prints a pose target"""
67  [x,y,z,q1,q2,q3,q4] = Pose_2_ABB(pose)
68  return ('[%.3f, %.3f, %.3f],[%.8f, %.8f, %.8f, %.8f]' % (x,y,z,q1,q2,q3,q4))
69 
70 def angles_2_str(angles):
71  """Prints a joint target"""
72  njoints = len(angles)
73  # extend the joint target if the robot has less than 6 degrees of freedom
74  if njoints < 6:
75  angles.extend([0]*(6-njoints))
76  # Generate a string like:
77  # [10,20,30,40,50,60]
78  # with up to 6 decimals
79  return '[%s]' % (','.join(format(ji, ".6f") for ji in angles[0:6]))
80 
81 def extaxes_2_str(angles):
82  """Prints the external axes, if any"""
83  # extend the joint target if the robot has less than 6 degrees of freedom
84  njoints = len(angles)
85  if njoints <= 6:
86  # should print 9E9 for unset external axes
87  # [9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]
88  return '[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]'
89  extaxes_str = (','.join(format(ji, ".6f") for ji in angles[6:njoints]))
90  if njoints < 12:
91  extaxes_str = extaxes_str + ',' + ','.join(['9E9']*(12-njoints))
92  # If angles is [j1,j2,j3,j4,j5,j6,10,20], it will generate a string like:
93  # [10,20,9E9,9E9,9E9,9E9]
94  # with up to 6 decimals
95  return '[%s]' % extaxes_str
96 
97 # ----------------------------------------------------
98 # Object class that handles the robot instructions/syntax
99 class RobotPost(object):
100  """Robot post object"""
101  MAX_LINES_X_PROG = 5000 # maximum number of lines per program. It will then generate multiple "pages (files)"
102  INCLUDE_SUB_PROGRAMS = True
103  PROG_EXT = 'mod' # set the program extension
104 
105  # other variables
106  ROBOT_POST = 'ABB IRC5 including arc welding and 3D printing options'
107  ROBOT_NAME = 'unknown'
108  PROG_NAMES = []
109  PROG_FILES = []
110  PROG_LIST = []
111  PROG_CALLS = []
112  PROG_CALLS_LIST = []
113  nLines = 0
114  nProgs = 0
115 
116  PROG = []
117  TAB = ''
118  LOG = ''
119  SPEEDDATA = 'rdkSpeed'
120  ZONEDATA = 'z1'
121  TOOLDATA = 'rdkTool'
122  WOBJDATA = 'rdkWObj'
123  nAxes = 6
124 
125  CLAD_ON = False
126  CLAD_DATA = 'clad1'
127 
128  ARC_ON = False
129  ARC_WELDDATA = 'weld1'
130  ARC_WEAVEDATA = 'weave1'
131  ARC_SEAMDATA = 'seam1'
132 
133  NEW_E_LENGTH = None
134 
135 
136  def __init__(self, robotpost=None, robotname=None, robot_axes = 6, **kwargs):
137  self.ROBOT_POST = robotpost
138  self.ROBOT_NAME = robotname
139  self.PROG = []
140  self.LOG = ''
141  self.nAxes = robot_axes
142  for k,v in kwargs.items():
143  if k == 'lines_x_prog':
145 
146  def ProgStart(self, progname, new_page = False):
147  progname_i = progname
148  nPages = len(self.PROG_LIST)
149  if new_page:
150  if nPages == 0:
151  progname_i = progname
152  else:
153  progname_i = "%s%i" % (self.PROG_NAME, nPages)
154 
155  else:
156  self.nProgs = self.nProgs + 1
157  if self.nProgs == 1:# and not self.INCLUDE_SUB_PROGRAMS:
158  self.PROG_NAME = progname
159  #self.nProgs = self.nProgs + 1
160 
161  if new_page or not self.INCLUDE_SUB_PROGRAMS or self.nProgs == 1:
162  # new file!
163  self.PROG_NAMES.append(progname_i)
164  self.TAB = ''
165  self.addline('%%%')
166  self.addline(' VERSION:1')
167  self.addline(' LANGUAGE:ENGLISH')
168  self.addline('%%%')
169  self.addline('')
170  self.addline('MODULE MOD_%s' % progname_i)
171  self.TAB = ONETAB
172 
173  if self.nProgs == 1 and nPages == 0:
174  self.TAB = ONETAB
175  self.addline('')
176  self.addline('LOCAL PERS tooldata %s := [TRUE,[[0,0,0],[1,0,0,0]],[2,[0,0,15],[1,0,0,0],0,0,0.005]];' % self.TOOLDATA)
177  self.addline('LOCAL PERS wobjdata %s := [FALSE, TRUE, "", [[0,0,0],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];' % self.WOBJDATA)
178  self.addline('VAR speeddata %s := [250,500,5000,1000]; ! set default speed' % self.SPEEDDATA)
179  self.addcode(CUSTOM_HEADER)
180  self.addcode(CUSTOM_FUNCTIONS)
181 
182  self.TAB = ONETAB
183  self.addline('')
184  self.addline('PROC %s()' % progname_i)
185  self.TAB = ONETAB + ONETAB # instructions need two tabs
186  self.addline('ConfJ \On;')
187  self.addline('ConfL \Off;')
188 
189  def ProgFinish(self, progname, new_page = False):
190  self.TAB = ONETAB
191  self.PROG += [ONETAB + 'ENDPROC\n']
192  if new_page or not self.INCLUDE_SUB_PROGRAMS:# or self.nProgs == 1:
193  self.PROG += ['ENDMODULE']
194  self.PROG_LIST.append(self.PROG)
195  self.PROG_CALLS_LIST.append(self.PROG_CALLS)
196  self.PROG = []
197  self.PROG_CALLS = []
198  self.nLines = 0
199  #elif self.nProgs <= 1 or self.INCLUDE_SUB_PROGRAMS:
200  # self.PROG += ['ENDMODULE']
201 
202  def progsave(self, folder, progname, ask_user = False, show_result = False):
203  progname = progname + '.' + self.PROG_EXT
204  if ask_user or not DirExists(folder):
205  filesave = getSaveFile(folder, progname, 'Save program as...')
206  if filesave is not None:
207  filesave = filesave.name
208  else:
209  return
210  else:
211  filesave = folder + '/' + progname
212 
213  fid = open(filesave, "w")
214  for line in self.PROG:
215  fid.write(line)
216  fid.write('\n') # print new line
217 
218  fid.close()
219  print('SAVED: %s\n' % filesave) # tell RoboDK the path of the saved file
220  self.PROG_FILES.append(filesave)
221 
222  # open file with default application
223  if show_result:
224  if type(show_result) is str:
225  # Open file with provided application
226  import subprocess
227  p = subprocess.Popen([show_result, filesave])
228  elif type(show_result) is list:
229  import subprocess
230  p = subprocess.Popen(show_result + [filesave])
231  else:
232  # open file with default application
233  import os
234 
235  os.startfile(filesave)
236  if len(self.LOG) > 0:
237  mbox('Program generation LOG:\n\n' + self.LOG)
238 
239  def ProgSave(self, folder, progname, ask_user = False, show_result = False):
240  if len(self.PROG_LIST) >= 1:
241  if self.nLines > 0:
242  self.PROG += ['ENDMODULE']
243  self.PROG_LIST.append(self.PROG)
244  self.PROG_CALLS_LIST.append(self.PROG_CALLS)
245  self.PROG = []
246  self.PROG_CALLS = []
247  self.nLines = 0
248 
249  npages = len(self.PROG_LIST)
250  progname_main = progname + "Main"
251  mainprog = []
252  mainprog += ["MODULE MOD_%s\n" % progname_main]
253  mainprog += [ONETAB+"!PROC Main()"]
254  mainprog += [ONETAB+"PROC %s()" % progname_main]
255  mainprog += [ONETAB+ONETAB+"! This main program needs to be executed to run: %s\n" % progname]
256  for i in range(npages):
257  mainprog += [ONETAB+ONETAB+"%s()" % self.PROG_NAMES[i]]
258  mainprog += ["\n"+ONETAB+"ENDPROC\n"]
259  mainprog += ["ENDMODULE"]
260 
261  self.PROG = mainprog
262  self.progsave(folder, progname_main, ask_user, show_result)
263  self.LOG = ''
264  if len(self.PROG_FILES) == 0:
265  # cancelled by user
266  return
267 
268  first_file = self.PROG_FILES[0]
269  folder_user = getFileDir(first_file)
270  # progname_user = getFileName(self.FILE_SAVED)
271 
272  for i in range(npages):
273  self.PROG = self.PROG_LIST[i]
274  self.PROG_CALLS = self.PROG_CALLS_LIST[i]
275  self.progsave(folder_user, self.PROG_NAMES[i], False, show_result)
276 
277  else:
278  self.PROG += ['ENDMODULE'] # Very important!
279  self.progsave(folder, progname, ask_user, show_result)
280 
281 
282  def ProgSendRobot(self, robot_ip, remote_path, ftp_user, ftp_pass):
283  """Send a program to the robot using the provided parameters. This method is executed right after ProgSave if we selected the option "Send Program to Robot".
284  The connection parameters must be provided in the robot connection menu of RoboDK"""
285  UploadFTP(self.PROG_FILES, robot_ip, remote_path, ftp_user, ftp_pass)
286 
287  def MoveJ(self, pose, joints, conf_RLF=None):
288  """Add a joint movement"""
289  self.addline('MoveAbsJ [%s,%s],%s,%s,%s,\WObj:=%s;' % (angles_2_str(joints), extaxes_2_str(joints), self.SPEEDDATA, self.ZONEDATA, self.TOOLDATA, self.WOBJDATA))
290 
291  def MoveL(self, pose, joints, conf_RLF=None):
292  """Add a linear movement"""
293 
294  # Control turning arc movement off
295  if self.ARC_ON and self.NEW_E_LENGTH is None:
296  self.ARC_ON = False
297  self.addline('ArcLEnd;')
298 
299  target = ''
300  if pose is None:
301  target = 'CalcRobT([%s,%s],%s,\WObj:=%s)' % (angles_2_str(joints), extaxes_2_str(joints), self.TOOLDATA, self.WOBJDATA)
302  else:
303  if conf_RLF is None:
304  conf_RLF = [0,0,0]
305  cf1 = 0
306  cf4 = 0
307  cf6 = 0
308  if joints is not None and len(joints) >= 6:
309  cf1 = math.floor(joints[0]/90.0)
310  cf4 = math.floor(joints[3]/90.0)
311  cf6 = math.floor(joints[5]/90.0)
312  [REAR, LOWERARM, FLIP] = conf_RLF
313  cfx = 4*REAR + 2*LOWERARM + FLIP
314  target = '[%s,[%i,%i,%i,%i],%s]' % (pose_2_str(pose), cf1, cf4, cf6,cfx, extaxes_2_str(joints))
315 
316  if self.ARC_ON:
317  # ArcL p100, v100, seam1, weld5 \Weave:=weave1, z10, gun1;
318  self.addline('ArcL %s,%s,%s,%s,\Weave:=%s,%s,%s,\WObj:=%s;' % (target, self.SPEEDDATA, self.ARC_SEAMDATA, self.ARC_WELDDATA, self.ARC_WEAVEDATA, self.ZONEDATA, self.TOOLDATA, self.WOBJDATA))
319  elif self.CLAD_ON:
320  self.addline('CladL %s,%s,%s,%s,%s,\WObj:=%s;' % (target, self.SPEEDDATA, self.CLAD_DATA, self.ZONEDATA, self.TOOLDATA, self.WOBJDATA))
321  else:
322  self.addline('MoveL %s,%s,%s,%s,\WObj:=%s;' % (target, self.SPEEDDATA, self.ZONEDATA, self.TOOLDATA, self.WOBJDATA))
323 
324  # Modification for Paul
325  self.NEW_E_LENGTH = None
326 
327  def MoveC(self, pose1, joints1, pose2, joints2, conf_RLF_1=None, conf_RLF_2=None):
328  """Add a circular movement"""
329  target1 = ''
330  target2 = ''
331  if pose1 is None:
332  target1 = 'CalcRobT([%s,%s], %s \WObj:=%s)' % (angles_2_str(joints1), extaxes_2_str(joints1), self.TOOLDATA, self.WOBJDATA)
333  else:
334  if conf_RLF_1 is None:
335  conf_RLF_1 = [0,0,0]
336  cf1_1 = 0
337  cf4_1 = 0
338  cf6_1 = 0
339  if joints1 is not None and len(joints1) >= 6:
340  cf1_1 = math.floor(joints1[0]/90.0)
341  cf4_1 = math.floor(joints1[3]/90.0)
342  cf6_1 = math.floor(joints1[5]/90.0)
343  [REAR, LOWERARM, FLIP] = conf_RLF_1
344  cfx_1 = 4*REAR + 2*LOWERARM + FLIP
345  target1 = '[%s,[%i,%i,%i,%i],%s]' % (pose_2_str(pose1), cf1_1, cf4_1, cf6_1,cfx_1, extaxes_2_str(joints1))
346 
347  if pose2 is None:
348  target2 = 'CalcRobT([%s,%s],%s,\WObj:=%s)' % (angles_2_str(joints2), extaxes_2_str(joints2), self.TOOLDATA, self.WOBJDATA)
349  else:
350  if conf_RLF_2 is None:
351  conf_RLF_2 = [0,0,0]
352  cf1_2 = 0
353  cf4_2 = 0
354  cf6_2 = 0
355  if joints2 is not None and len(joints2) >= 6:
356  cf1_2 = math.floor(joints2[0]/90.0)
357  cf4_2 = math.floor(joints2[3]/90.0)
358  cf6_2 = math.floor(joints2[5]/90.0)
359  [REAR, LOWERARM, FLIP] = conf_RLF_2
360  cfx_2 = 4*REAR + 2*LOWERARM + FLIP
361  target2 = '[%s,[%i,%i,%i,%i],%s]' % (pose_2_str(pose2), cf1_2, cf4_2, cf6_2,cfx_2, extaxes_2_str(joints2))
362 
363  if self.ARC_ON:
364  # ArcL p100, v100, seam1, weld5 \Weave:=weave1, z10, gun1;
365  self.addline('ArcC %s,%s,%s,%s,%s,\Weave:=%s,%s,%s,\WObj:=%s;' % (target1, target2, self.SPEEDDATA, self.ARC_SEAMDATA, self.ARC_WELDDATA, self.ARC_WEAVEDATA, self.ZONEDATA, self.TOOLDATA, self.WOBJDATA))
366  elif self.CLAD_ON:
367  self.addline('CladC %s,%s,%s,%s,%s,%s,\WObj:=%s;' % (target1, target2, self.SPEEDDATA, self.CLAD_DATA, self.ZONEDATA, self.TOOLDATA, self.WOBJDATA))
368  else:
369  self.addline('MoveC %s,%s,%s,%s,%s,\WObj:=%s;' % (target1, target2, self.SPEEDDATA, self.ZONEDATA, self.TOOLDATA, self.WOBJDATA))
370 
371  def setFrame(self, pose, frame_id=None, frame_name=None):
372  """Change the robot reference frame"""
373  #self.addline('%s := [FALSE, TRUE, "", [%s],[[0,0,0],[1,0,0,0]]];' % (self.WOBJDATA, pose_2_str(pose)))
374  self.addline('%s.uframe := [%s];' % (self.WOBJDATA, pose_2_str(pose)))
375 
376  def setTool(self, pose, tool_id=None, tool_name=None):
377  """Change the robot TCP"""
378  #self.addline('%s := [TRUE,[%s],[2,[0,0,15],[1,0,0,0],0,0,0.005]];' % (self.TOOLDATA, pose_2_str(pose)))
379  self.addline('%s.tframe := [%s];' % (self.TOOLDATA, pose_2_str(pose)))
380 
381  def Pause(self, time_ms):
382  """Pause the robot program"""
383  if time_ms <= 0:
384  self.addline('STOP;')
385  else:
386  self.addline('WaitTime %.3f;' % (time_ms*0.001))
387 
388  def setSpeed(self, speed_mms):
389  """Changes the robot speed (in mm/s)"""
390  #self.SPEEDDATA = 'v%i' % speed_mms
391  self.addline('%s := [%.2f,500,5000,1000];' % (self.SPEEDDATA, speed_mms))
392 
393  def setAcceleration(self, accel_mmss):
394  """Changes the robot acceleration (in mm/s2)"""
395  self.addlog('setAcceleration is not defined')
396 
397  def setSpeedJoints(self, speed_degs):
398  """Changes the robot joint speed (in deg/s)"""
399  self.addlog('setSpeedJoints not defined')
400 
401  def setAccelerationJoints(self, accel_degss):
402  """Changes the robot joint acceleration (in deg/s2)"""
403  self.addlog('setAccelerationJoints not defined')
404 
405  def setZoneData(self, zone_mm):
406  """Changes the zone data approach (makes the movement more smooth)"""
407  if zone_mm < 0:
408  self.ZONEDATA = 'fine'
409  else:
410  self.ZONEDATA = 'z%i' % zone_mm
411 
412  def setDO(self, io_var, io_value):
413  """Sets a variable (output) to a given value"""
414  if type(io_var) != str: # set default variable name if io_var is a number
415  io_var = 'D_OUT_%s' % str(io_var)
416  if type(io_value) != str: # set default variable value if io_value is a number
417  if io_value > 0:
418  io_value = '1'
419  else:
420  io_value = '0'
421 
422  # at this point, io_var and io_value must be string values
423  self.addline('SetDO %s, %s;' % (io_var, io_value))
424 
425  def waitDI(self, io_var, io_value, timeout_ms=-1):
426  """Waits for an input io_var to attain a given value io_value. Optionally, a timeout can be provided."""
427  if type(io_var) != str: # set default variable name if io_var is a number
428  io_var = 'D_IN_%s' % str(io_var)
429  if type(io_value) != str: # set default variable value if io_value is a number
430  if io_value > 0:
431  io_value = '1'
432  else:
433  io_value = '0'
434 
435  # at this point, io_var and io_value must be string values
436  if timeout_ms < 0:
437  self.addline('WaitDI %s, %s;' % (io_var, io_value))
438  else:
439  self.addline('WaitDI %s, %s, \MaxTime:=%.1f;' % (io_var, io_value, timeout_ms*0.001))
440 
441  def RunCode(self, code, is_function_call = False):
442  """Adds code or a function call"""
443  if is_function_call:
444  code = code.replace(' ','_')
445  if code.startswith('ArcLStart'):
446  self.ARC_ON = True
447  elif code.startswith('ArcLEnd'):
448  self.ARC_ON = False
449  elif code.startswith('CladLStart'):
450  self.CLAD_ON = True
451  elif code.startswith('CladLEnd'):
452  self.CLAD_ON = False
453  elif code.startswith("Extruder("):
454  self.addline(code + ';')
455  return
456 
457  # if the program call is Extruder(123.56), we extract the number as a string and convert it to a number
458  self.NEW_E_LENGTH = float(code[9:-1]) # it needs to retrieve the extruder length from the program call
459  # Parse the Extruder into ArcLStart
460  if not self.ARC_ON:
461  # Generate ArcLStart if we are not welding yet
462  self.ARC_ON = True
463  self.addline('ArcLStart;')
464  # Do not generate the program call
465  return
466 
467  self.addline(code + ';')
468  else:
469  if code.startswith('END') or code.startswith('ELSEIF'):
470  # remove tab after ENDWHILE or ENDIF
471  self.TAB = self.TAB[:-len(ONETAB)]
472 
473  self.addline(code.replace('\t',' '))# replace each tab by 2 spaces
474 
475  if code.startswith('IF ') or code.startswith('ELSEIF ') or code.startswith('WHILE '):
476  # add tab (one tab = two spaces)
477  self.TAB = self.TAB + ONETAB
478 
479 
480  def RunMessage(self, message, iscomment = False):
481  """Add a joint movement"""
482  if iscomment:
483  self.addline('! ' + message)
484  else:
485  self.addline('TPWrite "%s";' % message)
486 
487 # ------------------ private ----------------------
488  def addline(self, newline):
489  """Add a program line"""
490  if self.nProgs > 1 and not self.INCLUDE_SUB_PROGRAMS:
491  return
492 
493  if self.nLines > self.MAX_LINES_X_PROG:
494  self.nLines = 0
495  self.ProgFinish(self.PROG_NAME, True)
496  self.ProgStart(self.PROG_NAME, True)
497 
498  self.PROG += [self.TAB + newline]
499  self.nLines = self.nLines + 1
500 
501  def addlog(self, newline):
502  """Add a log message"""
503  if self.nProgs > 1 and not self.INCLUDE_SUB_PROGRAMS:
504  return
505  self.LOG = self.LOG + newline + '\n'
506 
507  def addcode(self, code):
508  """Adds custom code, such as a custom header"""
509  self.PROG += [code]
510 
511 
512 # -------------------------------------------------
513 # ------------ For testing purposes ---------------
514 def Pose(xyzrpw):
515  [x,y,z,r,p,w] = xyzrpw
516  a = r*math.pi/180
517  b = p*math.pi/180
518  c = w*math.pi/180
519  ca = math.cos(a)
520  sa = math.sin(a)
521  cb = math.cos(b)
522  sb = math.sin(b)
523  cc = math.cos(c)
524  sc = math.sin(c)
525  return Mat([[cb*ca, ca*sc*sb - cc*sa, sc*sa + cc*ca*sb, x],[cb*sa, cc*ca + sc*sb*sa, cc*sb*sa - ca*sc, y],[-sb, cb*sc, cc*cb, z],[0,0,0,1]])
526 
527 def test_post():
528  """Test the post with a basic program"""
529 
530  robot = RobotPost(r'ABB_RAPID_IRC5', r'ABB IRB 6700-155/2.85', 6, axes_type=['R','R','R','R','R','R'])
531 
532  robot.ProgStart(r'Prog1')
533  robot.RunMessage(r'Program generated by RoboDK 3.1.5 for ABB IRB 6700-155/2.85 on 18/05/2017 11:02:41', True)
534  robot.RunMessage(r'Using nominal kinematics.', True)
535  robot.setFrame(Pose([0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000]),-1,r'ABB IRB 6700-155/2.85 Base')
536  robot.setTool(Pose([380.000000, 0.000000, 200.000000, 0.000000, 90.000000, 0.000000]),1,r'Tool 1')
537  robot.setSpeed(2000.000)
538  robot.MoveJ(Pose([2103.102861, 0.000000, 1955.294643, -180.000000, -3.591795, -180.000000]), [0.00000, 3.93969, -14.73451, 0.00000, 14.38662, -0.00000], [0.0, 0.0, 0.0])
539  robot.MoveJ(Pose([2065.661612, 700.455189, 1358.819971, 180.000000, -3.591795, -180.000000]), [22.50953, 5.58534, 8.15717, 67.51143, -24.42689, -64.06258], [0.0, 0.0, 1.0])
540  robot.Pause(500.0)
541  robot.setSpeed(100.000)
542  robot.RunCode(r'ArcLStart', True)
543  robot.MoveL(Pose([2065.661612, 1074.197508, 1358.819971, 149.453057, -3.094347, -178.175378]), [36.19352, 22.86988, -12.37860, 88.83085, -66.57439, -81.72795], [0.0, 0.0, 1.0])
544  robot.MoveC(Pose([2468.239418, 1130.614560, 1333.549802, -180.000000, -3.591795, -180.000000]), [28.37934, 35.45210, -28.96667, 85.54799, -28.41204, -83.00289], Pose([2457.128674, 797.241647, 1156.545094, 180.000000, -37.427062, -180.000000]), [18.58928, 43.77805, -40.05410, 155.58093, -37.76022, -148.70252], [0.0, 0.0, 1.0], [0.0, 0.0, 1.0])
545  robot.MoveL(Pose([2457.128674, 797.241647, 1156.545094, 180.000000, -37.427062, -180.000000]), [18.58928, 43.77805, -40.05410, 155.58093, -37.76022, -148.70252], [0.0, 0.0, 1.0])
546  robot.MoveL(Pose([2469.684137, 397.051453, 1356.565545, -180.000000, -3.591795, -180.000000]), [10.73523, 21.17902, -10.22963, 56.13802, -12.93695, -54.77268], [0.0, 0.0, 1.0])
547  robot.MoveL(Pose([2494.452316, 404.343933, 1751.146172, -180.000000, -3.591795, -180.000000]), [10.80299, 25.05092, -31.54821, 132.79244, -14.76878, -133.06820], [0.0, 0.0, 1.0])
548  robot.MoveL(Pose([2494.452316, 834.649436, 1751.146172, -180.000000, -3.591795, -180.000000]), [21.49850, 33.45974, -43.37980, 121.21995, -25.32130, -122.42907], [0.0, 0.0, 1.0])
549  robot.setZoneData(5.000)
550  robot.MoveL(Pose([2147.781731, 834.649436, 1772.906995, -180.000000, -3.591795, -180.000000]), [25.21677, 13.65153, -17.95808, 107.03387, -26.40518, -107.19412], [0.0, 0.0, 1.0])
551  robot.MoveL(Pose([2147.781731, 375.769504, 1772.906995, -180.000000, -3.591795, -180.000000]), [11.97030, 5.74930, -8.96838, 119.55454, -13.76610, -119.51539], [0.0, 0.0, 1.0])
552  robot.MoveL(Pose([2147.781731, 61.363728, 1772.906995, -180.000000, -3.591795, -180.000000]), [1.98292, 3.75693, -6.84136, -16.54793, 6.96416, 16.55673], [0.0, 0.0, 0.0])
553  robot.RunCode(r'ArcLEnd', True)
554  robot.MoveL(Pose([2147.781731, 275.581430, 1772.906995, -180.000000, -3.591795, -180.000000]), [8.83799, 4.80606, -7.95436, 127.27676, -11.11070, -127.24243], [0.0, 0.0, 1.0])
555  robot.ProgFinish(r'Prog1')
556  for line in robot.PROG:
557  print(line)
558  #print(robot.PROG)
559  if len(robot.LOG) > 0:
560  mbox('Program generation LOG:\n\n' + robot.LOG)
561  input("Press Enter to close...")
562 
563 if __name__ == "__main__":
564  """Function to call when the module is executed by itself: test"""
565  test_post()
def ProgFinish(self, progname, new_page=False)
def waitDI(self, io_var, io_value, timeout_ms=-1)
def UploadFTP(program, robot_ip, remote_path, ftp_user, ftp_pass)
Definition: robodk.py:1312
def RunCode(self, code, is_function_call=False)
def MoveL(self, pose, joints, conf_RLF=None)
def progsave(self, folder, progname, ask_user=False, show_result=False)
def MoveC(self, pose1, joints1, pose2, joints2, conf_RLF_1=None, conf_RLF_2=None)
def RunMessage(self, message, iscomment=False)
def __init__(self, robotpost=None, robotname=None, robot_axes=6, kwargs)
def mbox(msg, b1='OK', b2='Cancel', frame=True, t=False, entry=None)
Definition: robodk.py:1458
def MoveJ(self, pose, joints, conf_RLF=None)
def ProgStart(self, progname, new_page=False)
def getSaveFile(strdir='C:\\', strfile='file.txt', strtitle='Save file as ...')
Definition: robodk.py:1354
def ProgSave(self, folder, progname, ask_user=False, show_result=False)
def setFrame(self, pose, frame_id=None, frame_name=None)
def ProgSendRobot(self, robot_ip, remote_path, ftp_user, ftp_pass)
def setTool(self, pose, tool_id=None, tool_name=None)


ros_robodk_post_processors
Author(s): Victor Lamoine - Institut Maupertuis
autogenerated on Sun Jun 7 2020 03:50:22