{"id":15070067,"url":"https://github.com/multipedrobotics/pyservos","last_synced_at":"2025-10-08T18:07:27.909Z","repository":{"id":53548014,"uuid":"121900021","full_name":"MultipedRobotics/pyservos","owner":"MultipedRobotics","description":"Python servo library for AX-12 and XL-320 smart servos","archived":false,"fork":false,"pushed_at":"2021-03-25T01:04:36.000Z","size":54851,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T14:51:20.614Z","etag":null,"topics":["ax-12a","pip","python2","python3","servo","xl-320"],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/pyservos","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/MultipedRobotics.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-17T23:02:25.000Z","updated_at":"2021-03-25T01:04:41.000Z","dependencies_parsed_at":"2022-08-31T16:50:15.397Z","dependency_job_id":null,"html_url":"https://github.com/MultipedRobotics/pyservos","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MultipedRobotics%2Fpyservos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MultipedRobotics%2Fpyservos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MultipedRobotics%2Fpyservos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MultipedRobotics%2Fpyservos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MultipedRobotics","download_url":"https://codeload.github.com/MultipedRobotics/pyservos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248261403,"owners_count":21074222,"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":["ax-12a","pip","python2","python3","servo","xl-320"],"created_at":"2024-09-25T01:46:50.525Z","updated_at":"2025-10-08T18:07:22.861Z","avatar_url":"https://github.com/MultipedRobotics.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://raw.githubusercontent.com/MultipedRobotics/pyservos/master/pics/dynamixel.jpg)\n\n[![CheckPackage](https://github.com/MultipedRobotics/pyservos/workflows/CheckPackage/badge.svg)](https://github.com/MultipedRobotics/pyservos/actions)\n![GitHub](https://img.shields.io/github/license/multipedrobotics/pyservos)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyservos)\n![PyPI](https://img.shields.io/pypi/v/pyservos)\n\n# pyServos\n\n**Still under development**\n**Starting to add XL-430 servo**\n\n- pyservos\n    - **ServoSerial** - half duplex hardware serial interface using DTR from a USB serial port\n    - **PiServoSerial** - half duplex hardware serial interface using a HW pin\n    - **utils** - misc\n    - **XL320** - register/command/error definitions for Dynamixel's XL-320 servo\n    - **AX12** - register/command/error definitions for Dynamixel's AX-12A servo\n    - **XL430** - register/command/error definitions for Dynamixel's AX-12A servo\n\n# Setup\n\n## Install\n\nThe suggested way to install this is via the `pip` command as follows::\n\n    pip install pyservos\n\n## Development\n\nI am currently using [poetry](https://python-poetry.org/) for my library and using\n`pyproject.toml`. To submit git pulls, clone the repository and set it up as\nfollows:\n\n    git clone https://github.com/MultipedRobotics/pyservos\n    cd pyservos\n    poetry install\n    poety run pytest\n\n# Usage\n\nThe `\\bin` directory has a number of useful programs to set servo position or ID number. Just\nrun the command with the `--help` flag to see how to use it.\n\n- `servoAX12`\n- `servoXL320` (not implemented)\n- `servoXL430` (not implemented)\n\nThe above commands have the following format:\n\n - servoXXX\n    - **ping**: find servos on bus, ID[int|**None**]\n    - **reboot**: reboot a servo, ID[int|**None**]\n    - **reset**: reset a servo, ID[int], level[int]\n    - **angle**: set new angle in degrees or radians, angle[float], radians[True|**False**]\n    - **baudrate**: set new baudrate, rate[int]\n    - **id**: set new ID, current_id[int], new_id[int]\n- Values\n    - ID: 1-254\n    - reset level: 1 (all), 2(all but ID), 3 (all but ID and baudrate)\n    - angle: 0-300 degrees\n    - rate: 1000000 is default\n    - None: if you leave out the value, there is a default that occurs which is safe\n\n# Documentation\n\n- [AX-12A Servo](https://github.com/MomsFriendlyRobotCompany/pyservos/tree/master/docs/ax12)\n- [XL-320 Servo](https://github.com/MomsFriendlyRobotCompany/pyservos/tree/master/docs/xl320)\n- [XL-430 Servo](https://github.com/MomsFriendlyRobotCompany/pyservos/tree/master/docs/xl430)\n\nA simple example to turn the servo and turn the LED on using a USB serial converter:\n\n```python\n# Run an AX-12 servo\nfrom pyservos.servo_serial import ServoSerial\nfrom pyservos.ax12 import AX12\n\nserial = ServoSerial('/dev/tty.usbserial')  # tell it what port you want to use\n# serial = ServoSerial('dummy')  # use a dummy serial interface for testing\nserial.open()\n\nax = AX12()\npkt = ax.makeServoPacket(1, 158.6)  # move servo 1 to 158.6 degrees\nret = serial.sendPkt(pkt)  # send packet, I don't do anything with the returned status packet\n\npkt = ax.makeLEDPacket(1, AX12.LED_ON)\nret = serial.sendPkt(pkt)\n```\n\nAlthough I have made some packet creators (like LED and Servo), you can make\nyour own using the basic `makeWritePacket` and `makeReadPacket`.\n\n```python\n# Run an XL-320 servo\nfrom pyservos.xl320 import XL320\nfrom pyservos.utils import angle2int\n\nxl = XL320()\n\n# let's make our own servo packet that sends servo 3 to 220.1 degrees\nID = 3\nreg = XL320.GOAL_POSITION\nparams = angle2int(220.1)  # convert 220.1 degrees to an int between 0-1023\npkt = xl.makeWritePacket(ID, reg, params)\n```\n\n## Dynaixel Servos\n\n![](pics/dynamixel-chart.jpg)\n\n![](pics/dynamixel-connectors.jpg)\n\n## Robot Examples\n\nHere are some example [robots](https://github.com/MultipedRobotics/pyservos/tree/master/docs/robots)\n\n# Other Software\n\nI haven't used these, but they seem good:\n\n- c++: [libdynamixel](https://github.com/resibots/libdynamixel)\n\n# Change Log\n\n| | | |\n|------------|-------|--------------------------------------------|\n| 2020-01-25 | 2.0.0 | re-architected around protocols rather than servos types |\n| 2018-04-30 | 1.0.1 |  API fixes and starting to add 430 support |\n| 2018-02-17 | 1.0.0 |  added AX-12 support and renamed the library |\n| 2017-04-01 | 0.9.0 |  added python3 support |\n| 2017-03-26 | 0.8.0 |  major overhaul and removed the GPIO stuff |\n| 2017-03-19 | 0.7.7 |  can switch between GPIO pin and pyserial.setRTS() |\n| 2017-02-20 | 0.7.6 |  small fixes and added servo_reboot |\n| 2017-01-16 | 0.7.5 |  fixes some small errors |\n| 2016-11-29 | 0.7.4 |  add bulk write and small changes |\n| 2016-10-11 | 0.7.1 |  small changes/updates |\n| 2016-09-12 | 0.7.0 |  refactoring, still working on API |\n| 2016-09-05 | 0.5.0 |  published to PyPi |\n| 2016-08-16 | 0.0.1 |  init |\n\n# The MIT License (MIT)\n\nCopyright (c) 2016 Kevin J. Walchko\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultipedrobotics%2Fpyservos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultipedrobotics%2Fpyservos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultipedrobotics%2Fpyservos/lists"}