Python library for Dobot Magician
Based on Communication Protocol V1.1.4 (latest version here)
Installation
Install driver from https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers.
pip install pydobot
Example
from serial.tools import list_ports
from pydobot import Dobot
port = list_ports.comports()[0].device
device = Dobot(port=port)
pose = device.get_pose()
print(pose)
position = pose.position
device.move_to(position.x + 20, position.y, position.z, position.r, wait=False)
device.move_to(position.x, position.y, position.z, position.r, wait=True) # we wait until this movement is done before continuing
device.close()
Methods
-
Dobot(port, verbose=False) Creates an instance of dobot connected to given serial port.
- port: string with name of serial port to connect
- verbose: bool will print to console all serial comms
-
.pose() Returns the current pose of dobot, as a tuple (x, y, z, r, j1, j2, j3, j4)
- x: float current x cartesian coordinate
- y: float current y cartesian coordinate
- z: float current z cartesian coordinate
- r: float current effector rotation
- j1: float current joint 1 angle
- j2: float current joint 2 angle
- j3: float current joint 3 angle
- j4: float current joint 4 angle
-
.move_to(x, y, z, r, wait=False) queues a translation in dobot to given coordinates
- x: float x cartesian coordinate to move
- y: float y cartesian coordinate to move
- z: float z cartesian coordinate to move
- r: float r effector rotation
- wait: bool waits until command has been executed to return to process
-
.speed(velocity, acceleration) changes velocity and acceleration at which the dobot moves to future coordinates
- velocity: float desired translation velocity
- acceleration: float desired translation acceleration
-
.suck(enable)
- enable: bool enables/disables suction
-
.grip(enable)
- enable: bool enables/disables gripper
Release files for pydobot2 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pydobot2-0.1.0.tar.gz | 11.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pydobot2-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.7 kB
Release files / pydobot2-0.1.0.tar.gz
| Download URL | pydobot2-0.1.0.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5437a01811b5877804a9c2ffe23879bbb8252c88fb72a0eaa0e0957da79a2668
|
|
BLAKE2b-256 checksum How to use checksums |
461cb175ccca4efb5769ade9d1dcd7dac8861babf79ee70ca493bc6d10f5f1e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5
|
Release files / pydobot2-0.1.0-py3-none-any.whl
| Download URL | pydobot2-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4c22faebe0f9f4aba3296fc23d546caf461526d53b4f68cdd23b2709052a8018
|
|
BLAKE2b-256 checksum How to use checksums |
4861c7493a38b7915ebc549306efd8c04515fb0ce5a1391074a3191d6141b49c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5
|