コード例 #1
0
from DobotSDK import Dobot
import time

# The top Z to go to.
up = 180
# The bottom Z to go to.
down = 120
# Maximum speed in mm/s
speed = 700
# Acceleration in mm/s^2
acceleration = 400

# dobot = Dobot('/dev/tty.usbmodem1421', debug=True, fake=True)
# dobot = Dobot('COM4', debug=True)
dobot = Dobot('/dev/tty.usbmodem1421', debug=True)

# Enable calibration routine if you have a limit switch/photointerrupter installed on the arm.
# See example-switch.py for details.
# Take the tool to a safe haight.
# dobot.MoveWithSpeed(260.0, 0.0, up, speed, acceleration)
# time.sleep(2)
# dobot.CalibrateJoint(1, dobot.freqToCmdVal(2000), dobot.freqToCmdVal(50), 1, 5, 1, 0)

dobot.Gripper(480)
# Take an object on the right and put to the left
dobot.MoveWithSpeed(260.0, 0.0, up, speed, acceleration, 0)
dobot.MoveWithSpeed(260.0, -70.0, up, speed, acceleration)
dobot.MoveWithSpeed(260.0, -70.0, down, speed, acceleration)
dobot.Gripper(208)
dobot.Wait(0.2)
コード例 #2
0
ファイル: example-sdk.py プロジェクト: good8051/open-dobot
'''

from DobotSDK import Dobot
import time

# The top Z to go to.
up = 50
# The bottom Z to go to.
down = 39
# Maximum speed in mm/s
speed = 700
# Acceleration in mm/s^2
acceleration = 400

# dobot = Dobot('/dev/tty.usbmodem1421', debug=True, fake=True)
dobot = Dobot('/dev/tty.usbmodem1421', debug=True)

# Enable calibration routine if you have a limit switch/photointerrupter installed on the arm.
# See example-switch.py for details.
# Move both arms to approximately 45 degrees.
# dobot.moveWithSpeed(260.0, 0.0, 85, 700, acceleration)
# time.sleep(2)
# dobot.CalibrateJoint(1, dobot.freqToCmdVal(2000), dobot.freqToCmdVal(50), 1, 5, 1, 0)

# Line
# dobot.moveWithSpeed(200.0, 80.0, up, speed, acceleration)
# dobot.moveWithSpeed(200.0, 80.0, down, speed, acceleration)
# dobot.moveWithSpeed(200.0, -90.0, down, speed, acceleration)
# dobot.moveWithSpeed(200.0, -90.0, up, speed, acceleration)

# dobot.moveWithSpeed(200.0, -90.0, down, speed, acceleration)
コード例 #3
0
ファイル: example-sdk.py プロジェクト: mgouget/open-dobot
Refer to SDK to find the expected initial arm configuration.

Each move is split into a series of commands to send via driver to FPGA. Each command is
executed for 20ms. Dobot, thus, executes 50 commands per second.

The commands are queued in Arduino, hence when you stop this example dobot will continue
to execute until the queue (200 commands) is empty.

'''

from DobotSDK import Dobot

# for i in range(10):
# dobot = Dobot('/dev/tty.usbmodem1421', debug=True, fake=True)
dobot = Dobot('/dev/tty.usbmodem1421', debug=True)

dobot.CalibrateJoint(1, dobot.freqToCmdVal(2000), dobot.freqToCmdVal(50), 1, 5, 1, 0)
while True:
	dobot.moveWithSpeed(200.0, 80.0, 60, 400, 300)
	dobot.moveWithSpeed(200.0, 80.0, 40, 400, 300)
	dobot.moveWithSpeed(200.0, 80.0, 60, 400, 300)
	dobot.moveWithSpeed(200.0, -80.0, 60, 400, 300)
	dobot.moveWithSpeed(200.0, -80.0, 40, 400, 300)
	dobot.moveWithSpeed(200.0, -80.0, 60, 400, 300)
# dobot.moveWithSpeed(200.0, 50.0, 44.0, 100)
# dobot.moveWithSpeed(200.0, -50.0, 44.0, 100)
# dobot.moveWithSpeed(200.0, 0.0, 44.0, 100)

# dobot.moveWithSpeed(160.0, 0.0, 115.0, 100)
# dobot.moveWithSpeed(160.0, 0.0, 215.0, 100)
コード例 #4
0
#! /usr/bin/env python
'''
Take an object using sucker pump and put it in a different place.

'''

from DobotSDK import Dobot
import time

# dobot = Dobot('COM4', debug=True)
dobot = Dobot('/dev/tty.usbmodem1421', debug=True)

# Enable calibration routine if you have a limit switch/photointerrupter installed on the arm.
# See example-switch.py for details.
# Move both arms to approximately 45 degrees.
# dobot.moveWithSpeed(260.0, 0.0, 85, 700)
# time.sleep(2)
# dobot.CalibrateJoint(1, dobot.freqToCmdVal(2000), dobot.freqToCmdVal(50), 1, 5, 1, 0)

def repeatUntilQueued(on):
	ret = (0,0)
	while not ret[0] or not ret[1]:
		ret = dobot.PumpOn(on)
	ret = (0,0)
	while not ret[0] or not ret[1]:
		ret = dobot.ValveOn(on)

dobot.MoveWithSpeed(200.0, -50.0, 180.0, 100)
dobot.MoveWithSpeed(200.0, -50.0, 120.0, 100)
repeatUntilQueued(True)
dobot.MoveWithSpeed(200.0, -50.0, 180.0, 100)
コード例 #5
0
ファイル: DobotHakanSDK.py プロジェクト: HakanYrm/open-dobot
import DobotCoordinates
from DobotSDK import Dobot
dobot = Dobot('COM5', debug=False)
dobot.CalibrateJoint(1, dobot.freqToCmdVal(500), dobot.freqToCmdVal(50), 1, 5,
                     1, 0)
dobot.InitializeAccelerometers()

upP, acceleration, speed = 100, 400, 400


class Methods():
    def touchTest(self, device, station):
        print "Touch test started..."
        [x1, x2, x4], [y1, y2,
                       y4] = DobotCoordinates.getZeroPoint(device, station)
        height, width, down, up = self.getPhoneProperties(device)
        numberOfSquareX = 16
        numberOfSquareY = 9
        shiftY = y2 - y1
        shiftX = x4 - x1
        xRange = (x2 - x1) / numberOfSquareX
        yRange = (y4 - y1) / numberOfSquareY
        xBuffer = (xRange / 2.0)
        yBuffer = (yRange / 2.0)
        for stepX in range(0, numberOfSquareX):
            x = x1 + xRange * stepX + xBuffer
            for stepY in range(0, numberOfSquareY):
                y = y1 + yRange * stepY + yBuffer + stepX * (shiftY /
                                                             numberOfSquareX)
                x = x + shiftX / numberOfSquareY
                dobot.MoveWithSpeed(x, y, up, speed, acceleration)
コード例 #6
0
ファイル: example-sdk.py プロジェクト: mgouget/open-dobot
Refer to SDK to find the expected initial arm configuration.

Each move is split into a series of commands to send via driver to FPGA. Each command is
executed for 20ms. Dobot, thus, executes 50 commands per second.

The commands are queued in Arduino, hence when you stop this example dobot will continue
to execute until the queue (200 commands) is empty.

'''

from DobotSDK import Dobot

# for i in range(10):
# dobot = Dobot('/dev/tty.usbmodem1421', debug=True, fake=True)
dobot = Dobot('/dev/tty.usbmodem1421', debug=True)

dobot.CalibrateJoint(1, dobot.freqToCmdVal(2000), dobot.freqToCmdVal(50), 1, 5,
                     1, 0)
while True:
    dobot.moveWithSpeed(200.0, 80.0, 60, 400, 300)
    dobot.moveWithSpeed(200.0, 80.0, 40, 400, 300)
    dobot.moveWithSpeed(200.0, 80.0, 60, 400, 300)
    dobot.moveWithSpeed(200.0, -80.0, 60, 400, 300)
    dobot.moveWithSpeed(200.0, -80.0, 40, 400, 300)
    dobot.moveWithSpeed(200.0, -80.0, 60, 400, 300)
# dobot.moveWithSpeed(200.0, 50.0, 44.0, 100)
# dobot.moveWithSpeed(200.0, -50.0, 44.0, 100)
# dobot.moveWithSpeed(200.0, 0.0, 44.0, 100)

# dobot.moveWithSpeed(160.0, 0.0, 115.0, 100)
コード例 #7
0
ファイル: example-laser.py プロジェクト: schmurfy/open-dobot
#! /usr/bin/env python
'''
Laser going in a straight line.

!!!!! TAKE ALL POSSIBLE PRECAUTIONS TO PREVENT FIRE !!!!!
!!!!! BE READY TO DISCONNECT THE ARM FROM POWER SOURCE AT ANY TIME !!!!!

'''

from DobotSDK import Dobot
import time

dobot = Dobot('/dev/tty.usbmodem1421', debug=True)

# Enable CalibrateJoint to calibrate base if you have a limit switch/photointerrupter mounted and connected.
# dobot.CalibrateJoint(1, dobot.freqToCmdVal(1000), dobot.freqToCmdVal(50), 1, 5, 1, 0)
dobot.moveWithSpeed(200.0, -50.0, 100.0, 50)
time.sleep(2)
dobot.LaserOn(True)
dobot.moveWithSpeed(200.0, 50.0, 100.0, 0.75)
time.sleep(4)
dobot.LaserOn(False)
コード例 #8
0
from DobotSDK import Dobot
import time

# The top Z to go to.
up = 50
# The bottom Z to go to.
down = 39
# Maximum speed in mm/s
speed = 700
# Acceleration in mm/s^2
acceleration = 400

# dobot = Dobot('/dev/tty.usbmodem1421', debug=True, fake=True)
# dobot = Dobot('COM4', debug=True)
dobot = Dobot('/dev/tty.usbmodem1421', debug=True)
# dobot = Dobot('/dev/tty.BT4-SPP-SerialPort', debug=True, timeout=0.3)

# Enable calibration routine if you have a limit switch/photointerrupter installed on the arm.
# See example-switch.py for details.
# Move both arms to approximately 45 degrees.
# dobot.MoveWithSpeed(260.0, 0.0, 85, 700, acceleration)
# time.sleep(2)
# dobot.CalibrateJoint(1, dobot.freqToCmdVal(2000), dobot.freqToCmdVal(50), 1, 5, 1, 0)

# Line
# dobot.MoveWithSpeed(200.0, 80.0, up, speed, acceleration)
# dobot.MoveWithSpeed(200.0, 80.0, down, speed, acceleration)
# dobot.MoveWithSpeed(200.0, -90.0, down, speed, acceleration)
# dobot.MoveWithSpeed(200.0, -90.0, up, speed, acceleration)