[Soc-2005-dev] Inverse Kinematics

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Jul 27 16:31:50 CEST 2005


Hey Ton,

Ton Roosendaal wrote:
> Hi,
> 
> 
>>> - DOF joints
>>> We need to define the format how to express a "DOF". End-users 
>>> would   prefer Euler here I guess.
>>
>>
>> I'm not convinced using Eulers would be a good idea, since they have
>> two problems for 3DOF and 2DOF XZ joints:
>> a) singularity at 90 degrees (gimbal lock)
>> b) don't define an intuitive motion range, since for example the Z  range
>>      would not define how far can be rotated over the Z axis from the  
>> rest
>>      pose, but rather how far can be rotated after rotations over the  
>> other
>>      axes.
>> It would in my opinion be best to use a swing (XZ) + twist (Y)  
>> decomposition
>> for these cases. Swing is then an axis angle, and twist is a simple  
>> rotation
>> over the Y axis after the swing. The swing component then nicely  defines
>> how far ca be rotated over the X and Z axes. It still has singularity  
>> at 180
>> degrees, but that's mostly beyond joint limits (and singularity 
>> simply  cannot
>> be avoided when using 3 parameters).
> 
> 
> All PoseChannels have rotations stored as relative WRT to the bone's  
> restposition. It's local even, so the parent rotations don't play a  role.
> The problem is then mostly in the API to the IK itself... since it  
> accepts only the endresult 3x3 matrices of PoseChannels+Bones, without  
> knowledge of what 'rest position' is.
> To make it even more complex, when IK gets applied, all constraints +  
> actions were done already, and possibly even a previous IK round.
> 
> What is possible though, is to give the IK module another 3x3 matrix  
> denoting its restposition. The solver then could evaluate joint limits,  
> based on only these options we provide in the UI:

Yes, I will change the code to define limits w.r.t. to the rest position.

> - Single Axis DOF
>   either X or Z axis. (should be simple, but can be unstable!)
> - Swing DOF
>   both X+Z axes, we can call this the "Swing", and it is based on the
>   maximum angular difference of the Y component of the two 3x3 matrices  
> provided
>   to the IK solver
> - Roll DOF
>   the Y-axis rotation freedom, can be combined with either one of the  
> above.
> 
> Is this what you proposed?

Well, my proposal is to have 3 checkboxes to disable/enable the
X/Y/Z DOF's, and 3 upper + lower limits for their angles, just like most
other apps.

The difference from Euler angles would be in how these values are
interpreted. Euler angles are three sequential rotation (in blender ZYX
I think). What I propose is:

Y (roll) is always the last rotation, after a swing over the X and/or Z axes.

If both X and Z are enabled, the swing part is defined as a direct rotation
(axis-angle) to compute the x and z parameters. Otherwise, the swing
part is a simple rotation over the X or Z axis.

This would only affect the interpretation of the upper/lower limit values.

Advantages:
- parameters are more intuitive
- singularity at 180° instead of 90°
- no weird rotation order switching to avoid singularity

Disadvantages:
- singularity at 180° will always be there, cannot be avoided
   by switching rotation order.

Brecht.


More information about the Soc-2005-dev mailing list