The simplest way to understand how to use it (as a user rather than a programmer) will be to run the following command:
python arm_1.py --helpwhich will bring up something like:
Python program for connecting to USB Robotic ArmSo e.g. python arm_1.py -g 1 -w 2 will close the gripper and move the wrist down simultaneously for 0.1 seconds. Whilst python arm_1.py -r 2 -l 1 -t 3 will rotate the arm in the base counter clockwise and turn the light on for 3 seconds.
Usage: arm_1.py [options]
Options:
-h, --help show this help message and exit
-s SHOULDER, --shoulder=SHOULDER
Value 0,1,2 for shoulder motor (off/up/down)
-e ELBOW, --elbow=ELBOW
Value 0,1,2 for elbow motor (off/up/down)
-w WRIST, --wrist=WRIST
Value 0,1,2 for wrist motor (off/up/down)
-g GRIP, --grip=GRIP Value 0,1,2 for grip (off/in/out)
-r ROTATE, --rotate=ROTATE
Value 0,1,2 for rotation (off/cw/ccw)
-l LIGHT, --light=LIGHT
Value 0,1 for light (on/off)
-t TIMEDELAY, --time=TIMEDELAY
Time (s) to wait before off default0.1
NOTE Depending on how you have your user privilidges set up you may not have access to the USB port - I need to run all these commands as root, e.g. sudo python arm_1...
Hi!
ReplyDeleteI cannot import usb.core....were can I check for errors?
(when I start the script the error is :"ImportError: No module named core")
Stefano,
ReplyDeleteusb.core is part of the PyUSB module - which you can download here: http://sourceforge.net/projects/pyusb/
You unzip the contents, and run:
python setup.py install
in the directory where you unzipped it. Let me know if it works... ...or feel free to post more info about what you have done / what you have set up etc. Can't promise to fix it - but I'll try.
Thank You Poly,
ReplyDeletethe problem is the ubuntu pyusb package...it doesn't work!
The latest version on sourceforge work well.
Stefano, glas its sorted. It looks like ubuntu is still using v.0 (http://packages.ubuntu.com/source/hardy/pyusb) so I'll try to work out how to "force" an upgrade when I get onto bundling this up in a package.
ReplyDelete