Away 3D Robotic Arm

I’ve added effector orientation to the Away3D version of the Inverse Kinematics class and have created a demo that uses it. When playing with the demo please keep in mind the following:

  • If you are not specifying the solver account for orientation then there will always be a solution provided you have enough degrees of freedom and the target is within reach.
  • It becomes more difficult if you specify the solver to account for orientation. The solution set in this case shrinks dramatically and as such can take a long time to find a solution. In some cases there is not a solution but the solver will keep trying and you will get some wonky behavior.
  • Now that that’s out of the way. You can see the demo here:

    http://dynamicnetcreations.com/experiments/awayarm/

    I’ll commit the source to the IK branch of the Away3D project soon.

    Skip the rest of this post if you aren’t a math nerd.

    I had a hard time figuring out how to handle effector orientation. The information I could google was very good but none of the sources I found online had all the information I needed. So, I had to break out my calculus book and pull bits and pieces from those online sources I mentioned. I thought it would be nice to compile all of my notes into a single document and I have included it below.

    IK Theory Explanation

    Tags: , , ,

    Tuesday, May 12th, 2009 3D, Inverse Kinematics 356 Comments

    Download the IK Source Code

    I have committed the Away3D version of the IK source code along with the dragon demo I blogged on earlier to the Away3D repository in the ‘IK’ branch.  Feel free to check it out.  Sorry it took so long but I have been very busy with paid work and my regular job lately.

    http://away3d.googlecode.com/svn

    This is my first commit and as such is very basic.  Essentially, it’s just the math needed to solve the IK problem numerically without any sort of error checking or joint angle restrictions.  If you decide to play with it you will need to do a lot of tweaking in order to get your application to work correctly but it still has a lot of potential.  I will be doing one more demo (robotic arm) and then I will start adding ‘utility’ functions in order to make development of interactive IK applications easier and more robust.

    Wednesday, April 1st, 2009 Uncategorized 127 Comments

    Away3D Inverse Kinematics

    Inverse Kinematics Superimposed on Key-framed Animation

    Inverse Kinematics Superimposed on Key-framed Animation

    I was inspired to create some basic inverse kinematics functionality for the Away3D open source library when I had read that they had added collada bones functionality to their project. My first demo of inverse kinematics with the Away3D version can be seen here. The dragon’s head, neck and tail can be controlled interactively with inverse kinematics but the flying animation is key-framed. The inverse kinematics code for the head, neck and tail simply overrides the key-framed animations.

    I know a lot of you have been asking for the source to the robot arm demo that I did in PV3D but I would rather release the Away3D version because I’m going to continue to develop and debug it. I’ll see if I can provide the source to the dragon demo I did in Away soon.

    Tags: , , ,

    Thursday, February 26th, 2009 Uncategorized 174 Comments

    Inverse Kinematics: Robotic Arm

    Demo

    A lot of people have been asking me what inverse kinematics (IK) is. Well, nothing explains inverse kinematics better than a demo of a robotic arm. The robotic arm in this demo should write on the flat drawing surface whatever you scribble on your screen while holding the left mouse button. This demonstrates interactive IK by figuring out the arm’s joint angles for you. These angles need to be calculated constantly according to where on the drawing surface you point to with your mouse. To use the demo:

    1. Move the mouse to manipulate the camera.
    2. Hold the left mouse button and move the mouse to move the target for the ‘piece of chalk’ the robot arm is using along the x/y axis of the drawing surfaces.
    3. Key ‘1′ negates the planes z position (try holding down the mouse button and hitting ‘1′).
    4. Key ‘2′ erases the writing on the drawing surface.
    5. Key ‘3′ toggles the visibility of the robot arm’s target.

    I got the idea for this demo from this you tube video. I’m not using the same method the students in the video use (skip ahead to near the end of the video). Their method is more exact and converges to a solution more quickly than the one I’m using. I’m using the Jacobian Transpose method still for one simple reason…I can have any number of joints I choose and each of those joints can have one, two or three degrees of freedom without the need for writing a more robust matrix math class than is currently available for AS3.

    How my IK implementation differs from the one provided with Flash CS4 is another question I get a lot. It’s almost like comparing apples and oranges because the context is so different but let me try and answer that question:

    1. The advantage of Adobe’s IK package is that it comes with a nice little graphical interface and is more user friendly. My implementation is strictly in code and is not very user friendly. You’ll have to really understand the hierarchy of your 3D model to use my classes.
    2. Adobe’s classes are limited to a single degree of freedom and My IK classes can let you realize 3 degrees of freedom for your joints and are designed for use with 3D DAE models and Papervision 3D. However, it would be quite simple for me to adopt my classes to something like 2D movie clips.
    3. I don’t handle bones or mesh deformation. Papervision already let’s you import models with bones and does the mesh deformation for you. CS4 let’s you create bones fairly easily.
    4. My joints can have up to 3 degrees of freedom while Adobe’s only has one.

    *EDIT* I removed the source temporarily. I’m going to redo and release it again hopefully in a week or two.

    Tags: , , , , , , , , , ,

    Wednesday, November 26th, 2008 3D, Inverse Kinematics 82 Comments

    2.5D Ragdoll

    IK Demo

    IK Demo

     

    Since Halloween is coming up I thought I would incorporate a scary skeleton into my latest inverse kinematics demo. Special thanks to Trevor Burton for the model. I used the WOW Physics Engine and PV3D in conjunction with a numeric, multi-dimensional, non-linear, inverse kinematics solver I’m developing in my spare time to produce this demo. I’m calling it a 2.5D ragdoll instead of a full 3D ragdoll demo because after talking to the creator of the WOW physics engine I learned that I can’t create a full 3D ragdoll simulation until WOW implements certain features. I’m still happy enough with the result to release the demo however.

    In case you are interested in IK, here are some links I used to get started with it:

    http://billbaxter.com/courses/290/html/index.htm

    http://math.ucsd.edu/~sbuss/ResearchWeb/ikmethods/index.html

    Tags: , , , ,

    Thursday, October 23rd, 2008 3D, Inverse Kinematics 121 Comments

    Inverse Kinematics Numerically

    Inverse Kinematics Demo

    Inverse Kinematics Demo

    I recently became interested in Inverse Kinematics (IK). In case you don’t know what that is you can read about it here .  The best way to learn about something you find interesting is to do it and you can see the fruits of my labor here .  IK has been done in Flash before but I think this is the first time it has been done numerically (as opposed to analytically) and with a DAE model.

    It probably won’t seem very interesting or practical unless you’re a math junky or an animator respectively.  For the math people, I use the Jacobian transpose method and numerical approximation to track the target with the effector.  You can read about that here and here .  For the animators, once I managed to wrap my head around the math, it wasn’t difficult to make a simple application like this.  It might be possible to do something like interactive footsteps if I can get a hold of a robust matrix math class for AS3.

    Better demos are on the way.  This one was just to show that I have a handle on the math.

    Tags: , , , , , , , , ,

    Tuesday, September 23rd, 2008 3D, Inverse Kinematics 178 Comments

    New Site

    I finally realized that I won’t ever have the time to finish my flash site so I thought I would just go ahead and create a simple Word Press blog.  I’ll start posting my experiments and work as I have time.

    Tuesday, September 23rd, 2008 Uncategorized 153 Comments