Exemplo n.º 1
0
# dobot.InitializeAccelerometers()
# 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)
# dobot.MoveWithSpeed(200.0, 80.0, down, speed, acceleration)
# dobot.MoveWithSpeed(200.0, 80.0, up, speed, acceleration)
# dobot.MoveWithSpeed(200.0, -90.0, up, speed, acceleration)

# Rectangle with zig-zag inside
dobot.MoveWithSpeed(170.0, -90.0, up, speed, acceleration)
dobot.MoveWithSpeed(170.0, -90.0, down, speed, acceleration)
dobot.MoveWithSpeed(170.0, 80.0, down, speed, acceleration)
dobot.MoveWithSpeed(230.0, 80.0, down, speed, acceleration)
dobot.MoveWithSpeed(230.0, -90.0, down, speed, acceleration)
dobot.MoveWithSpeed(170.0, -90.0, down, speed, acceleration)
x = 230
y = 0
for y in range(-90, 81, 5):
	if x == 170:
		x = 230
	else:
		x = 170
	dobot.MoveWithSpeed(x, y, down, speed, acceleration)

dobot.MoveWithSpeed(x, y, up, speed, acceleration)
Exemplo n.º 2
0
#! /usr/bin/env python

import time
from dobot import Dobot
dobot = Dobot('COM5', debug=True)



# Acceleration in mm/s^2
acceleration = 50
speed = 50

#go home
#raw_input("Press Enter to go home...")
#dobot.MoveWithSpeed(140, -200, 80, speed, acceleration)
dobot.MoveWithSpeed(140, -210, 200, speed, acceleration)
Exemplo n.º 3
0
!!!!! TAKE ALL POSSIBLE PRECAUTIONS TO PREVENT FIRE !!!!!
!!!!! BE READY TO DISCONNECT THE ARM FROM POWER SOURCE AT ANY TIME !!!!!

'''

from dobot import Dobot
import time

# dobot = Dobot('COM4', debug=True)
dobot = Dobot('/dev/ttyUSB0', 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.LaserOn(on)


dobot.MoveWithSpeed(200.0, -50.0, 100.0, 50)
repeatUntilQueued(True)
dobot.MoveWithSpeed(200.0, 50.0, 100.0, 0.75)
repeatUntilQueued(False)
Exemplo n.º 4
0
     "Input the required coordinate or input 'h' to go home or 'q' to quit")
 if i == 0:
     print("Input X: ")
 elif i == 1:
     print("Input Y: ")
 elif i == 2:
     print("Input Z: ")
 key = input()
 if key == 'q':
     break
 elif key == 'h':
     coordinates[0] = 217
     coordinates[1] = 0
     coordinates[2] = 229
     print("Going Home: ", coordinates)
     dobot.MoveWithSpeed(coordinates[0], coordinates[1], coordinates[2],
                         speed, acceleration)
     i = 0
 else:
     coordinates[i] = int(key)
     i = i + 1
     if i > 2:
         if coordinates[0] == 0 and coordinates[1] == 0 and coordinates[
                 2] == 0:
             coordinates[0] = 217
             coordinates[1] = 0
             coordinates[2] = 229
         print("SENT: ", coordinates)
         print(dobot.driver.GetAccelerometers())
         dobot.MoveWithSpeed(coordinates[0], coordinates[1], coordinates[2],
                             speed, acceleration)
         i = 0
Exemplo n.º 5
0
acceleration = 400

# dobot = Dobot('/dev/tty.usbmodem1421', debug=True, fake=True)
# dobot = Dobot('COM4', debug=True)
dobot = Dobot('/dev/ttyUSB0', 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 height.

# 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)
dobot.MoveWithSpeed(260.0, -70.0, up, speed, acceleration)
dobot.MoveWithSpeed(260.0, 70.0, up, speed, acceleration, 500)
dobot.MoveWithSpeed(260.0, 70.0, down, speed, acceleration)
dobot.Gripper(480)
dobot.Wait(0.2)
dobot.MoveWithSpeed(260.0, 70.0, up, speed, acceleration)
dobot.Wait(0.5)
# Return to center
dobot.MoveWithSpeed(260.0, 0.0, up, speed, acceleration, 0)
Exemplo n.º 6
0
from dobot import Dobot

# Acceleration in mm/s^2
acceleration = 20
speed = 20

dobot = Dobot('COM5', debug=False)
dobot.CalibrateJoint(1, dobot.freqToCmdVal(500), dobot.freqToCmdVal(50), 1, 5,
                     1, 0)
dobot.InitializeAccelerometers()

#===============================================================================
# dobot = Dobot('COM5', debug=True)
# dobot.CalibrateJoint(1, dobot.freqToCmdVal(500), dobot.freqToCmdVal(50),1 , 5, 1, 0)
# dobot.InitializeAccelerometers()
#===============================================================================

#dobot.MoveWithSpeed(260, -10, 80, speed, acceleration)

#go home
#raw_input("Press Enter to go home...")

dobot.MoveWithSpeed(240, -20, 80, speed, acceleration)