Jump to content

Wrong behaviour on Oculus


Recommended Posts

@AlGolden After further investigation, we found out that Oculus XR Plugin will report isPoseValid=false which leads to release game object.

In below screenshot, if pose is invalid, ColliderEventCaster will be SetActive false.

image.png.6e177f6b0174f8f9c2a73e57dd99a6fa.png

 

But for the case using Vive Focus Plus, the controller is using ultrasonic + IMU fusion tracking.

I believe the isPoseValid should be true when controller is connected.

There are several workarounds if you want to align the behavior.

Or you can import Oculus Integration Unity SDK.

 

Link to post
Share on other sites

@AlGolden It depends on what is your expectations.

Do you want your controller to rotate during lost tracking?

METHOD1

Your controllers can still rotate at fixed position after lost tracking.

In Assets\HTC.UnityPlugin\VRModule\Modules\UnityXRModuleBase.cs,

line 200,

currState.isPoseValid = true || GetDeviceFeatureValueOrDefault(device, CommonUsages.isTracked);

METHOD2

Your controllers will be freeze after lost tracking.

1. Enable the ColliderEventCaster game object (yellow box)

2. Empty the "On Is Valid Changed" under PoseTracker (red box)

image.png.7fc7bf5a8e167f1469075748cbcc1113.png

Let me know if this does not fixed your issue, thanks!

Link to post
Share on other sites

Hi @AlGolden

The unexpected behavior for you is caused by this:

In our default setup in our prefab & example scene,

RenderModelHook (visible controller model) will be switched off only if device is disconnected.

ColliderEventCaster (invisible controller grabber) will be switched off if device is disconnected or lost tracking.

 

So when your Rift controller or Vive controller lost tracking (but still connected), their model are still visible but the grabber is disabled (thus grabbed object is released).

But for Focus Plus controller, its hard to lost its tracking, so the grabber isn't disabled.

 

Assuming you want to align them,

Option 1) Make RenderModelHook also switched off when device is disconnected or lost tracking

by simply adding switch function to PoseTracker.OnIsValidChanged callback

fix_release_when_lost_tracking.png.92810e1b7b9ea5379665a88d6848ea91.png

Option 2) Make CooliderEventCaster switched off only if device is disconnected

To achieve that, you have to write a script that detect if device is connected (see attached file)

fix_release_when_lost_tracking_2.png.0c5e6f3bf5472a1aabc4de306fdcadd5.png

DetectDeviceConnection.cs

 

Hope it helps.

Link to post
Share on other sites

Please sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...