Skip to main content

A library to control Dobot robots via TCP

Project description

DobotTCP Library

DobotTCP is a Python library to control the Dobot robot range via its TCP interface. The library provides functions for managing motion, I/O, and configuration of the Dobot robot. It was specially developed with the Dobot MagicianE6 in mind.

Installation

Install the library via pip:

pip install DobotTCP

Ensure Python 3.8+ is installed. Install dependencies if not automatically installed:

pip install multipledispatch

Import the library in your project:

from DobotTCP import Dobot

Basic Usage

Example

from DobotTCP import Dobot

# Connect the robot
robot = Dobot(ip="192.168.5.1", port=29999)
robot.Connect()

# Enable robot and parse response
(err, rsp, cmd) = robot.EnableRobot()
print(f"  Error code: {err}")
print(f"  Response: {rsp}")
print(f"  Command: {cmd}")

# Move robot with joint motion to pose
robot.MovJ("pose={0,0,0,0,0,0}")

# Home robot
robot.Home()

robot.Disconnect()

Included Classes

Addidtional classes for robot accessories have been added

Flexible Gripper

Basic controls for a flexible gripper

from DobotTCP import Dobot, FlexGripper

robot = Dobot()
gripper = FlexGripper(robot)
gripper.Open()
gripper.Close()

Servo Gripper

Basic controls for a servo gripper (IO mode)

from DobotTCP import Dobot, ServoGripper

robot = Dobot()
servo_gripper = ServoGripper(robot)
servo_gripper.SetState(1)  # Open
servo_gripper.SetState(2)  # Close

Feedback

This class was implemented to receive feedback from the robot via TCP.

from DobotTCP import Dobot, Feedback

robot = Dobot()
feedback = Feedback(robot)
feedback.Connect()
feedback.Get()
print(feedback.data.get("RobotType"))

Notes

  • This class was written with the intention to stay as close to the syntax formatting of the original Dobot TCP protocol. Therefore, not all python style guides are followed. For example function names start with a capital letter.

  • Since method overloading is not trivial in python, some functions had to be changed in order to make them work in python. This is especially the case for the tray functions.

Version Changelog

  • v1.0.0 (17.01.2025): Initial release based on TCP protocol v4.5.0
  • v1.1.0 (20.01.2025):
    • Update library based on new TCP protocol v4.6.0. Some new commands may require the robot controller version to be updated to V4.6.0.
    • Add module docstring and parsing functions
  • v1.1.1 (27.01.2025): Various bug fixes
  • v1.1.2 (31.01.2025): Fixes bugs when parsing robot responses
  • v1.1.3 (16.06.2025): Fixes bug with incorrect init file
  • v1.1.4 (27.06.2025): Fixes bugs with Flexgripper class

Contributing

Feel free to contribute to the project by submitting issues or pull requests.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dobottcp-1.1.4.tar.gz (23.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dobottcp-1.1.4-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file dobottcp-1.1.4.tar.gz.

File metadata

  • Download URL: dobottcp-1.1.4.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.5

File hashes

Hashes for dobottcp-1.1.4.tar.gz
Algorithm Hash digest
SHA256 e9dc967b84589b77f8d7ad9e479e5baa7d0792c86514e9eb812a363abe96945c
MD5 bf05238e37737c13385480cd017f5e49
BLAKE2b-256 58fef6e82f51c7851515a7978ba200a7cd38257e5851db19aac74a48e1df4528

See more details on using hashes here.

File details

Details for the file dobottcp-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: dobottcp-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 24.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.5

File hashes

Hashes for dobottcp-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fcd29b6684dab5db44985cf39769d4dae7dc867b470ca7f64c34c9a40d0f1b5e
MD5 ff7fee52cfb5d3a0775baeb277beca57
BLAKE2b-256 15d3f974d091ef350b03d6ce8ed6c77394361cc8fb71ed6b92aa9f55e6f09f15

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page