pydobotpp


Namepydobotpp JSON
Version 0.1.5 PyPI version JSON
download
home_pageNone
SummaryAn extended cross-platform high-level API for the Dobot Magician robotic arm based on pydobotplus.
upload_time2025-10-30 14:54:39
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12
licenseNone
keywords api automation dobot interface python robotic arm
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pydobotplusplus

An (even more) extended Python library for controlling the Dobot Magician.

## Installation

Install the driver from [Silicon Labs](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers).

Run:
```sh
pip install pydobotplus
```

## Example

```python
from serial.tools import list_ports
from pydobotplus import Dobot, CustomPosition

available_ports = list_ports.comports()
print(f'available ports: {[x.device for x in available_ports]}')
port = available_ports[2].device

device = Dobot(port=port)

# Create a custom position
pos1 = CustomPosition(x=200, y=50, z=50)

# Move using direct coordinates
device.move_to(x=200, y=50, z=50)

# Move using custom position
device.move_to(position=pos1)

# Control the conveyor belt
device.conveyor_belt(speed=0.5, direction=1)
device.conveyor_belt_distance(speed_mm_per_sec=50, distance_mm=200, direction=1)

device.close()
```

## Methods

* **Dobot(port, verbose=False)** Creates an instance of Dobot connected to the given serial port.
    * **port**: _string_ with name of serial port to connect
    * **verbose**: _bool_ will print to console all serial communications

* **.get_pose()** Returns the current pose of the Dobot, as a `Pose` named tuple (position and joints).
    * **position**: _Position_ with (x, y, z, r) coordinates
    * **joints**: _Joints_ with (j1, j2, j3, j4) angles

* **.move_to(x=None, y=None, z=None, r=0, wait=True, mode=None, position=None)** Queues a translation for the Dobot to the given coordinates or a `Position` object, keeps any unspecified parameters the same.
    * **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 the command has been executed before returning to the process - DO NOT TOUCH UNLESS YOU KNOW WHAT YOU ARE DOING
    * **mode**: _MODE_PTP_ movement mode (default is `MODE_PTP.MOVJ_XYZ`) - DO NOT TOUCH UNLESS YOU KNOW WHAT YOU ARE DOING
    * **position**: _Position_ object with (x, y, z, r) coordinates

* **.move_rel(x=0, y=0, z=0, r=0, wait=True)** Moves the Dobot relative to its current position, keeps any unspecified parameters the same.
    * **x**: _float_ relative x coordinate
    * **y**: _float_ relative y coordinate
    * **z**: _float_ relative z coordinate
    * **r**: _float_ relative r rotation
    * **wait**: _bool_ waits until the command has been executed before returning to the process

* **.speed(velocity, acceleration)** Changes the velocity and acceleration at which the Dobot moves to future coordinates.
    * **velocity**: _float_ desired translation velocity
    * **acceleration**: _float_ desired translation acceleration

* **.suck(enable)** Enables or disables suction.
    * **enable**: _bool_ enables/disables suction

* **.grip(enable)** Enables or disables the gripper.
    * **enable**: _bool_ enables/disables gripper

* **.get_alarms()** Returns a set of current alarms.
    * **returns**: _set_ of `Alarm` enums

* **.clear_alarms()** Clears all current alarms.

* **.wait(ms)** Sends a wait command to the robot

* **.get_device_serial_number()** Returns the robot's serial number

*  **.set_device_name(name: str)** Sets the device's name (as one can do using DobotStudio)
  
*  **.get_device_name(name: str)** Get the device's name (as reported in DobotStudio)

* **CustomPosition(x=None, y=None, z=None, r=None)** Initializes a custom position object.
    * **x**: _float_ x coordinate
    * **y**: _float_ y coordinate
    * **z**: _float_ z coordinate
    * **r**: _float_ effector rotation - NOT USED ON MAGICIAN

* **MODE_PTP** Enum class for various PTP modes such as `JUMP_XYZ`, `MOVJ_XYZ`, `MOVL_XYZ`, etc. - DO NOT TOUCH UNLESS YOU KNOW WHAT YOU ARE DOING

* **DobotException** Custom exception class for handling Dobot-related errors.

* **.set_color_sensor(enable=True, version=1)** Enables or disables the color sensor.
    * **enable**: _bool_ enables/disables the sensor
    * **version**: _int_ sensor version

* **.get_color()** Returns the RGB values detected by the color sensor.
    * **returns**: _list_ with RGB values

* **.set_ir(enable=True, port=PORT_GP4)** Enables or disables the IR sensor on the specified port.
    * **enable**: _bool_ enables/disables the sensor
    * **port**: _int_ port number

* **.get_ir(port=PORT_GP4)** Returns the state of the IR sensor on the specified port.
    * **port**: _int_ port number
    * **returns**: _bool_ state of the sensor

* **.conveyor_belt(speed, direction=1, interface=0)** Sets the speed and direction of the conveyor belt.
    * **speed**: _float_ speed of the conveyor belt (range: 0.0 to 1.0)
    * **direction**: _int_ direction of the conveyor belt (1 for forward, -1 for backward)
    * **interface**: _int_ motor interface (default is 0)

* **.conveyor_belt_distance(speed_mm_per_sec, distance_mm, direction=1, interface=0)** Moves the conveyor belt at a specified speed for a specified distance.
    * **speed_mm_per_sec**: _float_ speed in millimeters per second (must be <= 100)
    * **distance_mm**: _float_ distance in millimeters
    * **direction**: _int_ direction of the conveyor belt (1 for forward, -1 for backward)
    * **interface**: _int_ motor interface (default is 0)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pydobotpp",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "api, automation, dobot, interface, python, robotic arm",
    "author": null,
    "author_email": "Kohio DEFLESSELLE <kohiodef@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/45/d0/5e3cc2b97c31575464cb8153aafe9a6e720f3e3ef10ff8c83f74638c6308/pydobotpp-0.1.5.tar.gz",
    "platform": null,
    "description": "# pydobotplusplus\n\nAn (even more) extended Python library for controlling the Dobot Magician.\n\n## Installation\n\nInstall the driver from [Silicon Labs](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers).\n\nRun:\n```sh\npip install pydobotplus\n```\n\n## Example\n\n```python\nfrom serial.tools import list_ports\nfrom pydobotplus import Dobot, CustomPosition\n\navailable_ports = list_ports.comports()\nprint(f'available ports: {[x.device for x in available_ports]}')\nport = available_ports[2].device\n\ndevice = Dobot(port=port)\n\n# Create a custom position\npos1 = CustomPosition(x=200, y=50, z=50)\n\n# Move using direct coordinates\ndevice.move_to(x=200, y=50, z=50)\n\n# Move using custom position\ndevice.move_to(position=pos1)\n\n# Control the conveyor belt\ndevice.conveyor_belt(speed=0.5, direction=1)\ndevice.conveyor_belt_distance(speed_mm_per_sec=50, distance_mm=200, direction=1)\n\ndevice.close()\n```\n\n## Methods\n\n* **Dobot(port, verbose=False)** Creates an instance of Dobot connected to the given serial port.\n    * **port**: _string_ with name of serial port to connect\n    * **verbose**: _bool_ will print to console all serial communications\n\n* **.get_pose()** Returns the current pose of the Dobot, as a `Pose` named tuple (position and joints).\n    * **position**: _Position_ with (x, y, z, r) coordinates\n    * **joints**: _Joints_ with (j1, j2, j3, j4) angles\n\n* **.move_to(x=None, y=None, z=None, r=0, wait=True, mode=None, position=None)** Queues a translation for the Dobot to the given coordinates or a `Position` object, keeps any unspecified parameters the same.\n    * **x**: _float_ x cartesian coordinate to move\n    * **y**: _float_ y cartesian coordinate to move\n    * **z**: _float_ z cartesian coordinate to move\n    * **r**: _float_ r effector rotation\n    * **wait**: _bool_ waits until the command has been executed before returning to the process - DO NOT TOUCH UNLESS YOU KNOW WHAT YOU ARE DOING\n    * **mode**: _MODE_PTP_ movement mode (default is `MODE_PTP.MOVJ_XYZ`) - DO NOT TOUCH UNLESS YOU KNOW WHAT YOU ARE DOING\n    * **position**: _Position_ object with (x, y, z, r) coordinates\n\n* **.move_rel(x=0, y=0, z=0, r=0, wait=True)** Moves the Dobot relative to its current position, keeps any unspecified parameters the same.\n    * **x**: _float_ relative x coordinate\n    * **y**: _float_ relative y coordinate\n    * **z**: _float_ relative z coordinate\n    * **r**: _float_ relative r rotation\n    * **wait**: _bool_ waits until the command has been executed before returning to the process\n\n* **.speed(velocity, acceleration)** Changes the velocity and acceleration at which the Dobot moves to future coordinates.\n    * **velocity**: _float_ desired translation velocity\n    * **acceleration**: _float_ desired translation acceleration\n\n* **.suck(enable)** Enables or disables suction.\n    * **enable**: _bool_ enables/disables suction\n\n* **.grip(enable)** Enables or disables the gripper.\n    * **enable**: _bool_ enables/disables gripper\n\n* **.get_alarms()** Returns a set of current alarms.\n    * **returns**: _set_ of `Alarm` enums\n\n* **.clear_alarms()** Clears all current alarms.\n\n* **.wait(ms)** Sends a wait command to the robot\n\n* **.get_device_serial_number()** Returns the robot's serial number\n\n*  **.set_device_name(name: str)** Sets the device's name (as one can do using DobotStudio)\n  \n*  **.get_device_name(name: str)** Get the device's name (as reported in DobotStudio)\n\n* **CustomPosition(x=None, y=None, z=None, r=None)** Initializes a custom position object.\n    * **x**: _float_ x coordinate\n    * **y**: _float_ y coordinate\n    * **z**: _float_ z coordinate\n    * **r**: _float_ effector rotation - NOT USED ON MAGICIAN\n\n* **MODE_PTP** Enum class for various PTP modes such as `JUMP_XYZ`, `MOVJ_XYZ`, `MOVL_XYZ`, etc. - DO NOT TOUCH UNLESS YOU KNOW WHAT YOU ARE DOING\n\n* **DobotException** Custom exception class for handling Dobot-related errors.\n\n* **.set_color_sensor(enable=True, version=1)** Enables or disables the color sensor.\n    * **enable**: _bool_ enables/disables the sensor\n    * **version**: _int_ sensor version\n\n* **.get_color()** Returns the RGB values detected by the color sensor.\n    * **returns**: _list_ with RGB values\n\n* **.set_ir(enable=True, port=PORT_GP4)** Enables or disables the IR sensor on the specified port.\n    * **enable**: _bool_ enables/disables the sensor\n    * **port**: _int_ port number\n\n* **.get_ir(port=PORT_GP4)** Returns the state of the IR sensor on the specified port.\n    * **port**: _int_ port number\n    * **returns**: _bool_ state of the sensor\n\n* **.conveyor_belt(speed, direction=1, interface=0)** Sets the speed and direction of the conveyor belt.\n    * **speed**: _float_ speed of the conveyor belt (range: 0.0 to 1.0)\n    * **direction**: _int_ direction of the conveyor belt (1 for forward, -1 for backward)\n    * **interface**: _int_ motor interface (default is 0)\n\n* **.conveyor_belt_distance(speed_mm_per_sec, distance_mm, direction=1, interface=0)** Moves the conveyor belt at a specified speed for a specified distance.\n    * **speed_mm_per_sec**: _float_ speed in millimeters per second (must be <= 100)\n    * **distance_mm**: _float_ distance in millimeters\n    * **direction**: _int_ direction of the conveyor belt (1 for forward, -1 for backward)\n    * **interface**: _int_ motor interface (default is 0)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "An extended cross-platform high-level API for the Dobot Magician robotic arm based on pydobotplus.",
    "version": "0.1.5",
    "project_urls": {
        "HomePage": "https://github.com/Soralsei/pydobotplusplus"
    },
    "split_keywords": [
        "api",
        " automation",
        " dobot",
        " interface",
        " python",
        " robotic arm"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b1d322aa715f5bb40b7768ea5809c166422c21c56802d82fbb7290a4794dbedc",
                "md5": "416249fa06e89d7730e68fd93cc59cf1",
                "sha256": "3a663b969e6aeb85a6be6f91880dcef94b8fc1db8ec87bf9ded6a037cc690414"
            },
            "downloads": -1,
            "filename": "pydobotpp-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "416249fa06e89d7730e68fd93cc59cf1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 10752,
            "upload_time": "2025-10-30T14:54:38",
            "upload_time_iso_8601": "2025-10-30T14:54:38.271702Z",
            "url": "https://files.pythonhosted.org/packages/b1/d3/22aa715f5bb40b7768ea5809c166422c21c56802d82fbb7290a4794dbedc/pydobotpp-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "45d05e3cc2b97c31575464cb8153aafe9a6e720f3e3ef10ff8c83f74638c6308",
                "md5": "881f067af5ce4622559cd3441ae17d07",
                "sha256": "d1ecf360aee17f0d9b6a6fed26c1dd1b9e2c37055c2644aa4e0b425bdc02515c"
            },
            "downloads": -1,
            "filename": "pydobotpp-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "881f067af5ce4622559cd3441ae17d07",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 11030,
            "upload_time": "2025-10-30T14:54:39",
            "upload_time_iso_8601": "2025-10-30T14:54:39.496015Z",
            "url": "https://files.pythonhosted.org/packages/45/d0/5e3cc2b97c31575464cb8153aafe9a6e720f3e3ef10ff8c83f74638c6308/pydobotpp-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-30 14:54:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Soralsei",
    "github_project": "pydobotplusplus",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pydobotpp"
}
        
Elapsed time: 2.49824s