|
Articulated Figure and Inverse Kinematics |
|||
|
Click here to download program. | |||
This application models articulated figures using inverse kinematics. The system allows users to interactively create an articulated figure, and move the figure to new positions. The system was written using C++ and the OpenGL libraries. The user interface was designed using FLTK and fluid. An articulated figure contains one base revolute joint, which may be positioned within the display window. The base joint is represented in red. New revolute joints may be added to the system, using the "New Joint" button in the user interface. Initially, joints are positioned in the center of the window and are not connected to the articulated figure. These unattached joints are represented in black. They may be moved to any position by left clicking on the joint, and dragging the joint with the mouse. To attach the joint to another joint in the articulated figure, right click on the joint, and drag the mouse to the desired joint. This will create a link. Once a link is created between two joints, the length of the link cannot change. End effectors are joints with no children joints, and they are represented in green. Other regular joints are blue. To move the articulated figure, only end effectors may be moved. This is done by left-clicking on an end effector and dragging the mouse to a new position. The figure will be updated as the mouse is dragged to a new position, using inverse kinematics. The base joint anchors the articulated figure and will not move. To allow more interesting figure manipulation, the base joint may be changed using the "Change Base" button. There are several data structures used for this system. First, there is an ArticulatedFigure. ArticulatedFigure is made up of a base joint, and a linked list of unattached joints. The next data structure is a Joint. A joint has a position (in world space), a parent joint, and a linked list of links to the children joints. This creates a tree of joints, starting with the base node, and ending with one or more end effector joints. A Link is made up of a base joint, an effector joint, the length of the joint, and the angle of the link from the parent link. With these data structures, it is possible to both traverse from the base of the tree to all the end effectors, as well as traverse from an end effector back to the base. Since an end effector is the only joint that may be moved directly, it is necessary to access parent joints from the end effector. Additionally, any change made to a parent joint will affect all descendant joints. Changing the base joint adjusts the tree to maintain the correct parent/child relationships. The algorithm used to calculate the new position of the articulated figure is the Cyclic-Coordinate Descent (CCD) method described in the lecture notes and in Chris Welman's masters thesis "Inverse Kinematics and Geometric Constraints for Articulated Figure Manipulation". |
|||