Inverse dynamics Ik learning

Reference article: (not original by me)

Original English text: Inverse Kinematics Techniques in Computer Graphics: A Survey (andreasaristidou.com)

Zhihu translated article:

[Game Development] Detailed explanation of inverse kinematics (IK) - Zhihu (zhihu.com)

concept

Forward kinematics (FK) : Use robot kinematic equations to calculate the position of the end effector based on the specific parameters of the joint. Forward kinematics requires the user to set parameters for all joints involved.

Inverse kinematics (IK) : The process is opposite to FK. The robot kinematics equations are used to determine the joint parameters of the manipulator to move the end effector to the desired position. End effectors can be joints (such as hands and feet) or internal joints (such as elbows and knees), and are not necessarily located at the ends. IK first appeared in robotics technology and is now used in many fields, such as engineering, computer graphics, video games, and CG animation.

Regarding the end effector: the position of the robot arm grabbing the end effector, the position of the character's hand when opening the door, and the position of the character's feet when walking, these can be called end effectors.

IK problem analysis

IK may have one solution, multiple solutions, or no solution.

There are two important steps in solving IK problems:

  • 1: Analyze whether the target is reachable or unreachable. It is important to check whether the target is within reach, because you can save a lot of processing time by avoiding looking for a non-existent solution. The target space that the end effector can reach is called the reachable workspace.
  • Two: When a solution exists and the solution is not reached, a termination condition needs to be added to avoid entering an infinite loop during the iteration process. For example: limiting the number of iterations and terminating the calculation of IK solvers when the position difference of the end effector between the previous iteration and the current iteration is less than the specified tolerance.

For IK to work best, it's best to start with the skeleton posed close to the target. This helps the algorithm focus on the closest solution and complete the calculation in a reasonable time. The number of available solutions depends on the target position or the degrees of freedom of the kinematic chain. The IK problem where the target is unreachable is called an over-constraint problem . When the goal is reachable, multiple solutions may exist for two or more chains. This makes the IK problem unconstrained (or redundant) - it may have an infinite number of solutions to meet the desired goal.

IK solving algorithm

IK solvers are mainly divided into four major categories, namely analytical methods (the Analytic family), numerical methods (the Numerical family), data-driven methods (Data-driven methods) and hybrid methods (the Hybrid family of solvers).

For a detailed explanation of each method, see the original text~

Analysis method application TwoBoneIK

TwoBoneIK, as its name suggests, is two bones (excluding root bones). It is easy to use and has many applications, such as: UE4.26's SolveBasicTwoBoneIK, FAnimNode_TwoBoneIK, and Advanced Locomotion System V4 plug-ins.

Since three points determine a plane, a control point (that is, the PoleVector polar coordinate point in UE4) needs to be added to solve the rotation angle in the three-dimensional space.

Unreal Engine's TwoboneIK experience - Joint Target - Zhihu (zhihu.com)

About the settings of polar vector↑

Joint Target

Introduction

FK calculates the position of each sub-skeleton through joint rotation and length, while IK calculates the position of the intermediate joint through a target position and the root node position. IK is also an important part of programmed animation. With it, the position calculated by the program can be deduced from the transformation of the bone chain.

Calculating FK is very simple, just use matrix multiplication from the parent bone.

But the calculation of IK is not that simple. Even the simplest TwoboneIK requires the introduction of a polar coordinate variable to locate the plane where the Joint bone is located, let alone the more complex multi-bone IK.

Twobone IK

The principle of TwoboneIK is actually to use the cosine law to solve the angle, and then calculate the position of the Joint.

basic terminology

  • Root Bone, the root bone, is called Hip during leg IK.
  • Joint Bone, how do you translate this in Chinese? It’s the middle bone anyway? The leg IK is called knee.
  • End Bone, the end bone, is called heel or foot during leg IK.
  • Effector, target position, the position where the endbone wants to move. Sometimes rotation is needed to determine the direction of the endbone.
  • Joint Target, PoleVector, pole vector, find a plane to place the Joint Bone through Root-JointTarget-Endbone.

Reference article: Detailed explanation of IK nodes - Zhihu (zhihu.com)

The IK calculation of the TwoBoneIk node involves 3 bones, an End bone (that is, the set IK bone, such as hand_r), a joint bone (the parent bone of the end bone, such as lowerarm_r), and a root bone (the parent bone of the joint bone, such as upperarm_r).

Configuration:

IKBone : The bone name of End bone.

Effector Location : Specify the final position of the End bone.

Joint Target Location : The plane determined by this point and the three points of Effector Location and root bone will be the plane where the joint bone is located, because there can be countless joint bone positions after calculation. By specifying the Joint Target Location, the joint bone can be located To compare the suitable plane, the value of Joint Target Location needs to be constantly experimented to get the most suitable value.

Effector Location Space : The coordinate system of EffectorLocation, World Space world coordinate system, Component Space component space coordinate system, Parent Bone Space uses the parent bone of the bone configured by EffectorSpaceBoneName as the origin coordinate system, and Bone Space uses the bone configured by EffectorSpaceBoneName as the origin coordinates. Tie.

Effector Space Bone Name : If EffectorLocationSpace selects Bone Space/Parent Bone Space, specify which bone.

Joint Target Location Space : Specify the coordinate system of the Joint Target Location.

bAllowStreching : Whether to allow adjustment of arm length.

FABRIC

Forward and Backward Reaching Inverse Kinematics (Forward and Backward Reaching Inverse Kinematics) supports the IK calculation of multiple bones. Unlike the calculation of TwoBoneIk, FABRIK makes the position of the bone converge to the solution by traversing the bone chain forward and backward ( May not be the best, determined by the number of iterations and accuracy).

The following figure shows the process of IK calculation of bone A:

Configuration:

Percision : Before the iteration starts, if the distance between the tip bone's position and the new position is less than this precision, it means no IK calculation is required; after the iteration starts, the distance between the tip bone's parent bone and the new position is equal to the actual Tip bone arm length. If the difference is less than this accuracy, the iteration will stop.

Tip Bone: Specify the end bone of the IK chain, such as hand.

Root Bone: Specify the root bone of the IK chain, such as pelvis.

Max Iteration: Maximum number of iterations, default 10.

Effector Transform: Tip bone new transformation amount;

Effector Tansform Space: Specifies whether the value of Effector Transform is relative to the world coordinate system (World Space), component coordinate system (Component Space), parent bone coordinate system (Parent Bone Space) or the specified bone coordinate system (Bone Space).

Effector Transform Bone: If Effector Tansform Space selects Bone Space, this option specifies which bone it is.

Guess you like

Origin blog.csdn.net/zaizai1007/article/details/132894177