|
|
|
|
@ -65,23 +65,25 @@ class Kuka_Prog:
@@ -65,23 +65,25 @@ class Kuka_Prog:
|
|
|
|
|
def save_prog(self, filename): |
|
|
|
|
srcfile = open(filename+'.src','w') |
|
|
|
|
srcfile.write(header_src) |
|
|
|
|
# subroutine definition |
|
|
|
|
# subroutine definition |
|
|
|
|
srcfile.write("DEF "+filename+"( )\n\n") |
|
|
|
|
srcfile.write(";- Kuka src file, generated by KVT\n") |
|
|
|
|
srcfile.write(";- "+ time.asctime()+"\n\n") |
|
|
|
|
# defining world and base |
|
|
|
|
srcfile.write("E6POS startp\n") |
|
|
|
|
srcfile.write(";------------- definitions ------------\n") |
|
|
|
|
srcfile.write("EXT BAS (BAS_COMMAND :IN,REAL :IN ) ;set base to World\n") |
|
|
|
|
srcfile.write("BAS (#INITMOV,0 ) ;Initialicing the defaults for Vel and so on \n\n") |
|
|
|
|
|
|
|
|
|
srcfile.write("$BASE = BASE_DATA[6] ; SET BASE to WORKPLACE\n\n") |
|
|
|
|
srcfile.write("\n;------------- main part ------------\n") |
|
|
|
|
|
|
|
|
|
srcfile.write("BAS (#TOOL,6) ;Initialicing the defaults for Vel and so on \n\n") |
|
|
|
|
srcfile.write("BAS (#BASE,2) ;Initialicing the defaults for Vel and so on \n\n") |
|
|
|
|
srcfile.write("PTP {A1 -1.9, A2 -105.76, A3 79.97, A4 178.83, A5 -20.3, A6 -4.37, E1 -90, E2 0}\n") |
|
|
|
|
srcfile.write(";------------- main part ------------\n") |
|
|
|
|
srcfile.write("startp=$POS_ACT\n") |
|
|
|
|
#V = w.Velocity / 1000.0 # from mm/s to m/s |
|
|
|
|
V = 0.05 |
|
|
|
|
srcfile.write("$VEL.CP = %f ; m/s ; m/s \n"%V) |
|
|
|
|
for pose in self.pose_list: |
|
|
|
|
srcfile.write("LIN {} ; GENERATED\n".format(pose.to_string())) |
|
|
|
|
srcfile.write("LIN startp:{} C_VEL; GENERATED\n".format(pose.to_string())) |
|
|
|
|
# end of subroutine |
|
|
|
|
srcfile.write("\n;------------- end ------------\n") |
|
|
|
|
srcfile.write("END \n\n") |
|
|
|
|
|