Esempio n. 1
0
    def Connect(self):
        #Connect Dobot
        self.state = dType.SearchDobot(self.api, 10)
        if not self.state:
            print("Empty")
            dType.DisconnectDobot(self.api)

        self.state = dType.ConnectDobot(self.api, "", 115200)[0]
        print(CON_STR[self.state])

        if (CON_STR[self.state] == "DobotConnect_NotFound"):
            print("Error")
            dType.DisconnectDobot(self.api)
            sys.exit("Please connect the Robot")
            return False
        dType.GetDeviceSN(self.api)
        dType.GetDeviceName(self.api)
        dType.GetDeviceVersion(self.api)
        dType.GetDeviceWithL(self.api)
        dType.GetPoseL(self.api)
        dType.GetKinematics(self.api)
        #dType.GetHOMEParams(self.api)
        print("Connect status:", CON_STR[self.state])
        if (self.state == dType.DobotConnect.DobotConnect_NoError):
            dType.SetQueuedCmdClear(self.api)
            return True
        else:
            dType.DisconnectDobot(self.api)
            return False
def disconnectDobots():
    global id_m1
    global id_magL
    global id_magR

    print("DISconnecting all Dobots")
    dType.DisconnectDobot(api, id_m1)  # dType.DisconnectDobot(self.DobotAPI)
    dType.DisconnectDobot(api, id_magL)
    dType.DisconnectDobot(api, id_magR)
    print("DISconnecting probably not working")  #? bug. ports left occupied
Esempio n. 3
0
    def connection(self, connect):

        global connectionState
        
        if connect == True:
            connectionState = dType.ConnectDobot(api, "", 115200)[0]
            print("Dobot connection status:", CON_STR[connectionState])
            dType.DisconnectDobot(api)
            connectionState = None
            print("Disconnected from Dobot")
        else: 
            dType.DisconnectDobot(api)
            connectionState = None
            print("Disconnected from Dobot")
Esempio n. 4
0
    def ParserMove(self):
        dType.SetQueuedCmdClear(self.api)
        json_data = open(self.Json)
        data = json.load(json_data, object_pairs_hook=OrderedDict)
       #def SetPTPCoordinateParams(api, xyzVelocity, xyzAcceleration, rVelocity,  rAcceleration,  isQueued=0):

        for move in data:
            #print "TEST_:"+data[move]['MotionStyle'],data[move]
            if data[move]['MotionStyle']=="MOVJ" :
                lastIndex=dType.SetPTPCmd(self.api,dType.PTPMode.PTPMOVJXYZMode,float(data[move]['X']),float(data[move]['Y']),float(data[move]['Z']),float(data[move]['R']), isQueued = 1)[0]
                dType.SetEndEffectorGripper(self.api, data[move]["Enabled"], data[move]['Gripper'], isQueued= 1)
                print(data[move]["Gripper"])
            if data[move]['PauseTime']!=0:
                lastIndex=dType.SetWAITCmd(self.api,float(data[move]['PauseTime']), isQueued = 1)[0]
            if data[move]['MotionStyle']=="MOVL" :        
                lastIndex=dType.SetPTPCmd(self.api,dType.PTPMode.PTPMOVLXYZMode,float(data[move]['X']),float(data[move]['Y']),float(data[move]['Z']),float(data[move]['R']), isQueued = 1)[0]
            if data[move]['MotionStyle']=="MOVJANGLE" :        
                lastIndex=dType.SetARCCmd(self.api,[float(data[move]['X']),float(data[move]['Y']),float(data[move]['Z']),0],[float(data[move]['_X']),float(data[move]['_Y']),float(data[move]['_Z']),0], isQueued = 1)[0]



        dType.SetQueuedCmdStartExec(self.api)

        while lastIndex > dType.GetQueuedCmdCurrentIndex(self.api)[0]:
#           dType.GetPose(self.api) Obtener la Posicion actual del robot
            dType.dSleep(100)

        dType.SetQueuedCmdStopExec(self.api)
        dType.GetKinematics(self.api)


        dType.DisconnectDobot(self.api)
Esempio n. 5
0
    def testQ(self):
        """ Test playfield squares """

        dType.SetQueuedCmdClear(self.api)

        r = 0

        dType.SetWAITCmd(self.api, 0.1, 1)
        dType.SetPTPCmd(self.api, dType.PTPMode.PTPMOVLXYZMode, 300, 50, -55,
                        r, 1)
        dType.SetPTPCmd(self.api, dType.PTPMode.PTPMOVLXYZMode, 300, 0, -55, r,
                        1)
        dType.SetPTPCmd(self.api, dType.PTPMode.PTPMOVLXYZMode, 300, -50, -55,
                        r, 1)
        dType.SetPTPCmd(self.api, dType.PTPMode.PTPMOVLXYZMode, 250, 50, -55,
                        r, 1)
        dType.SetPTPCmd(self.api, dType.PTPMode.PTPMOVLXYZMode, 250, 0, -55, r,
                        1)
        dType.SetPTPCmd(self.api, dType.PTPMode.PTPMOVLXYZMode, 250, -50, -55,
                        r, 1)
        dType.SetPTPCmd(self.api, dType.PTPMode.PTPMOVLXYZMode, 200, 50, -55,
                        r, 1)
        dType.SetPTPCmd(self.api, dType.PTPMode.PTPMOVLXYZMode, 200, 0, -55, r,
                        1)
        dType.SetPTPCmd(self.api, dType.PTPMode.PTPMOVLXYZMode, 200, -50, -55,
                        r, 1)

        dType.SetQueuedCmdStartExec(self.api)

        dType.DisconnectDobot(self.api)
Esempio n. 6
0
def dohome1():
	CON_STR = {
		dType.DobotConnect.DobotConnect_NoError:  "DobotConnect_NoError",
		dType.DobotConnect.DobotConnect_NotFound: "DobotConnect_NotFound",
		dType.DobotConnect.DobotConnect_Occupied: "DobotConnect_Occupied"}

	#Load Dll
	api = dType.load()
		
	#Connect Dobot
	state = dType.ConnectDobot(api, "", 115200)[0]
	print("Connect status:",CON_STR[state])

	if (state == dType.DobotConnect.DobotConnect_NoError):

		#Clean Command Queued
		dType.SetQueuedCmdClear(api)
			
		#Async Home
		#lastIndex = dType.SetHOMECmd(api, temp = 0, isQueued = 1)[0]
		lastIndex = dType.SetPTPCmd(api, dType.PTPMode.PTPMOVLXYZMode, 250, 0, 50, 0, isQueued = 1)[0]

		#Start to Execute Command Queued
		dType.SetQueuedCmdStartExec(api)

		#Wait for Executing Last Command 
		while lastIndex > dType.GetQueuedCmdCurrentIndex(api)[0]:
			dType.dSleep(100)

		#Stop to Execute Command Queued
		dType.SetQueuedCmdStopExec(api)

	#Disconnect Dobot
	dType.DisconnectDobot(api)
Esempio n. 7
0
 def Connect(self):
     #Connect Dobot
     self.state = dType.ConnectDobot(self.api, "", 115200)[0]
     dType.GetDeviceSN(self.api)
     dType.GetDeviceName(self.api)
     dType.GetDeviceVersion(self.api)
     dType.GetDeviceWithL(self.api)
     dType.GetPoseL(self.api)
     dType.GetKinematics(self.api)
     #dType.GetHOMEParams(self.api)
     print("Connect status:",CON_STR[self.state])
     if (self.state == dType.DobotConnect.DobotConnect_NoError):
         dType.SetQueuedCmdClear(self.api)
         return True
     else :
         dType.DisconnectDobot(self.api)
         return False
    def Disconnect_click(self):
        """
        Dobotとの接続を切断する関数

        Returns
        -------
        result : int
            result : int
            0 : 接続されていない場合
            1 : 切断できた場合
        """
        # Dobotが接続されていない場合
        if self.connection == 0:
            return 0
        # DobotDisconnect
        dType.DisconnectDobot(self.api)
        return 1
Esempio n. 9
0
    def home(self):
        """ Send arm to home position """

        dType.SetQueuedCmdClear(self.api)

        dType.SetWAITCmd(self.api, 0.1, 1)
        dType.SetPTPCmd(self.api,
                        dType.PTPMode.PTPMOVLXYZMode,
                        250,
                        0,
                        50,
                        0,
                        isQueued=1)

        dType.SetHOMECmd(self.api, temp=0, isQueued=1)
        dType.SetQueuedCmdStartExec(self.api)
        dType.DisconnectDobot(self.api)
Esempio n. 10
0
def dobot_exe_nut(dX,dY,dZ,dR,j):
	CON_STR = {
		dType.DobotConnect.DobotConnect_NoError:  "DobotConnect_NoError",
		dType.DobotConnect.DobotConnect_NotFound: "DobotConnect_NotFound",
		dType.DobotConnect.DobotConnect_Occupied: "DobotConnect_Occupied"}

	#Load Dll
	api = dType.load()
	

	#Connect Dobot
	state = dType.ConnectDobot(api, "", 115200)[0]
	print("Connect status:",CON_STR[state])

	if (state == dType.DobotConnect.DobotConnect_NoError):

		#Clean Command Queued
		dType.SetQueuedCmdClear(api)
		
		#Async Home
		#dType.SetHOMECmd(api, temp = 0, isQueued = 1)
		dType.SetPTPJumpParams(api,30,140)
		lastIndex = dType.SetIODO(api, 2, 1, 1)[0]
		lastIndex = dType.SetPTPCmd(api, dType.PTPMode.PTPJUMPXYZMode, dX, dY, dZ, 0, isQueued = 1)[0]
		#lastIndex = dType.SetIODO(api, 2, 1, 1)[0]
		lastIndex = dType.SetPTPCmd(api, dType.PTPMode.PTPJUMPXYZMode, 180, -198.45, -52.7+j, dR, isQueued = 1)[0]
		lastIndex = dType.SetIODO(api, 2, 0, 1)[0]
		
		#Start to Execute Command Queued
		dType.SetQueuedCmdStartExec(api)

		#Wait for Executing Last Command 
		while lastIndex > dType.GetQueuedCmdCurrentIndex(api)[0]:
			dType.dSleep(100)

		#Stop to Execute Command Queued
		dType.SetQueuedCmdStopExec(api)

	#Disconnect Dobot
	dType.DisconnectDobot(api)
Esempio n. 11
0
    def calibrate(self, stage):
        """ Calibrate robot and game with different stages """
        dType.SetQueuedCmdClear(self.api)

        if stage == 1:
            dType.SetWAITCmd(self.api, 0.1, 1)
            dType.SetPTPCmd(self.api,
                            dType.PTPMode.PTPMOVLXYZMode,
                            250,
                            0,
                            50,
                            0,
                            isQueued=1)
            dType.SetHOMECmd(self.api, temp=0, isQueued=1)
            dType.SetQueuedCmdStartExec(self.api)
        elif stage == 2:
            dType.SetWAITCmd(self.api, 0.1, 1)
            dType.SetPTPCmd(self.api,
                            dType.PTPMode.PTPMOVLXYZMode,
                            250,
                            50,
                            -55,
                            -40,
                            isQueued=1)
            dType.SetQueuedCmdStartExec(self.api)
        elif stage == 3:
            dType.SetWAITCmd(self.api, 0.1, 1)
            dType.SetPTPCmd(self.api,
                            dType.PTPMode.PTPMOVLXYZMode,
                            250,
                            -50,
                            -55,
                            -40,
                            isQueued=1)
            dType.SetQueuedCmdStartExec(self.api)
            dType.DisconnectDobot(self.api)
Esempio n. 12
0
def arm(threadname):
    '''
    Thread dieu khien robot arm
    '''

    # kich thuoc kho chua hang doi voi tung mau. Dinh dang [x, y, z]
    size_wh = [1, 3, 4]

    # vi tri hien tai cua tung mau trong kho hang. Red Green Blue Yellow
    cur_pos_wh = [[0, 0, 0],
                  [0, 0, 0],
                  [0, 0, 0],
                  [0, 0, 0]]

    CON_STR = {
    dType.DobotConnect.DobotConnect_NoError:  "DobotConnect_NoError",
    dType.DobotConnect.DobotConnect_NotFound: "DobotConnect_NotFound",
    dType.DobotConnect.DobotConnect_Occupied: "DobotConnect_Occupied"}

    #Load Dll
    api = dType.load()

    #Connect Dobot
    state = dType.ConnectDobot(api, "", 115200)[0]
    print("Connect status:",CON_STR[state])

    dType.SetHOMEParams(api, 230, 0, 50, 0, isQueued=1)
    dType.SetPTPCoordinateParams(api, 150, 200, 200, 200, isQueued=1)
    dType.SetPTPCommonParams(api, 100, 100, isQueued=1)
    dType.SetPTPJumpParams(api, 60, 150, isQueued=1)
    dType.SetPTPCmd(api, dType.PTPMode.PTPJUMPXYZMode,
                    200, 0, 50, 0, isQueued=1)
    lastIndex = dType.SetHOMECmd(api, temp = 0, isQueued = 1)[0]

    cur_cmd = dType.GetQueuedCmdCurrentIndex(api)[0]
    while lastIndex > cur_cmd:
        dType.dSleep(10)
        cur_cmd = dType.GetQueuedCmdCurrentIndex(api)[0]

    global mm_per_sec

    dType.SetQueuedCmdClear(api)
    dType.SetQueuedCmdStartExec(api)

    f = open('step', 'r')
    STEP_PER_CIRCLE = float(f.read().strip('\n'))
    f.close()
    # so buoc de truc quay du 1 vong
    # STEP_PER_CIRCLE = 17400 #16625 
    # chu vi truc quay bang chuyen
    MM_PER_CIRCLE = 3.1415926535898 * 36.0

    # so buoc trong 1 giay
    pulse_per_sec = mm_per_sec * STEP_PER_CIRCLE / MM_PER_CIRCLE
    
    # dieu khien stepper
    dType.SetEMotor(api, 0, 1, int(pulse_per_sec), isQueued=1)

    
    while state == dType.DobotConnect.DobotConnect_NoError:
        # print('number:', len(ls_obj))
        if ls_obj:
            # print("ab")
            if ls_obj[0].location[1] >= d_robot_cam-20:
                while True:
                    try: 
                        if ls_obj[0].location[1] >= d_robot_cam-100:
                            print(cur_pos_wh)
                            # neu kho hang cua mau dang xet chua day
                            if cur_pos_wh[ls_obj[0].color][2] < size_wh[2]:
                                # dung bang chuyen
                                dType.SetEMotor(api, 0, 1, int(0), isQueued=1)
                                mm_per_sec = 0
                                # gap vat the tu bang chuyen vao kho
                                pick_up(api, ls_obj[0].location, ls_obj[0].orientation, ls_obj[0].color, cur_pos_wh, size_wh)
                            else:
                                end_thread = True
                                break
                            # xoa vat the vua gap
                            ls_obj.pop(0)
                        else:
                            break
                    except Exception:
                        break
                
                # bang chuyen tiep tuc chay
        f = open('step', 'r')
        STEP_PER_CIRCLE = float(f.read().strip('\n'))
        f.close()

        # # chu vi truc quay bang chuyen
        MM_PER_CIRCLE = 3.1415926535898 * 36.0
        # # so buoc trong 1 giay
        mm_per_sec = 40
        pulse_per_sec = mm_per_sec * STEP_PER_CIRCLE / MM_PER_CIRCLE
        dType.SetEMotor(api, 0, 1, int(pulse_per_sec), isQueued=1)
            
        if end_thread:
            dType.SetEMotor(api, 0, 1, 0, isQueued=1)
            print('End process')
            dType.DisconnectDobot(api)
            break
Esempio n. 13
0
def dobot_clean(api):
    #Disconnect Dobot
    dType.DisconnectDobot(api)
Esempio n. 14
0
 def run(self):
     # Si on est en Wi-Fi, on se connecte au telephone
     if self.fenetre.choixconnection.get() == 2:
         self.fenetre.setInstruction("Connection au telephone.")
         adb.Connect(self.fenetre.IPvalue.get())
     # pour informer l'utilisateur
     self.fenetre.setInstruction("Démarrage de l'oscilloscope.")
     # on demarre l'oscilloscope
     if int(self.choixOscillo) == 2:
         if platform.system() != "Windows":
             Mesure = MM.Monsoon()
         else:
             self.fenetre.setInstruction("Le Monsoon n'est actuellement pas supporte par Windows")
             return
     else:
         Mesure = OEC.OscilloscopeEnergyCollector(self.valeurfrequence, self.fenetre)
     # Si on choisi le robot pour effectuer le test
     if self.choixRobot == 1:
         # Creation de la pile d'actions du robot
         api = dType.load()
         # Connection au  Dobot
         state = dType.ConnectDobot(api, "", 115200)[0]
         # si le robot est dans le bon etat
         if (state == dType.DobotConnect.DobotConnect_NotFound):
             self.fenetre.setInstruction(
                 "Veuillez brancher le Dobot Magician ou installez les\ndrivers correspondants.")
             return
         elif (state == dType.DobotConnect.DobotConnect_Occupied):
             self.fenetre.setInstruction("Veuillez liberer le port USB du robot et Reessayer.")
             return
         else:
             self.fenetre.setInstruction("Dobot Magician bien connecte. Demarrage du test.")
             # on initialise le robot
             Dfonct.SpeedInit(api)
             Dfonct.Init(api)
             # on demande au robot la valeur minimum de Z
             Z_min = Dfonct.Calc_Z_Min(api, self.fenetre)
             # on entre les données de notre écran
             ecran = screen.screen(api, self.largueur, self.longueur, self.fenetre)
     else:
         self.fenetre.setInstruction("Mode sans robot. Demarrage du test.")
     # on regarde si nous faisons le test sur un ou plusieurs scénarios
     Filelist = []
     if self.tousScenarios == 1:
         for fichier in sorted(os.listdir('scenarios/')):
             Filelist.append(fichier)
     else:
         Filelist.append(self.scenar + ".sim")
     # on test le nombre de scénarios souhaités
     num_scenar = -1
     for scenars in Filelist:
         num_test = 0
         num_scenar += 1
         if alreadydone(scenars, int(self.repetition)):
             continue
         # recuperer les valeurs utiles du scénarios
         apk, package, occurenceInit, languageinit, language = DecoupageScenarios(scenars)
         # on recupere le chemin absolu de l'apk
         try:
             if self.choixDebug == 0:
                 chemin = os.path.abspath("./apk/nodebug/" + apk + ".apk")
             else:
                 chemin = os.path.abspath("./apk/debug/" + apk + ".apk")
         except:
             self.fenetre.setInstruction(
                 "l'apk specifie en ligne 1 dans le dossier scenario \nn'est pas presente dans le dossier apk. \nVeuillez l'ajouter ou modifier son nom.")
             return
         if self.powertran == 1:
             self.fenetre.setInstruction("installation de l'apk PowerTran...")
             adb.installApk("./ressources/powertran/powertran.apk")
         self.fenetre.setInstruction("installation de l'apk...")
         if self.choixRobot == 1:
             adb.installApk(chemin)
         else:
             adb.installApk("./apk/debug/" + apk + ".apk")
             adb.installApk("./apk/robotium/" + apk + ".apk")
         # on fait tourner l'application une premiere fois
         self.fenetre.setInstruction("test preliminaire de l'apk...")
         if self.choixRobot == 1:
             for j in range(0, int(occurenceInit)):
                 # on démarre l'application
                 adb.startApk(apk, package)
                 time.sleep(5)
                 # on supprime les evenements exceptionnels
                 robot.Robot(api, ecran, self.fenetre, Z_min, languageinit).action()
                 time.sleep(5)
                 # On ferme l'application
                 adb.closeApk(apk)
         else:
             # on démarre l'application
             adb.startApk(apk, package)
             time.sleep(10)
             # On ferme l'application
             adb.closeApk(apk)
         self.fenetre.setInstruction("test de l'application...")
         # On demarre le test de l'application
         for i in range(1, int(self.repetition) + 1):
             num_test += 1
             # On regarde si le fichier existe deja
             if os.path.exists("./results/" + apk + "-" + str(i) + ".csv"):
                 continue
             # on tient au courant l'utilisateur
             self.fenetre.setInstruction("etape " + str(i) + "/" + str(int(self.repetition)) + " : En cours")
             if self.powertran == 1:
                 adb.startApk("powertran", "powertran.start")
                 robot.Robot(api, ecran, self.fenetre, Z_min, "").action()
                 adb.closeApk("powertran")
             # on recupere la temperature et frequence du processeur avant test
             temp1 = 1
             freq1 = 1
             # on force la luminosité au minimum pour l'homogeneïté des tests
             adb.Luminosity(0)
             # on place le robot en position (pour toujours commencer au même endroit)
             if self.choixRobot == 1:
                 robot.Robot(api, ecran, self.fenetre, Z_min, "mov(" + str(int(ecran.pixelwidth) / 2) + "," + str(
                     int(ecran.pixelheight) / 2) + ")").action()
             # On démarre l'oscilloscope sélectionné
             Mesure.start("./results/" + apk + "-" + str(i) + ".csv")
             # si on utilise le robot
             if self.choixRobot == 1:
                 # on démarre l'application
                 adb.startApk(apk, package)
                 # temps de pause par sécurité
                 time.sleep(1)
                 # On execute notre scénario complet
                 robot.Robot(api, ecran, self.fenetre, Z_min, language).action()
                 # On ferme l'application
                 adb.closeApk(apk)
             # si on utilise pas le robot
             else:
                 if self.choixDebug == 0:
                     adb.RobotiumTest(False, apk)
                 else:
                     adb.RobotiumTest(True, apk)
             # On tient au courant l'utilisateur
             self.fenetre.setInstruction("etape " + str(i) + "/" + str(int(self.repetition)) + " : Enregistrement")
             # On arrete et sauvegarde la mesure d'energie
             Mesure.stop(True, temp1, freq1, 1, 1)
             # on met à jour la barre de chargement
             self.fenetre.setpourcent(100.*(num_scenar+(num_test/float(self.repetition)))/len(Filelist))
         # Si on utilise la methode powertran
         if self.powertran == 1:
             self.fenetre.setInstruction("desinstallation de l'apk PowerTran...")
             adb.uninstallApk("powertran")
         # On tient au courant l'utilisateur
         self.fenetre.setInstruction("desinstallation de l'apk...")
         # Une fois que tout est fait, on désinstalle l'application
         if self.choixRobot == 0:
             adb.uninstallApk(apk + ".test")
             adb.uninstallApk(apk)
         else:
             adb.uninstallApk(apk)
     # On tient au courant l'utilisateur
     self.fenetre.setInstruction("Les mesures ont ete enregistrees dans\nle dossier results.")
     # on deconnecte le robot
     if self.choixRobot == 1:
         dType.DisconnectDobot(api)
Esempio n. 15
0
 def dobotDisconnect(self):
     self.moveHome()
     dType.DisconnectDobot(self.api)
Esempio n. 16
0
def disconnect_dobot():
    #Disconnect Dobot
    dType.DisconnectDobot(api)
    return 'Disconnected'
Esempio n. 17
0
def disconnect():
    #Disconnect Dobot
    dType.DisconnectDobot(api)
    print("Connect status:", CON_STR[state])
		
		dType.SetDeviceWithL(api, dobotId, 1) #!!!! set 1
		##dType.GetDeviceWithL(api, dobotId)
		#dType.SetWAITCmdEx(api, dobotId, 1, 1) #api, dobotId, waitTime, isQueued
		####################################### paste script here:
		current_pose = dType.GetPose(api, dobotId)
		print("start_Mag current_pose:", current_pose)
		dType.SetPTPWithLCmdEx(api, dobotId, 1, current_pose[0], current_pose[1], current_pose[2], current_pose[3], 500, 1) #SetPTPWithLCmdEx(api, dobotId, ptpMode, x, y, z, rHead,  l, isQueued=0)
	
		current_pose = dType.GetPose(api, dobotId)
		print("start_Mag current_pose:", current_pose)
		dType.SetPTPWithLCmdEx(api, dobotId, 1, current_pose[0], current_pose[1], current_pose[2], current_pose[3], 400, 1)
		#######################################
		#dType.SetQueuedCmdStartExec(api,dobotId)
		#dType.SetWAITCmdEx(api, dobotId, 1, 1)
		dType.DisconnectDobot(api, dobotId)



		dobotId = M1_id
		#dType.SetQueuedCmdStartExec(api,dobotId)
		####################################### paste script here:
		dType.SetPTPCmdEx(api, dobotId, 0, 200,  (-200),  230, 0, 1) #(api, dobotId, ptpMode, x, y, z, rHead, isQueued=0)
		dType.SetPTPCmdEx(api, dobotId, 0, 350,  0,  20, 0, 1)
		#######################################
		dType.DisconnectDobot(api, dobotId)
		
		#dType.SetPTPCmd(

		#SetQueuedCmdStopExec
		print("end")
 def disconnect(self):
     dType.DisconnectDobot(self.api)
Esempio n. 20
0
                    dType.PTPMode.PTPMOVLXYZMode,
                    26.07,
                    153.56,
                    -0.685,
                    161.0,
                    isQueued=1)
    dType.SetWAITCmd(api, 1, isQueued=1)

    lastIndex = lastIndex + 11

    #  This  EMotor
    #  This  EMotor
    #  This  EMotor
    #  This  EMotor

    # dType.SetEMotor(api, 0, 1, 10000, isQueued=1)
    # dType.SetEMotorS(api, 0, 1, 10000, 20000,isQueued=1)

    #Start to Execute Command Queued
    dType.SetQueuedCmdStartExec(api)

    #Wait for Executing Last Command
    while lastIndex > dType.GetQueuedCmdCurrentIndex(api)[0]:
        dType.dSleep(100)

    #Stop to Execute Command Queued
    dType.SetQueuedCmdStopExec(api)

#Disconnect Dobot
dType.DisconnectDobot(api)
Esempio n. 21
0
 def close(self):
     dType.DisconnectDobot(self.api)
     print("Dobot disconnected")