Comau_C5G_Joints.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 Comau C5G robots
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 MACRO_MESSAGE_TP = '''-- Display message on the teach pendant:
45  WIN_DEL ('menu:')
46  -- popup window over window USR1
47  WIN_POPUP('POP1:', 'USR1:')
48  -- open a lun on window POP1
49  OPEN FILE lun ('POP1:', 'rw')
50  WRITE lun ('%s', NL)
51  CLOSE FILE lun
52  -- let user read the message
53  DELAY 5000
54  -- Remove and delete window POP1 from user screen
55  WIN_REMOVE('POP1:')
56  WIN_DEL('POP1:')
57  ------------------'''
58 
59 # ----------------------------------------------------
60 # Import RoboDK tools
61 from robodk import *
62 
63 # gearbox ratio for external axes
64 RATIO_EXTAX = [1,1,1,1,1,1] #[10.6/360.0, 1, 1, 1, 1, 1]
65 
66 
67 
68 # ----------------------------------------------------
69 # Object class that handles the robot instructions/syntax
70 class RobotPost(object):
71  """Robot post processor class"""
72  PROG_EXT = 'pdl' # set the program extension
73  MAX_LINES_X_PROG = 5000 # maximum number of lines per program. It will then generate multiple "pages (files)"
74  INCLUDE_SUB_PROGRAMS = True
75  #INCLUDE_SUB_PROGRAMS = False
76 
77  # other variables
78  ROBOT_POST = ''
79  ROBOT_NAME = ''
80 
81  # Multiple program files variables
82  PROG_NAME = 'unknown' # single program name
83  PROG_NAMES = []
84  PROG_FILES = []
85  PROG_LIST = []
86  PROG_VARS = []
87  SPEED_MMS = 1000
88  ACCEL_MMSS = 100
89  FLY_DIST = -1 # set to >0 to use MOVEFLY
90  IMPORTS = []
91  PROG = ''
92  ROUTINES = ''
93  nLines = 0
94  nProgs = 0
95  LOG = ''
96  nAxes = 6
97  TAB = ''
98  LAST_POSE = None
99  LAST_E_LENGTH = 0
100  NEW_E_LENGTH = 0
101 
102  # ---------------------------------------------------
103 
104  def joints_2_str(self, joints):
105  """Contverts a joint target to a string"""
106  if joints is not None and len(joints) > 6:
107  joints[6] = joints[6]*RATIO_EXTAX[0]
108  return '{%s}' % (','.join(format(ji, ".5f") for ji in joints))
109 
110  def pose_2_str(self, pose,joints=None,conf_RLF=None):
111  """Converts a pose target to a string"""
112  [x,y,z,w,p,r] = Pose_2_Comau(pose)
113  config = []
114  # WARNING: Config only available for SMART type of contollers
115  if conf_RLF is not None:
116  if conf_RLF[0] > 0:
117  config.append('S')
118 
119  if conf_RLF[1] > 0:
120  config.append('E')
121 
122  if joints is not None:
123  #self.addline('cnfg_str := POS_GET_CNFG(%s)' % self.joints_2_str(joints))
124  #config = 'cnfg_str'
125  if len(joints) >= 5 and joints[4] < 0:
126  config.append('W')
127 
128  if len(joints) >= 4:
129  t1 = round((joints[3]+180) // 360)
130  config.append('T1:%i' % t1)
131 
132  if len(joints) >= 6:
133  t2 = round((joints[5]+180) // 360)
134  config.append('T2:%i' % t2)
135  t3 = round((joints[2]+180) // 360)
136  config.append('T3:%i' % t3)
137 
138  pos_str = "POS(%.4f, %.4f, %.4f, %.4f, %.4f, %.4f, '%s')" % (x,y,z,w,p,r, ' '.join(config))
139  if joints is None or len(joints) <= 6:
140  return pos_str
141  #return ('XTNDPOS(POS(%.4f,%.4f,%.4f,%.4f,%.4f,%.4f), , , (%.4f))' % (x,y,z,w,p,r,j7))
142  else:
143  self.addline('pxtn.POS := ' + pos_str)
144  for i in range(6,len(joints)):
145  self.addline('pxtn.AUX[%i] := %.5f' % (i-6+1, joints[i]*RATIO_EXTAX[i-6]))
146 
147  return 'pxtn'
148 
149  def __init__(self, robotpost=None, robotname=None, robot_axes = 6, **kwargs):
150  self.ROBOT_POST = robotpost
151  self.ROBOT_NAME = robotname
152  self.PROG = ''
153  self.LOG = ''
154  self.nAxes = robot_axes
155  for k,v in kwargs.items():
156  if k == 'lines_x_prog':
158 
159  def ProgStart(self, progname, new_page = False):
160  progname_i = progname
161  if new_page:
162  if self.INCLUDE_SUB_PROGRAMS:
163  raise Exception("Multiple pages per program is not supported when adding routines in the main program")
164  nPages = len(self.PROG_LIST)
165  if nPages == 0:
166  progname_i = progname
167  else:
168  progname_i = "%s%i" % (self.PROG_NAME, nPages)
169 
170  else:
171  self.PROG_NAME = progname
172  self.nProgs = self.nProgs + 1
173  self.PROG_NAMES = []
174  if self.nProgs > 1:
175  if not self.INCLUDE_SUB_PROGRAMS:
176  return
177  else:
178  if progname_i in self.IMPORTS:
179  self.IMPORTS.remove(progname_i)
180  self.addline('ROUTINE R_%s' % progname_i)
181  self.addline('VAR')
182  self.addline('BEGIN')
183  self.TAB = ' '
184  return
185 
186  self.PROG_NAMES.append(progname_i)
187  self.addline('PROGRAM %s' % progname_i)
188  self.addline('-- IMPORTS --')
189  #self.addline('CONST')
190  self.addline('VAR')
191  self.addline('ROUTINE R_%s EXPORTED FROM %s GLOBAL' % (progname_i, progname_i))
192  self.addline('')
193  self.addline('-- ROUTINES --')
194 
195  #self.addline('BEGIN R_%s' % progname_i)
196  self.addline('ROUTINE R_%s' % progname_i)
197  self.addline('VAR')
198  #self.addline(' cnfg_str: STRING') # PROG_VARS
199  if self.nAxes > 6:
200  self.addline(' pxtn: XTNDPOS')
201 
202  self.addline('-- VARIABLES --') # PROG_VARS
203  self.addline('BEGIN')
204  self.TAB = ' '
205  self.addline('$ORNT_TYPE := RS_WORLD')
206  self.addline('$MOVE_TYPE := JOINT')
207  self.addline('$JNT_MTURN := TRUE')
208  self.addline('$CNFG_CARE := TRUE')
209  self.addline('$TURN_CARE := TRUE')
210  self.addline('$SING_CARE := FALSE')
211  self.addline('$TERM_TYPE := NOSETTLE')
212 
213  # Use MOVEFLY (rounding)
214  self.addline('$FLY_TYPE := FLY_CART')
215  self.addline('$FLY_TRAJ := FLY_PASS')
216  self.setZoneData(self.FLY_DIST)
217  #self.addline('$FLY_DIST := 1')
218  self.addline('$STRESS_PER:= 65')
219 
220  def ProgFinish(self, progname, new_page = False):
221  variables = ''
222  for line in self.PROG_VARS:
223  variables = ' %s\n' % line
224 
225  self.PROG = self.PROG.replace('-- VARIABLES --\n', variables,1)
226  self.PROG_VARS = []
227 
228  if self.nProgs > 1 and not self.INCLUDE_SUB_PROGRAMS:
229  return
230  self.TAB = ''
231  if self.nProgs <= 1:
232  self.PROG = self.PROG + "END R_%s\n\n" % progname
233  # Create a the main program which call the main routine
234  self.PROG = self.PROG + "BEGIN\n R_%s\nEND %s\n\n" % (progname, progname)
235  else:
236  self.ROUTINES = self.ROUTINES + "END R_%s\n\n" % progname
237 
238  if new_page:
239  self.PROG_LIST.append(self.PROG)
240  self.PROG = ''
241  self.nLines = 0
242 
243  def progsave(self, folder, progname, ask_user = False, show_result = False):
244  progname = progname + '.' + self.PROG_EXT
245  if ask_user or not DirExists(folder):
246  filesave = getSaveFile(folder, progname, 'Save program as...')
247  if filesave is not None:
248  filesave = filesave.name
249  else:
250  return
251  else:
252  filesave = folder + '/' + progname
253  self.FILE_SAVED = filesave
254  # save imports
255  imports = ''
256  for i in range(len(self.IMPORTS)):
257  imports = imports + "IMPORT '%s'\n" % self.IMPORTS[i]
258  self.PROG = self.PROG.replace("-- IMPORTS --\n", imports, 1)
259  # save routines
260  self.PROG = self.PROG.replace("-- ROUTINES --\n", self.ROUTINES, 1)
261 
262  fid = open(filesave, "w")
263  fid.write(self.PROG)
264  fid.close()
265  print('SAVED: %s\n' % filesave) # tell RoboDK the path of the saved file
266  self.PROG_FILES.append(filesave)
267 
268  # open file with default application
269  if show_result:
270  if type(show_result) is str:
271  # Open file with provided application
272  import subprocess
273  p = subprocess.Popen([show_result, filesave])
274  elif type(show_result) is list:
275  import subprocess
276  p = subprocess.Popen(show_result + [filesave])
277  else:
278  # open file with default application
279  import os
280  os.startfile(filesave)
281  if len(self.LOG) > 0:
282  mbox('Program generation LOG:\n\n' + self.LOG)
283 
284  def ProgSave(self, folder, progname, ask_user = False, show_result = False):
285  if len(self.PROG_LIST) >= 1:
286  if self.nLines > 0:
287  self.PROG_LIST.append(self.PROG)
288  self.PROG = ''
289  self.nLines = 0
290 
291  npages = len(self.PROG_LIST)
292  progname_main = progname + "Main"
293  mainprog = "PROGRAM %s\n" % progname_main
294  for i in range(npages):
295  mainprog += "IMPORT '%s'\n" % self.PROG_NAMES[i]
296 
297  mainprog += "CONST\nVAR\n"
298  mainprog += "BEGIN\n"
299  for i in range(npages):
300  mainprog += " R_%s()\n" % self.PROG_NAMES[i]
301 
302  mainprog += "END %s\n" % progname_main
303  self.PROG = mainprog
304  self.progsave(folder, progname_main, ask_user, show_result)
305  self.LOG = ''
306  folder_user = getFileDir(self.FILE_SAVED)
307  # progname_user = getFileName(self.FILE_SAVED)
308 
309  for i in range(npages):
310  self.PROG = self.PROG_LIST[i]
311  self.progsave(folder_user, self.PROG_NAMES[i], False, show_result)
312 
313  else:
314  self.progsave(folder, progname, ask_user, show_result)
315 
316 
317  def ProgSendRobot(self, robot_ip, remote_path, ftp_user, ftp_pass):
318  """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".
319  The connection parameters must be provided in the robot connection menu of RoboDK"""
320  UploadFTP(self.PROG_FILES, robot_ip, remote_path, ftp_user, ftp_pass)
321 
322  def MoveJ(self, pose, joints, conf_RLF=None):
323  """Add a joint movement"""
324  #self.addline('MOVE JOINT TO ' + joints_2_str(joints))# MOVE JOINT TO: won't use absolute axis position
325  self.addline('MOVE TO ' + self.joints_2_str(joints)) # MOVE TO: absolute axis position
326 
327  def new_move(self, pose1, pose2):
328  if pose1 is None:
329  return
330 
331  def Calculate_Time(Dist, Vmax, Amax):
332  '''Calculate the time it takes to move a distance Dist at Amax acceleration and Vmax speed'''
333  tacc = Vmax/Amax;
334  Xacc = 0.5*Amax*tacc*tacc;
335  if Dist <= 2*Xacc:
336  # Vmax is not reached
337  tacc = sqrt(Dist/Amax)
338  Ttot = tacc*2
339  else:
340  # Vmax is reached
341  Xvmax = Dist - 2*Xacc
342  Tvmax = Xvmax/Vmax
343  Ttot = 2*tacc + Tvmax
344  return Ttot
345 
346  add_material = self.NEW_E_LENGTH - self.LAST_E_LENGTH
348 
349  if add_material > 0:
350  distance_mm = norm(subs3(pose1.Pos(), pose2.Pos()))
351  # calculate movement time in seconds
352  time_s = Calculate_Time(distance_mm, self.SPEED_MMS, self.ACCEL_MMSS)
353  # add material
354  self.addline("$AOUT[5] := %.3f" % (add_material/time_s))
355  else:
356  # DO not add material
357  self.addline("$AOUT[5] := 0")
358 
359  def new_movec(self, pose1, pose2, pose3):
360  return
361 
362  def MoveL(self, pose, joints, conf_RLF=None):
363  """Add a linear movement"""
364  pose = None
365  # Filter sending the same movement twice
366  if self.LAST_POSE is not None and pose is not None:
367  # Skip adding a new movement if the new position is the same as the last one
368  if distance(pose.Pos(), self.LAST_POSE.Pos()) < 0.001 and pose_angle_between(pose, self.LAST_POSE) < 0.01:
369  return
370 
371  target = ''
372  if pose is None:
373  target = self.joints_2_str(joints)
374  else:
375  target = self.pose_2_str(pose,joints)
376 
377  #self.new_move(self.LAST_POSE, pose) #used for 3D printing
378  if self.FLY_DIST > 0:
379  self.addline('MOVEFLY LINEAR TO %s ADVANCE' % target)
380  else:
381  self.addline('MOVE LINEAR TO ' + target)
382 
383  self.LAST_POSE = pose
384 
385  def MoveC(self, pose1, joints1, pose2, joints2, conf_RLF_1=None, conf_RLF_2=None):
386  """Add a circular movement"""
387  #self.new_movec(self.LAST_POSE, pose1, pose2) #used for 3D printing
388  if self.FLY_DIST > 0:
389  self.addline('MOVEFLY CIRCULAR TO %s VIA %s ADVANCE' % (self.pose_2_str(pose2,joints2), self.pose_2_str(pose1,joints1)))
390  else:
391  self.addline('MOVE CIRCULAR TO %s VIA %s' % (self.pose_2_str(pose2,joints2), self.pose_2_str(pose1,joints1)))
392 
393  self.LAST_POSE = pose2
394 
395  def setFrame(self, pose, frame_id=None, frame_name=None):
396  """Change the robot reference frame"""
397  self.addline('$UFRAME := ' + self.pose_2_str(pose))
398 
399  def setTool(self, pose, tool_id=None, tool_name=None):
400  """Change the robot TCP"""
401  self.addline('$TOOL := ' + self.pose_2_str(pose))
402 
403  def Pause(self, time_ms):
404  """Pause the robot program"""
405  if time_ms <= 0:
406  self.addline('PAUSE')
407  else:
408  self.addline('DELAY %.0f' % (time_ms))
409 
410  def setSpeed(self, speed_mms):
411  """Changes the robot speed (in mm/s)"""
412  self.SPEED_MMS = speed_mms
413  self.addline('$SPD_OPT := SPD_LIN')
414  self.addline('$LIN_SPD := %.3f' % (speed_mms*0.001))
415 
416  def setAcceleration(self, accel_mmss):
417  """Changes the robot acceleration (in mm/s2)"""
418  self.ACCEL_MMSS = accel_mmss
419  self.addlog('setAcceleration not defined')
420 
421  def setSpeedJoints(self, speed_degs):
422  """Changes the robot joint speed (in deg/s)"""
423  self.addline('$ROT_SPD := %.3f' % (speed_degs*pi/180.0))
424 
425  def setAccelerationJoints(self, accel_degss):
426  """Changes the robot joint acceleration (in deg/s2)"""
427  self.addlog('setAccelerationJoints not defined')
428 
429  def setZoneData(self, zone_mm):
430  """Changes the zone data approach (makes the movement more smooth)"""
431  #self.addlog('setZoneData not defined (%.1f mm)' % zone_mm)
432  self.FLY_DIST = zone_mm
433  self.addline('$FLY_DIST := %.3f' % zone_mm)
434 
435  def setDO(self, io_var, io_value):
436  """Sets a variable (output) to a given value"""
437  if type(io_var) != str: # set default variable name if io_var is a number
438  io_var = '$DOUT[%s]' % str(io_var)
439  if type(io_value) != str: # set default variable value if io_value is a number
440  if io_value > 0:
441  io_value = 'ON'
442  else:
443  io_value = 'OFF'
444 
445  # at this point, io_var and io_value must be string values
446  self.addline('%s := %s' % (io_var, io_value))
447 
448  def waitDI(self, io_var, io_value, timeout_ms=-1):
449  """Waits for an input io_var to attain a given value io_value. Optionally, a timeout can be provided."""
450  if type(io_var) != str: # set default variable name if io_var is a number
451  io_var = '$DIN[%s]' % str(io_var)
452  if type(io_value) != str: # set default variable value if io_value is a number
453  if io_value > 0:
454  io_value = 'ON'
455  else:
456  io_value = 'OFF'
457 
458  # at this point, io_var and io_value must be string values
459  if timeout_ms < 0:
460  #self.addline('WAIT FOR %s==%s' % (io_var, io_value))
461  self.addline('$TIMER[1] := 0')
462  self.addline('REPEAT')
463  self.addline(' DELAY 1')
464  self.addline('UNTIL (%s = %s)' % (io_var, io_value))
465  else:
466  self.addline('$TIMER[1] := 0')
467  self.addline('REPEAT')
468  self.addline(' DELAY 1')
469  self.addline('UNTIL (%s = %s) OR ($TIMER[1] > %.1f)' % (io_var, io_value, timeout_ms))
470  self.addline('IF $TIMER[1] > %.1f THEN' % timeout_ms)
471  self.addline('-- TIMED OUT! Important: This section must be updated accordingly')
472  self.addline(' DELAY 2000')
473  #self.addline(' PAUSE')#Important, this must be updated to perform a specific action
474  self.addline('ENDIF')
475 
476  def RunCode(self, code, is_function_call = False):
477  """Adds code or a function call"""
478  if self.nProgs > 1 and not self.INCLUDE_SUB_PROGRAMS:
479  return
480 
481  if is_function_call:
482  if code.startswith("Extruder("):
483  # if the program call is Extruder(123.56), we extract the number as a string and convert it to a number
484  self.NEW_E_LENGTH = float(code[9:-1]) # it needs to retrieve the extruder length from the program call
485  # Do not generate program call
486  return
487 
488  code.replace(' ','_')
489  bracket_id = code.find('(')
490  import_prog = None
491  if bracket_id < 0:
492  # no brackets
493  import_prog = code
494  #code = code + '()'
495  else:
496  # brackets
497  import_prog = code[:bracket_id]
498 
499  # Add import directive only if we have not added it before
500  if not import_prog in self.IMPORTS:
501  self.IMPORTS.append(import_prog)
502 
503  self.addline('R_' + code)
504  else:
505  self.addline(code)
506 
507  def RunMessage(self, message, iscomment = False):
508  """Add a joint movement"""
509  if iscomment:
510  self.addline('-- ' + message)
511  else:
512  #self.addline('TYPE "' + message + '"')
513  #-------- Option 1: Show message on the teach pendant: Important! Fails if there is no teach pendant
514  #self.PROG_VARS.append('lun: INTEGER')
515  #self.addline(MACRO_MESSAGE_TP % message)
516  #-------- Option 2: Just comment the message
517  self.addline('-- ' + message)
518 
519 
520 # ------------------ private ----------------------
521  def addline(self, newline):
522  """Add a program line"""
523  if self.nProgs > 1 and not self.INCLUDE_SUB_PROGRAMS:
524  return
525 
526  if not self.INCLUDE_SUB_PROGRAMS and self.nLines > self.MAX_LINES_X_PROG:
527  self.nLines = 0
528  self.ProgFinish(self.PROG_NAME, True)
529  self.ProgStart(self.PROG_NAME, True)
530 
531  if self.nProgs > 1:
532  self.ROUTINES = self.ROUTINES + self.TAB + newline + '\n'
533  else:
534  self.PROG = self.PROG + self.TAB + newline + '\n'
535 
536  self.nLines = self.nLines + 1
537 
538  def addlog(self, newline):
539  """Add a log message"""
540  if self.nProgs > 1 and not self.INCLUDE_SUB_PROGRAMS:
541  return
542 
543  self.LOG = self.LOG + newline + '\n'
544 
545 # -------------------------------------------------
546 # ------------ For testing purposes ---------------
547 def Pose(xyzrpw):
548  [x,y,z,r,p,w] = xyzrpw
549  a = r*math.pi/180
550  b = p*math.pi/180
551  c = w*math.pi/180
552  ca = math.cos(a)
553  sa = math.sin(a)
554  cb = math.cos(b)
555  sb = math.sin(b)
556  cc = math.cos(c)
557  sc = math.sin(c)
558  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]])
559 
560 def test_post():
561  """Test the post with a basic program"""
562 
563  robot = RobotPost('Comau_custom', 'Generic Comau robot')
564 
565  robot.ProgStart("Program")
566  robot.RunMessage("Program generated by RoboDK", True)
567  robot.setFrame(Pose([807.766544, -963.699898, 41.478944, 0, 0, 0]))
568  robot.setTool(Pose([62.5, -108.253175, 100, -60, 90, 0]))
569  robot.MoveJ(Pose([200, 200, 500, 180, 0, 180]), [-46.18419, -6.77518, -20.54925, 71.38674, 49.58727, -302.54752] )
570  robot.MoveL(Pose([200, 250, 348.734575, 180, 0, -150]), [-41.62707, -8.89064, -30.01809, 60.62329, 49.66749, -258.98418] )
571  robot.MoveL(Pose([200, 200, 262.132034, 180, 0, -150]), [-43.73892, -3.91728, -35.77935, 58.57566, 54.11615, -253.81122] )
572  robot.RunMessage("Setting air valve 1 on")
573  robot.RunCode("TCP_On", True)
574  robot.Pause(1000)
575  robot.MoveL(Pose([200, 250, 348.734575, 180, 0, -150]), [-41.62707, -8.89064, -30.01809, 60.62329, 49.66749, -258.98418] )
576  robot.MoveL(Pose([250, 300, 278.023897, 180, 0, -150]), [-37.52588, -6.32628, -34.59693, 53.52525, 49.24426, -251.44677] )
577  robot.MoveL(Pose([250, 250, 191.421356, 180, 0, -150]), [-39.75778, -1.04537, -40.37883, 52.09118, 54.15317, -246.94403] )
578  robot.RunMessage("Setting air valve off")
579  robot.RunCode("TCP_Off(55)", True)
580  robot.Pause(1000)
581  robot.MoveL(Pose([250, 300, 278.023897, 180, 0, -150]), [-37.52588, -6.32628, -34.59693, 53.52525, 49.24426, -251.44677] )
582  robot.MoveL(Pose([250, 200, 278.023897, 180, 0, -150]), [-41.85389, -1.95619, -34.89154, 57.43912, 52.34162, -253.73403] )
583  robot.MoveL(Pose([250, 150, 191.421356, 180, 0, -150]), [-43.82111, 3.29703, -40.29493, 56.02402, 56.61169, -249.23532] )
584  robot.ProgFinish("Program")
585  # robot.ProgSave(".","Program",True)
586  print(robot.PROG)
587  if len(robot.LOG) > 0:
588  mbox('Program generation LOG:\n\n' + robot.LOG)
589 
590  input("Press Enter to close...")
591 
592 if __name__ == "__main__":
593  """Function to call when the module is executed by itself: test"""
594  test_post()
def waitDI(self, io_var, io_value, timeout_ms=-1)
def progsave(self, folder, progname, ask_user=False, show_result=False)
def UploadFTP(program, robot_ip, remote_path, ftp_user, ftp_pass)
Definition: robodk.py:1312
def MoveC(self, pose1, joints1, pose2, joints2, conf_RLF_1=None, conf_RLF_2=None)
def RunCode(self, code, is_function_call=False)
def pose_angle_between(pose1, pose2)
Definition: robodk.py:741
def mbox(msg, b1='OK', b2='Cancel', frame=True, t=False, entry=None)
Definition: robodk.py:1458
def setFrame(self, pose, frame_id=None, frame_name=None)
def __init__(self, robotpost=None, robotname=None, robot_axes=6, kwargs)
def ProgSave(self, folder, progname, ask_user=False, show_result=False)
def getSaveFile(strdir='C:\\', strfile='file.txt', strtitle='Save file as ...')
Definition: robodk.py:1354
def ProgSendRobot(self, robot_ip, remote_path, ftp_user, ftp_pass)
def pose_2_str(self, pose, joints=None, conf_RLF=None)
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