Ejemplo n.º 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)
    #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
    #    else:
    #        offset = -50
    #    lastIndex = dType.SetPTPCmd(api, dType.PTPMode.PTPMOVLXYZMode, 200 + offset, offset, offset, offset, isQueued = 1)[0]

    #rough estimates of the Game Board Corner Coordinates based on 4.5 inches away from dobot side