|
16 | 16 | ''' |
17 | 17 |
|
18 | 18 | from DobotSDK import Dobot |
| 19 | +import time |
| 20 | + |
| 21 | +# The top Z to go to. |
| 22 | +up = 50 |
| 23 | +# The bottom Z to go to. |
| 24 | +down = 39 |
| 25 | +# Maximum speed in mm/s |
| 26 | +speed = 700 |
| 27 | +# Acceleration in mm/s^2 |
| 28 | +acceleration = 400 |
19 | 29 |
|
20 | | -# for i in range(10): |
21 | 30 | # dobot = Dobot('/dev/tty.usbmodem1421', debug=True, fake=True) |
22 | 31 | dobot = Dobot('/dev/tty.usbmodem1421', debug=True) |
23 | 32 |
|
24 | | -dobot.CalibrateJoint(1, dobot.freqToCmdVal(2000), dobot.freqToCmdVal(50), 1, 5, 1, 0) |
25 | | -while True: |
26 | | - dobot.moveWithSpeed(200.0, 80.0, 60, 400, 300) |
27 | | - dobot.moveWithSpeed(200.0, 80.0, 40, 400, 300) |
28 | | - dobot.moveWithSpeed(200.0, 80.0, 60, 400, 300) |
29 | | - dobot.moveWithSpeed(200.0, -80.0, 60, 400, 300) |
30 | | - dobot.moveWithSpeed(200.0, -80.0, 40, 400, 300) |
31 | | - dobot.moveWithSpeed(200.0, -80.0, 60, 400, 300) |
32 | | -# dobot.moveWithSpeed(200.0, 50.0, 44.0, 100) |
33 | | -# dobot.moveWithSpeed(200.0, -50.0, 44.0, 100) |
34 | | -# dobot.moveWithSpeed(200.0, 0.0, 44.0, 100) |
35 | | - |
36 | | -# dobot.moveWithSpeed(160.0, 0.0, 115.0, 100) |
37 | | -# dobot.moveWithSpeed(160.0, 0.0, 215.0, 100) |
38 | | -# dobot.moveWithSpeed(160.0, 0.0, 115.0, 100) |
39 | | -# dobot.moveWithSpeed(120.0, 0.0, 115.0, 100) |
40 | | -# dobot.moveWithSpeed(160.0, -100.0, 215.0, 100) |
41 | | - |
42 | | -# print '======================================' |
43 | | -# for i in range(3): |
44 | | -# dobot.moveTo(160.0, 60.0, 60.0, duration) |
45 | | -# print '======================================' |
46 | | -# dobot.moveTo(220.0, 60.0, 60.0, duration) |
47 | | -# print '======================================' |
48 | | -# dobot.moveTo(220.0, -60.0, 60.0, duration) |
49 | | -# print '======================================' |
50 | | -# dobot.moveTo(160.0, -60.0, 60.0, duration) |
51 | | -# print '======================================' |
52 | | -# dobot.moveTo(160.0, 0.0, 60.0, duration) |
53 | | -# print '======================================' |
54 | | -# dobot.moveTo(160.0, 0.0, 215.0, duration) |
55 | | -# print '======================================' |
| 33 | +# Enable calibration routine if you have a limit switch/photointerrupter installed on the arm. |
| 34 | +# See example-switch.py for details. |
| 35 | +# Move both arms to approximately 45 degrees. |
| 36 | +# dobot.moveWithSpeed(260.0, 0.0, 85, 700, acceleration) |
| 37 | +# time.sleep(2) |
| 38 | +# dobot.CalibrateJoint(1, dobot.freqToCmdVal(2000), dobot.freqToCmdVal(50), 1, 5, 1, 0) |
| 39 | + |
| 40 | +# Line |
| 41 | +# dobot.moveWithSpeed(200.0, 80.0, up, speed, acceleration) |
| 42 | +# dobot.moveWithSpeed(200.0, 80.0, down, speed, acceleration) |
| 43 | +# dobot.moveWithSpeed(200.0, -90.0, down, speed, acceleration) |
| 44 | +# dobot.moveWithSpeed(200.0, -90.0, up, speed, acceleration) |
| 45 | + |
| 46 | +# dobot.moveWithSpeed(200.0, -90.0, down, speed, acceleration) |
| 47 | +# dobot.moveWithSpeed(200.0, 80.0, down, speed, acceleration) |
| 48 | +# dobot.moveWithSpeed(200.0, 80.0, up, speed, acceleration) |
| 49 | +# dobot.moveWithSpeed(200.0, -90.0, up, speed, acceleration) |
| 50 | + |
| 51 | +# Rectangle with zig-zag inside |
| 52 | +dobot.moveWithSpeed(170.0, -90.0, up, speed, acceleration) |
| 53 | +dobot.moveWithSpeed(170.0, -90.0, down, speed, acceleration) |
| 54 | +dobot.moveWithSpeed(170.0, 80.0, down, speed, acceleration) |
| 55 | +dobot.moveWithSpeed(230.0, 80.0, down, speed, acceleration) |
| 56 | +dobot.moveWithSpeed(230.0, -90.0, down, speed, acceleration) |
| 57 | +dobot.moveWithSpeed(170.0, -90.0, down, speed, acceleration) |
| 58 | +x = 230 |
| 59 | +y = 0 |
| 60 | +for y in range(-90, 81, 5): |
| 61 | + if x == 170: |
| 62 | + x = 230 |
| 63 | + else: |
| 64 | + x = 170 |
| 65 | + dobot.moveWithSpeed(x, y, down, speed, acceleration) |
| 66 | + |
| 67 | +dobot.moveWithSpeed(x, y, up, speed, acceleration) |
| 68 | +dobot.moveWithSpeed(200.0, -90.0, up, speed, acceleration) |
| 69 | + |
| 70 | +# Jog |
| 71 | +# while True: |
| 72 | +# dobot.moveWithSpeed(200.0, 80.0, up, speed, acceleration) |
| 73 | +# dobot.moveWithSpeed(200.0, 80.0, down, speed, acceleration) |
| 74 | +# dobot.moveWithSpeed(200.0, 80.0, up, speed, acceleration) |
| 75 | +# dobot.moveWithSpeed(200.0, 80.0, 200, speed, acceleration) |
| 76 | +# dobot.moveWithSpeed(200.0, -80.0, up, speed, acceleration) |
| 77 | +# dobot.moveWithSpeed(200.0, -80.0, down, speed, acceleration) |
| 78 | +# dobot.moveWithSpeed(200.0, -80.0, up, speed, acceleration) |
| 79 | + |
| 80 | +# Dashed line |
| 81 | +# while True: |
| 82 | +# dobot.moveWithSpeed(200.0, 80.0, up, speed, acceleration) |
| 83 | +# dobot.moveWithSpeed(200.0, 80.0, down, speed, acceleration) |
| 84 | +# dobot.moveWithSpeed(200.0, 70.0, down, speed, acceleration) |
| 85 | +# dobot.moveWithSpeed(200.0, 70.0, up, speed, acceleration) |
| 86 | +# dobot.moveWithSpeed(200.0, 40.0, up, speed, acceleration) |
| 87 | +# dobot.moveWithSpeed(200.0, 40.0, down, speed, acceleration) |
| 88 | +# dobot.moveWithSpeed(200.0, 30.0, down, speed, acceleration) |
| 89 | +# dobot.moveWithSpeed(200.0, 30.0, up, speed, acceleration) |
| 90 | +# dobot.moveWithSpeed(200.0, 0.0, up, speed, acceleration) |
| 91 | +# dobot.moveWithSpeed(200.0, 0.0, down, speed, acceleration) |
| 92 | +# dobot.moveWithSpeed(200.0, -10.0, down, speed, acceleration) |
| 93 | +# dobot.moveWithSpeed(200.0, -10.0, up, speed, acceleration) |
| 94 | +# dobot.moveWithSpeed(200.0, -40.0, up, speed, acceleration) |
| 95 | +# dobot.moveWithSpeed(200.0, -40.0, down, speed, acceleration) |
| 96 | +# dobot.moveWithSpeed(200.0, -50.0, down, speed, acceleration) |
| 97 | +# dobot.moveWithSpeed(200.0, -50.0, up, speed, acceleration) |
| 98 | +# dobot.moveWithSpeed(200.0, -80.0, up, speed, acceleration) |
| 99 | +# dobot.moveWithSpeed(200.0, -80.0, down, speed, acceleration) |
| 100 | +# dobot.moveWithSpeed(200.0, -90.0, down, speed, acceleration) |
| 101 | +# dobot.moveWithSpeed(200.0, -90.0, up, speed, acceleration) |
0 commit comments