Exemple #1
0
def init():
    speed1=150
    speed = 500
    coordinate=500
    dType.SetPTPJointParams(api, speed1,speed1,speed1,speed1,speed1,speed1,speed1,speed1, isQueued=1)
    dType.SetPTPCommonParams(api, speed, speed, isQueued=1)
    dType.SetPTPCoordinateParams(api,coordinate,coordinate,coordinate,coordinate,isQueued=1)
Exemple #2
0
def init(speed=100, coordinate=4000):
    dType.SetQueuedCmdClear(api)
    dType.SetPTPJointParams(api,
                            200,
                            200,
                            200,
                            200,
                            200,
                            200,
                            200,
                            200,
                            isQueued=1)
    # dType.SetPTPJointParams(api, speed, speed, speed, speed, speed, speed, speed, speed, isQueued=1)
    dType.SetPTPCoordinateParams(api,
                                 coordinate,
                                 coordinate,
                                 coordinate,
                                 coordinate,
                                 isQueued=1)
#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 Motion Params Setting
    dType.SetHOMEParams(api, 172, -120, 50, 0, isQueued=1)
    dType.SetPTPJointParams(api,
                            200,
                            200,
                            200,
                            200,
                            200,
                            200,
                            200,
                            200,
                            isQueued=1)
    dType.SetPTPCommonParams(api, 100, 100, isQueued=1)
    dType.SetPTPJumpParams(api, 10, 100, isQueued=1)

    #Async Home
    dType.SetHOMECmd(api, temp=0, isQueued=1)

    #Async PTP Motion
    #(default DobotControl action)
    #for i in range(0, 6):
    #    if i % 2 == 0:
    #        offset = 50