Metadata-Version: 2.4
Name: dobotexpress
Version: 0.1.1
Summary: A compact library to control the Dobot Magician
Project-URL: Homepage, https://github.com/SmartDeve/TheDobotExpress
Project-URL: Issues, https://github.com/SmartDeve/TheDobotExpress/issues
Author-email: Adityya Roy <royaditya02@outlook.com>
License: MIT License
        
        Copyright (c) 2026 Aditya Roy
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Environment :: Win32 (MS Windows)
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Requires-Dist: pyserial
Description-Content-Type: text/markdown


# DobotExpress

DobotExpress is a high-level Python-based control framework designed to simplify, accelerate, and scale automation workflows using Dobot Magician. This library is built upon the original DobotDll.dll which is shipped with Dobot Studio whose last release was in 2019. 

DobotExpress aims to provide full functionality similar to the DobotStudio. This library was created in the wake of limited functionality of the previous wrapper libraries available out in the open.

The library is still under development and will be added with more functionalities with time. Here is what a Dobot Magician looks like:

<img src="https://github.com/user-attachments/assets/008443a7-da8a-43fc-a623-339e0b46e896" width="60%">



## Requirements

* Python 32 bit Architecture
* Visual Studio Redistributable C++


## Setting up

Install the package using pip:

```
pip install dobotexpress
```

## Initialize

```python
dobot = DobotManager()
device = manager.create("COM17")
```

## Basic Concepts

### Queue System

Dobot uses what we call a Queue system. MOST of the commands you give, it accomodates in a queue in it's internal buffer. The commands which do this, return a queueIndex, which is basically token number and when that token number is reached the dobot then executes that command. The only use of the queueIndex is when you want to make the dobot wait for a command to happen.

This library currently does not support Alarms, so you need to use DobotStudio to clear any manual alarms.

### DobotManager

The DobotDll.dll had a limitation where only a single Dobot could be controlled within a Python environment. To overcome this constraint, we introduced DobotManager, which assigns dedicated worker threads to independently initialize and manage multiple Dobot devices.

The diagram below illustrates the internal architecture and workflow of DobotExpress..

<img width="960" height="540" alt="DobotExpress" src="https://github.com/user-attachments/assets/2450ecf8-46e7-4dd9-a69d-2b864280c797" />


## Methods


* **clearCommands()**: To clear the command buffer and stop any execution of queues.
* **setCartisianSpeed(velocity, acceleration)**: To set the speed of dobot when moving with x,y,z and r coordinates.
* **setJointSpeed(velocity, acceleration)**: To set the speed of the joints of the dobot
* **getPosition()**: To get the position of the x,y,z,r,j1,j2,j3 and j4 coordinates
* **enableLinearRail(state)**: To enable/disable the linear rail. You need to run this before you do any other operation with linear rail.
*  **getLinearRailPosition()**: To get the position of the linear rail.
* **goHome()**: Homes the dobot with default coordinates
* **setHomeCoordinates(x,y,z,r)**: Sets custom coordinates for the dobot to home. You still need to run goHome() to home the dobot. This just sets the coordinates
* **moveXYZ(x,y,z,r)**: To move the dobot with cartisian coordinates.
* **moveJoints(j1,j2,j3,j4)**: To move the dobot using joint angles
* **moveWithMode(PTPMode,a,b,c,d)**: This method gives you access to the 9 modes of movement, Dobot allows you to do. You can read about this mode in the subsection below.
* **setGripperState(enable,state)**: To control the gripper of the dobot. First parameter turns the gripper on/off and the second parameter controls it's open and closing
* **setSuctionState(enable,state)**:To control the suction of the dobot. First parameter turns the suction on/off and the second parameter controls it's state.
* **enableColorSensor(state,port)**: To enable/disable the color sensor connnected to dobot's one of the GPIO pin. Make sure to give the exact pin number written against the GPIO number on the dobot. GPIO Number ≠ Pin number
* **enableIRSensor(state,port)**: To enable/disable the IR sensor connnected to dobot's one of the GPIO pin. Make sure to give the exact pin number written against the GPIO number on the dobot. GPIO Number ≠ Pin number
* **readIRSensor()**: To read IR Sensor value, make sure to enable IR sensor first.
* **readColorSensor()**: To read color sensor value, make sure to enable the color sensor first
* **makeToWait(queueIndex)**: Make the dobot wait for the completion of a command.
* **moveConveyer(distance)**: Move the conveyer of the dobot connected to the stepper motor.




## About

This library was developed at the IEOR Lab, IIT Bombay, by Aditya Roy to enable control of Dobot robotic systems and to support research into their capabilities and applications.
