Inverse Kinematics Optimizations By Fixing the Joint Order

Embarrassingly enough, the code we use to position the robots limbs hasn’t been updated since we’ve actually had robots (which is more than a year), and thus still has two of the hip joints out of order in the kinematic chain ‘model’. When we got the physical robots, we just switched the order of the joints as they were generated by the inverse kinematics system and were done with it. (The rotations of the two joints are centered at the same point, so it doesn’t matter for small angles like during walking) Partly as an exercise, and partly to fix this longstanding inconsistency I just spent some time slogging through the old Mathematica notebooks and corrected the bug. What I wasn’t expecting was to see a speedup of almost 3 times with the new joint order! A series of 10000 calls to inverse kinematics(IK) on several different targets, using both legs took .30 seconds using the old kinematic models, and only .12 seconds with the new models (on my dev. machine). Even with the slow older models, IK took only a very small fraction of our runtime, so this unfortunately won’t result in a huge boost to our frame rate on the robots, but nonetheless its still pretty neat. See after the break for my explanation.

The only reason I can see for the speed improvement is that with the new joint order three physically consecutive joints act in the same plane: hip pitch, knee pitch and ankle pitch, thereby removing some of the complexity of the solution. Even more bizarre was that using Mathematica’s //Simplify on the result did not make a significant difference in the runtime of IK (in fact, it seemed to slow it down).

Now that I’ve spent some more time familiarizing myself with Mathematica, etc again, I’m hoping to implement some sort of center of mass control using the same damped least squares method we currently use for Inverse Kinematics. (The current IK method the walking engine uses to get the joint angles for the legs from the target x,y,z trajectories for the legs doesn’t take into account that the Center of Mass is not always concentrated at the belly button of the robot.)

Oh, and by the way, I found this introduction/review of inverse kinematics pretty helpful as a reference during the rework:
Robot Dynamics and Control

Leave a Reply