PDA

View Full Version : Python version of Forest Moon Dynamixel Library now available



Pi Robot
08-11-2010, 01:23 PM
Folks,

When moving from C# to Python, I wanted to bring along the Forest Moon Dynamixel library by Scott Ferguson, but I did not want to use IronPython. So I had someone convert the C# code to "pure Python" so that the library will work under both Windows and Linux using regular Python 2.6.

With Scott's permission, I have placed the library up on Google code in case you have a use for it. But please do not contact Scott if you have troubles with the Python version. Here are the instructions for installing the library:

1. Unzip the archive to a location outside of your Python installation.
2. Bring up a command prompt and cd into the dynamixel-installer directory.
3. Run the command "python setup.py install"
4. You can now use the library by doing an "import dynamixel".
5. For an example of how to use it, see the two sample files example.py and example2.py in
the dynamixel-installer directory.

And here is the link to the download:

http://code.google.com/p/pydynamixel/downloads/list

Let me know if you run into any trouble.

--patrick

lnxfergy
08-11-2010, 01:54 PM
Just a note -- you might want to check a version of the code into the SVN repository offered by google code -- so that people can browse the code online without having to download it.

-Mike

Pi Robot
08-11-2010, 04:14 PM
Just a note -- you might want to check a version of the code into the SVN repository offered by google code -- so that people can browse the code online without having to download it.

-Mike

Good idea and...done! BTW, when you have absolutely nothing better to do (which may be never), and if you are so inclined, it would be great to get two pieces of feedback from you on this library:

1. Can you find the right place (or places) in the code to place thread locks like you have with your arbotiX Execute function?

2. If you get time to actually give the library a try with some live servos attached, I'd like to know if you run into any TIMEOUT errors. These have been plaguing me ever since I started using AX-12s on a USB2Dynamixel and I'm fairly sure its hardware (such as the cabling issue we discussed a couple of weeks ago). But it would be interesting to hear if others run into similar problems. In the file dynamixel_network.py beginning on line 343, I added a try-except block to catch these timeouts and print out the ID of the dynamixel it occurs on. Nine times out of ten on my robot, the timeout occurs on the same servo, but not always.

--patrick