{"id":19503916,"url":"https://github.com/TimSchneider42/dynamixel-api","last_synced_at":"2025-04-26T00:33:20.936Z","repository":{"id":77928351,"uuid":"431459653","full_name":"TimSchneider42/dynamixel-api","owner":"TimSchneider42","description":"Easy-to-use Python API for DYNAMIXEL motors and DYNAMIXEL-based grippers.","archived":false,"fork":false,"pushed_at":"2025-03-25T17:06:03.000Z","size":713,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T14:38:58.222Z","etag":null,"topics":["dynamixel","gripper","gripper-control","python","rhp12rn","rhp12rna","robotis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TimSchneider42.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-24T11:34:48.000Z","updated_at":"2025-03-25T17:06:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"704ddf73-b084-46de-bb85-5aa896d0a724","html_url":"https://github.com/TimSchneider42/dynamixel-api","commit_stats":null,"previous_names":["timschneider42/dynamixel-gripper-control","timschneider42/dynamixel-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimSchneider42%2Fdynamixel-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimSchneider42%2Fdynamixel-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimSchneider42%2Fdynamixel-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimSchneider42%2Fdynamixel-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimSchneider42","download_url":"https://codeload.github.com/TimSchneider42/dynamixel-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250917285,"owners_count":21507561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dynamixel","gripper","gripper-control","python","rhp12rn","rhp12rna","robotis"],"created_at":"2024-11-10T22:23:31.147Z","updated_at":"2025-04-26T00:33:20.928Z","avatar_url":"https://github.com/TimSchneider42.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dynamixel-api\n\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/TimSchneider42/dynamixel-api\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/TimSchneider42/dynamixel-api/master/docs/python_dynamixel_api_logo.png\" alt=\"dynamixel_api\" height=\"170\"\u003e\n  \u003c/a\u003e\n\n  \u003ch3 align=\"center\"\u003ePython API for Dynamixel Motors\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    Elevate your robotics projects with dynamixel-api -- a powerful and user-friendly Python wrapper for the Dynamixel SDK libary, designed to effortlessly control various Dynamixel motors.\n    \u003cbr /\u003e\n    \u003ca href=\"https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/\"\u003e\u003cstrong\u003eExplore Dynamixel SDK »\u003c/strong\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#introduction\"\u003eIntroduction\u003c/a\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003col\u003e\n        \u003cli\u003e\n          \u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\n        \u003c/li\u003e\n        \u003cli\u003e\n          \u003ca href=\"#hardware-setup\"\u003eHardware Setup\u003c/a\u003e\n        \u003c/li\u003e\n        \u003cli\u003e\n          \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\n        \u003c/li\u003e\n      \u003c/ol\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\n      \u003col\u003e\n        \u003cli\u003e\n            \u003ca href=\"#control-the-dynamixel-motor\"\u003eControl the Dynamixel Motor\u003c/a\u003e\n        \u003c/li\u003e\n        \u003cli\u003e\n            \u003ca href=\"#custom-motor-support\"\u003eCustom Motor Support\u003c/a\u003e\n        \u003c/li\u003e\n      \u003c/ol\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#contribution\"\u003eContribution\u003c/a\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n        \u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\n    \u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\n\u003c!-- INTRODUCTION --\u003e\n## Introduction\n`dynamixel-api` is a Python wrapper for the [Dynamixel SDK library](https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/), designed to control various Dynamixel motors. This library provides a high-level API that simplifies motor control through a `DynamixelConnector` class, which establishes and manages serial connections, and a `Motor` class that offers direct access to frequently used control parameters. Users can read and write motor control fields easily, enabling quick setup for common robotic manipulation tasks. The library's modular design can accommodate multiple types of Dynamixel motors, making it versatile for various robotics applications.\n\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\n\n### Prerequisites\nMake sure you have a working Python 3 installation. If not, follow the instructions on the \u003ca href=\"https://www.python.org/downloads/\"\u003ePython 3 download page\u003c/a\u003e.\n\n### Hardware Setup\nTo use the `dynamixel-api` library, you need to have a Dynamixel motor and the appropriate hardware to connect it to your computer. The motors are controlled via a \u003ca href=\"https://emanual.robotis.com/docs/en/parts/interface/u2d2_power_hub/\"\u003eU2D2 Power Hub Board\u003c/a\u003e, which connects to the motor with a 4-pin JST EH cable. The U2D2 Power Hub Board is connected to a computer via a USB cable, allowing the user to send commands to the motor using the Dynamixel SDK library.\n\n### Installation\nTo install the `dynamixel-api` library, simply run the following command:\n```sh\npip install dynamixel-api\n```\n\nor clone the repository and install the package locally:\n```sh\npip install git+https://github.com/TimSchneider42/dynamixel-api.git\n```\n\n## Usage\nThe `dynamixel-api` library provides out-of-the-box support for the following hardware:\n- [ROBOTIS RH-P12-RN and RH-P12-RN(A) Grippers](https://emanual.robotis.com/docs/en/platform/rh_p12_rn/): These are advanced robotic grippers powered by Dynamixel motors.\n- [DYNAMIXEL XL430-W250-T Motor](https://emanual.robotis.com/docs/en/dxl/x/xl430-w250/): The motor used to control the [actuated-UMI gripper](https://github.com/actuated-umi/actuated-umi-gripper).\n\n### Control the Dynamixel Motor\n\nFirst, create a `Connector` instance of your motor and call the `connect()` function to establish a serial connection to the motor. For example, to connect to an XL430-W250-T motor:\n\n```python\nfrom dynamixel_api import XL430W250TConnector\n\nconnector = XL430W250TConnector(device=\"/dev/ttyUSB0\", baud_rate=57600, dynamixel_id=1)\nconnector.connect()\n...\nconnector.disconnect()\n```\n\n`Connector` instances can also be used as context managers:\n\n```python\nwith XL430W250TConnector(device=\"/dev/ttyUSB0\", baud_rate=57600, dynamixel_id=1) as connector:\n    ...\n```\n\nThe `connector` object allows reading and writing of arbitrary addresses of the motor's control table:\n\n```python\nprint(connector.read_field(\"torque_enable\"))\nconnector.write_field(\"torque_enable\", 1)\nprint(connector.read_field(\"torque_enable\"))\n```\n\nFor a comprehensive list of its entries, refer to the [docs of your motor](https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/).\nAlternatively for this example, all entries are listed in [`dynamixel_api/models/xl430w250t.py`](dynamixel_api/models/xl430w250t.py).\nNote that the motors have to be disabled (`\"torque_enabled\"` has to be set to 0) for EEPROM values to be written, while RAM values can be written at any time.\n\nFor convenience, the `Motor` class provides direct access to the most commonly used fields:\n\n```python\nimport time\nfrom dynamixel_api import Motor\n\nmotor = Motor(connector)\nmotor.torque_enabled = True\nmotor.goal_position = 1.0\ntime.sleep(3.0)\nmotor.torque_enabled = False\n```\n\nFor a full example of the usage of this package, refer to [`example/xl430w250t_open_close.py`](example/xl430w250t_open_close.py).\n\n### Custom Motor Support\nTo use a custom motor, define its control table (EEPROM and RAM Fields) and implement a `Connector` class based on the motor's documentation. Refer to the [`dynamixel_api/models`](dynamixel_api/models) folder for examples and templates.\n\nAfter defining the `Connector` class, you can use the Motor class to control the motor as shown above. If you want to have additional control over the motor, you can create a child class of the `Motor` class and add custom methods.\n\n### Finding the correct baud rate and Dynamixel ID\nIf the baud rate and/or Dynamixel ID is unknown, the `find_grippers`(dynamixel_api/sweep.py) method can be used to find those parameters by performing a full sweep. It can be invoked as follows from the command line after installing the package:\n\n```sh\ndynamixel-sweep\n```\n\nYou can pass following arguments to the command:\n- `--device`: The device path to the serial port (default: /dev/ttyUSB0)\n- `--baud-rate`: The baud rate to use for the sweep (default: 9_600 57_600 115_200 1_000_000 2_000_000 3_000_000 4_000_000 4_500_000 10_500_000)\n\n\n\u003c!-- CONTRIBUTION --\u003e\n## Contribution\nWe welcome contributions to this repository. If you would like to contribute, please \u003ca href=\"https://github.com/TimSchneider42/dynamixel-api/fork\"\u003efork\u003c/a\u003e this repository and submit a \u003ca href=\"https://github.com/TimSchneider42/dynamixel-api/compare\"\u003epull request\u003c/a\u003e with your changes.\n\n\n\u003c!-- LICENDE --\u003e\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTimSchneider42%2Fdynamixel-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTimSchneider42%2Fdynamixel-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTimSchneider42%2Fdynamixel-api/lists"}