Tuesday, November 14, 2017

FABRIK Inverse Kinematics in 3D with AL5D Arm

FABRIK with Caliko works great for inverse kinematics in 3D as well!  It took me a long time to determine the proper constraint on the first bone (a pan table) to rotate only.  Not sure if I did it the "correct way", but it works anyhow.

I cannot recommend trying the Caliko visualization with GLFW unless you are a GLFW expert.  I spent a long time trying to get it to compile on Eclipse and run without any success.  Lots of combinations of OpenGL and GFLW and Java that can go wrong.   Thus I gave up and used Caliko to output the arm positions in text for input into good old Python with matplotlib.

I'll note that I am modeling my AL5D arm without the wrist & gripper connection.  This is because for my use case of playing chess, I want the wrist to always point down, and I've added some tongs to the gripper to reach between the chess pieces to grab them from above without knocking down other chess pieces.  So I am only modeling the pan base and the first two hinged "bones" and looking at a target that is 140mm above the chess board.

Here are some results of the IK calculations with FABRIK via Caliko.  Note that even in the last case where the arm cannot reach the target, it at least "reaches out towards it", which is better than the algorithm crashing or returning NaN...






Here is the Caliko code:


And here is the Python plotting code:

Wednesday, November 08, 2017

Trying Caliko FABRIK Inverse Kinematics in 2D

I downloaded Caliko, the FABRIK inverse kinematic solver in Java.  It has great documentation, along with guidance about how to properly use its jars as libraries in Eclipse (I don't do much Java, glad they mentioned that).  The Javadocs for Caliko is excellent, so I took one of their examples, removed the visualization and added information about the location of bones in the chain and the angles between them:


Here is an example solution output:

Because I don't have a good OpenGL working right now, I just took the data from the chain and plotted it in Excel.  Here are some examples - the red dot is the target:



ikpy - Inverse Inematics, yes. Limits, no!

The Python inverse kinematics library, ikpy, works fine, and it has a cool mechanism to plot chain visualization from Python using matplotlib.pyplot.  EXCEPT ikpy seems to have no concept of collision areas or joint limits.

I found this out by putting in my Lynxmotion AL5D robot arm model as URDF, and loading into ikpy.   Works fine for a target at [17,3,3] (cm):


However if I have a target at [20,3,3], it drives the arm through the table (i.e. Z=0):

If you'd like to see the URDF and IK calculation code, it is here.

So I recommend ikpy for unconstrained 3D modeling, but lacks practicality for me!

So next step, I am going to try Caliko with its FABRIK IK solver in Java.

Sunday, November 05, 2017

Inverse Kinematics Take 2

The current inverse kinematics code I have for my Lynxmotion AL5D arm fails to converge towards the edges of the chess board.

One efficient way to solve IK is the FABRIK algorithm.

There is a Python inverse kinematics library, ikpy.  It needs a Unified Robot Description Format (URDF) file to describe the arm though.

Also there is a Java FABRIK:


Friday, November 03, 2017

New Affordable Bus Robotic Servos from LewanSoul

No idea as to the actual quality of these, but LewanSoul now has the LX-16A 17 kg·cm (236 oz·in) @7.4V robotic servo controlled over a bus (perhaps with the same command structure as a Dynamixel) with position/voltage/temperature feedback for only $15.99.




LewanSould also has what appears to be a fairly well-built, if not particularly long reach, 6DOF arm for $119.99 with servos (not the digital bus servos above, though).  This will definitely give the Lynxmotion Arms some serious competition.

Sunday, May 29, 2016

Web controlled robotic arm with Pi

A web controlled robotic arm based on the Raspberry Pi.

There is a daemon running in the background called web_arm.py, which sets up a FIFO (arm.fifo) to receive commands.  The cgi-bin is xy.py which receives x,y coordinates from a click on an image, then the cgi-bin sends the coordinates to the fifo.  web_arm performs inverse kinematics and drives the servo controller over the serial port, and the servos drive the arm.

Full code on GitHub.

Wednesday, January 20, 2016

Desktop GUI for AWS Ubuntu

This seemed harder to Google for than you'd think.

Imagine you want a desktop on Ubuntu Linux on an AWS EC2 instance, and you'd like to access it from OS X.  The sanest thing is to follow these instructions on installing kubuntu-desktop and tightvnc on the Ubuntu instance [with more info here], and the "Screen Sharing" app built into OS X.  Access the Ubuntu instance with "[ip address]:590[x]" where [x] is the X display number that tightvnc attaches to, generally 1 (so it would be "[ip address]:5901").  Don't forget to set up a security group to allow the VNC port(s).