Robotic Arm with Arduino driver controlled by Leap Motion
This project was created to learn about the basics of how to control a simple robot arm. The arm itself is a AL5A kit driven by an Arduino compatible board. A Leap Motion is used as one of the inputs. The sliders directly control each servo and also visualize in real-time the output of the Inverse Kinematic function. The 2D slider also can be used to send the desired arm position directly to the IK function.
Processing (processing.org) is used for the GUI. I created the code step by step with a lot of googling along the way. First I created a simple mechanism to control each servo using a slider. Then I spent a long while trying to figure out Inverse Kinematics. I settled on a very simple function that does the job in this case. It auto-calculates the shoulder, elbow and wrist angles.
The Leap Motion controller was very easy to integrate thanks to the Processing library (mentioned in the code).
The Processing app sends servo data to the Arduino compatible board in a very simple format: <servo_number,servo_angle>. For example sending the command "0,90" make servo 0 (the base) turn to the center position.
One trick that I am proud of is using the built-in easing functions of the sliders. Without any additional programming the slider objects smooth out any jerkiness. The result is pretty cool.
Although I haven't tried the software on anything besides a MAC, it should run on Windows and Linux.
The code for the Arduino board and Processing can be downloaded here:
https://github.com/bborncr/AL5A_CONTROL
https://github.com/bborncr/AL5A_Driver