Search Unity

Optitrack Foot Skating - IK and HumanPose

Discussion in 'Animation' started by david-mal, Oct 1, 2018.

  1. david-mal

    david-mal

    Joined:
    Nov 27, 2017
    Posts:
    6
    Hello everyone,

    as this (old) Blog descirbes, there are some problems with mecanim humanoids and an effect we call "foot skating". In the blog it can be found under "Original hand and foot position".
    So my current setup is as follows. I get tracking data from an Optitrack tracking system. The data is processed with the Optitrack Unity plugin and assigned to a humanoid avatar with the HumanPose (get,set).
    Since Mecanim seems to influence the body movement, the feet of the avatar "skate" over the ground. Thats why I tried to fix that by adding an AnimationController to be able to use the OnAnimationIK callback.

    I tried something like
    Code (CSharp):
    1. private void OnAnimatorIK(int layerIndex)
    2.     {
    3.         anim.SetIKPosition(AvatarIKGoal.RightFoot, originalTrackedRightFoot.position);
    4.         anim.SetIKPositionWeight(AvatarIKGoal.RightFoot, 1);
    5.  
    6.     }
    I'm still pretty sure that this could solve my problem, but it turned out that when I add an animation controller to the animator, the HumanPose values of the tracking system are somehow overwritten. I would need a combination of both. The values from optitrack and after applying them, I want to bring the feet back to the starting position with IK.

    What do you think of my approach and can someone please help me because I am getting really desperate.
    Does anyone have a solution to prevent foot skating without an external tool (I need to add some more animations as soon as I know how to do it)?

    Thank you in advance and do not hesitate to ask some questions.
     
  2. david-mal

    david-mal

    Joined:
    Nov 27, 2017
    Posts:
    6