Python library for Dobot Magician upgraded
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 pydobotplus-0.1.0.tar.gz
.
File metadata
- Download URL: pydobotplus-0.1.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39f7ab6cd4d4ae90f6dcef747775268b80502aa79745c4c2f0f5e6a392d4c940 |
|
MD5 | 527a2cc7a51540f8f33dd337c019fb7f |
|
BLAKE2b-256 | af8366939482edf097bf389e938534f28c196b46c08bce111e9a54cd6299c5cb |
File details
Details for the file pydobotplus-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: pydobotplus-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d09b83b1d8231166f424cc135ea3867ef282693a800f1899a9e80e5a900b710 |
|
MD5 | b339f8e30b906f48b6360a0db08cf990 |
|
BLAKE2b-256 | 9f3ca57d8a61890f94002881db9e61ed1a258e72760700c3329833ddb388e5a8 |