Skip to main content

Dynamixel SDK Python Wrapper

Project description


Simple python wrapper over the Dynamixel API. Allows commanding and receiving positions for an arbitrary number of servos.


Create a config dictionary with one entry per servo:

    'test_servo': {
        'id': 1,  # Servo ID
        'model': 'mx',  # Servo model tag, one of 'MX' or 'PRO'
        'min': 0, # Minimum position (MX servos go from 0 to 4095)
        'max': 4095, # Maximum position

Create the servo object using your config dictionary.

from dxl.servos import Servos
my_servos = Servos(config = MY_SERVOS_CONFIG, action_bounds = [-1.0, 1.0])

Set the servo position. The action_bounds kwarg determines how actions relate to positions. An action of 1.0 here sets the position of the servo to 4095.

my_servos.set({'test_servo' : 1.0, ...})

Get the servo position.

my_servos.get(['test_servo', ...])


Clone the DynamixelAPI repo into the desired directory. Install into your desired python environment (consider using Anaconda).

$ git clone .
$ cd DynamixelSDK/python/
$ pip install -e .

The wrapper can be installed as a pip package:

pip install dxl_py

This repo uses MX-28 model dynamixel servos connected via USB through a U2D2. After connecting the device, check it exists (the name might be different from the one below):

$ ls /dev/ttyUSB*

Now configure and add a custom udev rule using the script. You might need to reboot.

$ sudo ./

If we check the devices again we should now see the dynamixel device.

$ ls /dev/dynamixel

Connect a servo with id=1 and run the test with python -m unittest.

Project details

Release history Release notifications | RSS feed

This version


Download files

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

Source Distribution

dxl_py-0.1.tar.gz (4.7 kB view hashes)

Uploaded source

Built Distribution

dxl_py-0.1-py3-none-any.whl (10.0 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page