620 likes | 1.15k Views
Forward and Inverse Kinematics. CSE 3541 Matt Boggus. Hierarchical Modeling. Parent-child relationship. Relative motion. Simplifies motion specification. Constrains motion. Reduces dimensionality. Modeling & animating hierarchies. 3 aspects Linkages & Joints – the relationships
E N D
Forward and Inverse Kinematics CSE 3541 Matt Boggus
Hierarchical Modeling Parent-child relationship Relative motion Simplifies motion specification Constrains motion Reduces dimensionality
Modeling & animating hierarchies • 3 aspects • Linkages & Joints – the relationships • Data structure – how to represent such a hierarchy • Converting local coordinate frames into global space
Terms Joint – allowed relative motion & parameters Joint Limits – limit on valid joint angle values Link – object involved in relative motion Linkage – entire joint-link hierarchy End effector – most distant link in linkage Pose– configuration of linkage using given set of joint angles
Forward vs. Inverse Kinematics Forward Kinematics Input: joint angles Output: link positions and orientations end effector position Inverse Kinematics Input: end effector Output: joint angles
Joints – relative movement • Every joint allowing motion in one dimension is said to have one degree of freedom (DOF) • Example: flying (Six DOF) • x, y, and z positions (prismatic or translation) • roll, pitch, and yaw (revolute or rotation)
Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate transformation • The body local coordinate system of the end-effector was initially coincide with the global coordinate system • Forward kinematics map transforms the position and orientation of the end-effector according to joint angles Example from Jehee Lee
Thinking of Transformations • In a view of body-attached coordinate system
Thinking of Transformations • In a view of body-attached coordinate system
Thinking of Transformations • In a view of body-attached coordinate system
Thinking of Transformations • In a view of body-attached coordinate system
Thinking of Transformations • In a view of body-attached coordinate system
Thinking of Transformations • In a view of global coordinate system
Thinking of Transformations • In a view of global coordinate system
Thinking of Transformations • In a view of global coordinate system
Thinking of Transformations • In a view of global coordinate system
Thinking of Transformations • In a view of global coordinate system
Controlling forward kinematics • QWOP http://www.foddy.net/Athletics.html
IK solution uniqueness Zero One Two Many Images from http://freespace.virgin.net/hugo.elias/models/m_ik.htm
Inverse kinematics Given goal position for end effector Compute internal joint angles Simple linkages analytic solution Otherwise numeric iterative solution
Inverse kinematics – spaces Configuration space Reachable workspace
Analytic Inverse Kinematics • Given target position (X,Y) • Compute angle with respect to origin of linkage • Solve for angle of rotation for each joint • See reference text for solution and derivation
IK - numeric Solve iteratively – numerically solve for step toward goal Remember: a pose is the position and orientation of all links for given a set of joint angles - Compute the desired change from this pose Vector to the goal, or Minimal distance between end effector and goal - Compute set of changes to joint angles to make that change
IK math notation Given the values for each xi, we can compute each yi
IK – chain rule The change in output variables (y) relative to the change in input variables (x)
Inverse Kinematics - Jacobian Desired motion of end effector Unknown change in articulation variables The Jacobian is the matrix relating the two: describing how each coordinate changes with respect to each joint angle in our system
Inverse Kinematics - Jacobian Change in articulation variables Change in position Change in orientation Jacobian
Solving If J square, compute inverse, J-1 If J is not square, use of pseudo-inverse of Jacobian
IK – compute positional change vectors induced by changes in joint angles Instantaneous positional change vectors Desired change vector One approach to IK computes linear combination of change vectors that equal desired vector
IK - singularity Some singular configurations are not so easily recognizable
Inverse Kinematics - Numeric • Given • Current configuration • Goal position • Determine • Goal vector • Positions & local coordinate systems of interior joints (in global coordinates) Solve for change in joint angles & take small step – or clamp acceleration or clamp velocity • Repeat until: • Within epsilon of goal • Stuck in some configuration • Taking too long
IK – cyclic coordinate descent Heuristic solution Consider one joint at a time, from outside in At each joint, choose update that best gets end effector to goal position In 2D – pretty simple Goal axisi Ji EndEffector
Cyclic-Coordinate Descent - Starting with the root of our effector, R, to our current endpoint, E. - Next, we draw a vector from R to our desired endpoint, D - The inverse cosine of the dot product gives us the angle between the vectors: cos(a) = RD ● RE
Cyclic-Coordinate Descent Rotate our link so that RE falls on RD
Cyclic-Coordinate Descent Move one link up the chain, and repeat the process
Cyclic-Coordinate Descent The process is basically repeated until the root joint is reached. Then the process begins all over again starting with the end effector, and will continue until we are close enough to D for an acceptable solution.
Cyclic-Coordinate Descent We’ve reached the root. Repeat the process
Cyclic-Coordinate Descent We’ve reached the root again. Repeat the process until solution reached.
IK – cyclic coordinate descent Other orderings of processing joints are possible • Because of its procedural nature • Lends itself to enforcing joint limits • Easy to clamp angular velocity
IK – 3D cyclic coordinate descent Goal Projected goal axisi Ji EndEffector First – goal has to be projected onto plane defined by axis (normal to plane) and EF Second– determine angle at joint