Search Unity

Oculus Touch hand Jitter/smearing despite high framerate

Discussion in 'AR/VR (XR) Discussion' started by Mulbin, Apr 19, 2017.

  1. Mulbin

    Mulbin

    Joined:
    Feb 8, 2016
    Posts:
    64
    Hi all,

    I have a problem implementing Oculus Touch in my project. For some reason my hand models jitter and go into double vision when they move, very much like low framerate jitter. The problem is that my framerate is steady at over 95fps and no other part of the game has jitter.

    Any ideas? It's as if the hand models are displaying at half the framerate of the rest of the game!
     
  2. Mulbin

    Mulbin

    Joined:
    Feb 8, 2016
    Posts:
    64
    To expand on this a little, I am using custom hand models which I have made the children of the left and right hand anchors. I have just run a test with the Oculs sample scene for touch and can see that the default avatar hands move perfectly smoothly... however if I attach a game object as a child of the hand anchor (just a simple cude) it too judders like crazy.

    So the problem seems to be that you shouldn't have a hand mesh as the child of the hand anchors without it jittering.... so what is the correct way to do it?
     
  3. Mulbin

    Mulbin

    Joined:
    Feb 8, 2016
    Posts:
    64
    SOLVED - It seems it works better to not have the hands as children but to just add a script that gets/sets position from OVR manager.
     
  4. R3volve

    R3volve

    Joined:
    Apr 9, 2017
    Posts:
    6
    This literally created more questions for me than it answered.
    I can't find any reference in the OVRManager script for the controller positions / rotations.
    the OVRInput script has GetLocalControllerPosition() and GetLocalControllerRotation()
    but I don't know how to differentiate between left and right controllers.

    I think it should be something like
    rightHand.transform.position = OVRInput.GetLocalControllerPosition(RTouch);
    rightHand.transform.rotation = OVRInput.GetLocalControllerRotation(RTouch);

    But the RTouch part is wrong. I don't know how to tell it that I want the Right Touch information.

    Here is the code that its trying to call from the OVRInput script for position:

    public static Vector3 GetLocalControllerPosition(OVRInput.Controller controllerType)
    {
    switch (controllerType)
    {
    case Controller.LTouch:
    case Controller.LTrackedRemote:
    return OVRPlugin.GetNodePose(OVRPlugin.Node.HandLeft, stepType).ToOVRPose().position;
    case Controller.RTouch:
    case Controller.RTrackedRemote:
    return OVRPlugin.GetNodePose(OVRPlugin.Node.HandRight, stepType).ToOVRPose().position;
    default:
    return Vector3.zero;
    }
    }
     
  5. R3volve

    R3volve

    Joined:
    Apr 9, 2017
    Posts:
    6
    OK through sheer brute force, guesswork, trial and error, and banging rocks together I managed to get it working.
    make your rightHand object and OVRCameraRig objects both children of an empty "player" object.
    Then paste this code into your games input controller script, where rightHand is whatever you want controlled by your right hand touch controller.

    rightHand.transform.localPosition = OVRInput.GetLocalControllerPosition(OVRInput.Controller.RTouch);
    rightHand.transform.localRotation = OVRInput.GetLocalControllerRotation(OVRInput.Controller.RTouch);
     
    Last edited: Apr 21, 2017
    learnt_n_turnt likes this.
  6. ChunkyToads

    ChunkyToads

    Joined:
    Jun 21, 2017
    Posts:
    8
    For anyone interested I've also detailed a step-by-step method which worked for me, at getting rid of the jittering/stuttering hands issue. You can check out the video for this below
     
    Last edited: Feb 20, 2020
  7. benjaminoutram

    benjaminoutram

    Joined:
    Nov 10, 2014
    Posts:
    20
    My solution was just to make sure I was updating positions of things that were following the handanchors in Update() rather than FixedUpdate().
     
  8. MarkSharpe

    MarkSharpe

    Joined:
    Feb 3, 2021
    Posts:
    27
    I have an issue where my hands are tracking fine but whenever I pick up and object and hold it and move then I get extreme jitter and it appears the raycast is pushing the object I am holding away from me. Is this a a layer interaction issue with the ground or with the frame rate not being able to keep up with the render upon moving in realtime? I'm really struggling here.
     

    Attached Files: