This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

PyAX-12

Copyright (c) 2010,2015 Jeremie DECOCK (http://www.jdhp.org)

In collaboration with http://www.vorobotics.com

Description

PyAX-12 is an open source lightweight Python library to control Dynamixel AX-12+ actuators.

Note:

This project is still in beta stage, so the API is not finalized yet.

Dependencies

PyAX-12 is tested to work with Python 3.4 under Gnu/Linux Debian 8 and Windows 7. It should also work with Python 3.X under recent Gnu/Linux and Windows systems. It hasn’t been tested (yet) on MacOSX and BSD systems.

Python-serial is required to install PyAX-12.

Note:

If you use pip to install PyAX-12, Python-serial will be automatically downloaded and installed (see the following install section).

Installation

Gnu/Linux

You can install, upgrade, uninstall PyAX-12 with these commands (in a terminal):

pip install --pre pyax12
pip install --upgrade pyax12
pip uninstall pyax12

Or, if you have downloaded the PyAX-12 source code:

python3 setup.py install

Windows

Note:

The following installation procedure has been tested to work with Python 3.4 under Windows 7. It should also work with recent Windows systems.

You can install, upgrade, uninstall PyAX-12 with these commands (in a command prompt):

py -m pip install --pre pyax12
py -m pip install --upgrade pyax12
py -m pip uninstall pyax12

Or, if you have downloaded the PyAX-12 source code:

py setup.py install

MacOSX

Note:

The following installation procedure has been tested to work with Python 3.4 under MacOSX 10.6 (Snow Leopard). It should also work with recent MacOSX systems.

You can install, upgrade, uninstall PyAX-12 with these commands (in a terminal):

pip install --pre pyax12
pip install --upgrade pyax12
pip uninstall pyax12

Or, if you have downloaded the PyAX-12 source code:

python3 setup.py install

Documentation

Example usage

In the following examples, the dynamixel_id, port and baudrate values should be adapted depending on your configuration:

  • for Linux users:
    • the port value should be something like
      • “/dev/ttyS0”, “/dev/ttyS1”, … if you use an actual serial port
      • “/dev/ttyUSB0”, “/dev/ttyUSB1”, … if you use an USB to serial adapter (like the USB2Dynamixel adapter)
    • the baudrate value should be the same than the one configured in Dynamixel units
  • for Windows users:
    • the port value should be something like “COM2”, “COM3”, … (see the COM port configuration in the Windows device manager)
    • the baudrate value should be the same than the one configured in the Dynamixel units and the Windows device manager (i.e. check the COM port configuration in the Windows device manager)
  • for MacOSX users:
    • the port value should be something like “/dev/tty.usbserial-XXX” if you use an USB to serial adapter like the USB2Dynamixel adapter
    • the baudrate value should be the same than the one configured in Dynamixel units

If you use the USB2Dynamixel device, make sure its switch is set on “TTL”.

Some other examples are available in the examples directory.

Ping a Dynamixel

This snippet prints True if the specified Dynamixel unit is connected and available at the given baudrate; otherwise it prints False.

from pyax12.connection import Connection

# Connect to the serial port
serial_connection = Connection(port="/dev/ttyUSB0", baudrate=57600)

dynamixel_id = 3

# Ping the third dynamixel unit
is_available = serial_connection.ping(dynamixel_id)

print(is_available)

# Close the serial connection
serial_connection.close()

Scan (search available Dynamixel units)

This snippet prints the ID list of connected and available Dynamixel units (at the given baudrate).

from pyax12.connection import Connection

# Connect to the serial port
serial_connection = Connection(port="/dev/ttyUSB0", baudrate=57600)

# Ping the dynamixel unit(s)
ids_available = serial_connection.scan()

for dynamixel_id in ids_available:
    print(dynamixel_id)

# Close the serial connection
serial_connection.close()

Move the first Dynamixel unit to various position angles

This snippet moves the first Dynamixel unit to 0°, then -45°, -90°, -135°, -150° (the maximum CW angle), +150° (the maximum CCW angle), +135°, +90°, +45° and finally goes back to 0°.

from pyax12.connection import Connection
import time

# Connect to the serial port
serial_connection = Connection(port="/dev/ttyUSB0", baudrate=57600)

dynamixel_id = 1

# Go to 0°
serial_connection.goto(dynamixel_id, 0, speed=512, degrees=True)
time.sleep(1)    # Wait 1 second

# Go to -45° (45° CW)
serial_connection.goto(dynamixel_id, -45, speed=512, degrees=True)
time.sleep(1)    # Wait 1 second

# Go to -90° (90° CW)
serial_connection.goto(dynamixel_id, -90, speed=512, degrees=True)
time.sleep(1)    # Wait 1 second

# Go to -135° (135° CW)
serial_connection.goto(dynamixel_id, -135, speed=512, degrees=True)
time.sleep(1)    # Wait 1 second

# Go to -150° (150° CW)
serial_connection.goto(dynamixel_id, -150, speed=512, degrees=True)
time.sleep(1)    # Wait 1 second

# Go to +150° (150° CCW)
serial_connection.goto(dynamixel_id, 150, speed=512, degrees=True)
time.sleep(2)    # Wait 2 seconds

# Go to +135° (135° CCW)
serial_connection.goto(dynamixel_id, 135, speed=512, degrees=True)
time.sleep(1)    # Wait 1 second

# Go to +90° (90° CCW)
serial_connection.goto(dynamixel_id, 90, speed=512, degrees=True)
time.sleep(1)    # Wait 1 second

# Go to +45° (45° CCW)
serial_connection.goto(dynamixel_id, 45, speed=512, degrees=True)
time.sleep(1)    # Wait 1 second

# Go back to 0°
serial_connection.goto(dynamixel_id, 0, speed=512, degrees=True)

# Close the serial connection
serial_connection.close()

Bug reports

To search for bugs or report them, please use the PyAX-12 Bug Tracker at:

https://github.com/jeremiedecock/pyax12/issues

Related libraries

Other libraries to control Dynamixel AX-12+ actuators are referenced in the following (non comprehensive) list:

License

The PyAX-12 library is provided under the terms and conditions of the MIT License.

Release History

Release History

0.4.dev6

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4.dev5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4.dev4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4.dev3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4.dev2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4.dev1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4.dev0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.dev0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pyax12-0.4.dev6.tar.gz (45.9 kB) Copy SHA256 Checksum SHA256 Source Sep 4, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting