Repo for my directed study project, 2019-2020 academic year
- Publishing a Uint16 servo position to an Arduino (from this ROS wiki tutorial)
- rosserial_python page
- Creating custom messages and services in ROS tutorial page
- Arduino (Uno, Mega, or other comparable Arduino-based microcontroller)
- Arduino IDE
- USB to mini-USB cable
- PCA9685 PWM servo driver (Adafruit product link)
- 5 micro servos, 180 degree rotation (continous rotation servos will not work) (Adafruit product link)
- AC/DC 5v power adapter (Adafruit product link)
- Jumper wires
- Female DC Power adapter (2.1mm jack to screw terminal block) (Adafruit product link)
- 3D printer (to print the CAD parts of the hand)
- Hardware for assembly: at least 15 M2 16mm long bolts and nuts, string (roughly 2mm thick)
Note for Ubuntu users : Before doing any of this work, you must run sudo chmod a+rw /dev/ttyACM0
, which gives read/write access to the serial port to which the Arduino is connected. If there are issues, consult this Arduino forum.
The pointer, middle, ring, and pinky fingers are all constructed with one print each of fingertip.stl, fingermiddle.stl, and fingerbase.stl. The thumb is composed of just two segments, fingertip.stl and fingerbase.stl. The palm is made from one piece, palm.stl. If the fingers have difficulty printing in large batches, try printing at most 3 segments at once on the print bed.
- Clone or download this repo into your ROS workspace
- Run
catkin_make
in your workspace, and properly source it - Once that finishes, run
roscore
- Open the Arduino file
servocontrol.ino
in the Arduino IDE - Select your board under Tools > Board > your_board_here, and ensure it says "Arduino as ISP" under Tools > Programmer
- Connect the Arduino to the computer with a USB to mini-USB cable, and click "Upload" to compile and upload the code to the board
- While still in the catkin workspace directory, in a new terminal window run
rosrun rosserial_python serial_node.py _baud:=<your_baud_rate> _port:=/dev/ttyACM0
- Open
joint_publish_test.py
and ensure that the values the fingers are being set to are your desired values, being sure to save them. - When ready, ensure the Arduino is connected to the computer via USB, as well as to the servo driver (as shown here), and the driver is receiving power and is connected to all the servos.
- In a new terminal window, run
python /path/to/this/package/robothand/jointpublish/scripts/joint_publish_test.py
, and watch the hand move to your configuration! If the script does not run, it is possible it needs executable permissions, so typechmod +x joint_publish_test.py
into the terminal and try again. **NOTE: it is possible to send angles to the hand that your particular servos are not able to reach. Configure the code to match the limits of your servos.
**OTHER NOTE: the rosserial_python
node must be run with Python2.X (it will not work with Python3)
Library for controlling multiple servos (with servo driver board)
Installing the Arduino IDE on Ubuntu:
Wiring for the PC9685 servo driver board for Arduino
This work is licensed under a Creative Commons Attribution 4.0 International License.