Python library for Dobot Magician
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pydobot2-0.1.0.tar.gz
.
File metadata
- Download URL: pydobot2-0.1.0.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5437a01811b5877804a9c2ffe23879bbb8252c88fb72a0eaa0e0957da79a2668 |
|
MD5 | 7d94cf7a26a0b5cb196ae310ae08ff46 |
|
BLAKE2b-256 | 461cb175ccca4efb5769ade9d1dcd7dac8861babf79ee70ca493bc6d10f5f1e3 |
File details
Details for the file pydobot2-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: pydobot2-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c22faebe0f9f4aba3296fc23d546caf461526d53b4f68cdd23b2709052a8018 |
|
MD5 | 1ce1920a22eea1208db97b8b758baf45 |
|
BLAKE2b-256 | 4861c7493a38b7915ebc549306efd8c04515fb0ce5a1391074a3191d6141b49c |