Add head, left and right hand trackers for oculus touch controllers

Hello,

I want to manipulate the SimRig Avatar I have made with Oculus touch controllers. Are there any corresponding scripts like the ones you provide for Vive? And if there aren't can anyone guide me how to do it?

4replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • I haven't done it for a few months, but it should work correctly with Oculus (except one detail I'll mention later). If you use the scene from DeepMotion/Scenes/In-Editor-3pt-tracking, select midasMan ->simAvatarRoot->Humanoid Controller. Then in the Inspector for Humanoid Controller, at the end of the Limbs section (expand it if it's not expanded already), there's a gameobject space for Head Target, L Hand Target, and R Hand Target. You can drop the head and hand gameobjects from the Oculus script into those. It may take some experimentation to ensure you are dropping in the entity you want, as things can get a bit mixed up when running - but the Scene view should make it clear enough. One word of warning is (I think) the Humanoid Controller may have left and right reversed - it's from the perspective of someone facing the character, rather than the character. But as I said I've not used it for months, so I may be wrong; there's a naming convention oddity it it somewhere.

     

    Now, the detail - Unity 2018.3 broke the Oculus SDK. Oculus may have fixed that by now, but personally I switched to the SteamVR SDK which handles both Oculus and Vive controllers. So if things are inexplicably broken with the Oculus stuff, that may be why. You can get the SteamVR package through Unity's interface with Window->Package Manager->OpenVR, and click install on that (it may take a minute to populate the packages list). Yes, install OpenVR for SteamVR, the naming isn't as consistent as it should be. After you do that, give it a minute to ensure it's installed, then I suggest restarting Unity just to ensure all the changes are properly recognized. Restarting may not be needed, but it helped in my case.

    Reply Like
    • Chris Edwards  Thanks a lot for your reply. I will try it and I will inform you about the result.🙂

      Reply Like
  • I still can't find the correct  head and hand gameobjects from the Oculus script. Any proposals?

    Reply Like
  • Sorry I'm so late to respond. I suggest using the SteamVR package at https://assetstore.unity.com/packages/tools/integration/steamvr-plugin-32647 as that seems to be the one that Oculus themselves are now pushing people to use (but I'll also include the Oculus controller setup in the next paragraph). So get that and install it, and import it to the project. Then in your project go into the folder SteamVR -> Prefabs. Select the prefab named [CameraRig] and drop it into your scene. In the Heirarchy, you'll now have that [CameraRig] object and its children are Controller (left), Controller (right), and Camera (head). Those are your controllers and headset locations.

    If you really want to use the Oculus SDK, I think it'll be easiest to copy the 2 components from one of their demo scenes. The one in Oculus -> Avatar -> Samples - LocalAvatar -> LocalAvatar.unity is good; look at the OVRCameraRig object. Expand TrackingSpace and you'll see three points for cameras (one for each eye and one for the center - probably is best to use the center one for tracking) and a LeftHandAnchor and a RightHandAnchor. There's a separate LocalAvatar object that also has anchors for each hand, and I'm not 100% certain but I think that gameobject must also be in the scene because it includes some of the tracking scripts. So, copy both the OVRCameraRig and LocalAvatar to your project.   But be aware that there's a good reason the official Oculus SDK has a rating of 3 stars on the Unity store.

    For the character you want to control, he needs that TntHumanoidController script, like the robot-on-moving-platform demo scene has. Drop those hands and camera head into the targets that I highlighted in red below. Here's a picture of the place they need to go, with the Robot On Moving Platform demo.

    Reply Like
Like Follow
  • 6 mths agoLast active
  • 4Replies
  • 32Views
  • 2 Following