Forum Discussion
BananaHavoc
10 years agoExplorer
Disabling Positional Tracking Not Functioning In Oculus Util
Hey,
I've been trying to upgrade to the Oculus Utilities 0.1.0 beta for Unity 5.1.1p3 or 5.1.2p3.
With the new integration, I've been having difficulty disabling positional tracking and only maintaining rotational tracking.
I tested this out with a new project that only had the Oculus Utilities asset imported and a cube close to the OVRCameraRig, to test if positional tracking is working. The only other changes are that "Virtual Reality Supported" Is turned on, and "Use positional tracking" in the OVRManager script is unchecked, which does not appear to have any effect.
In the previous Unity integration, I recall having to edit the OVRManager class to disable positional tracking, but I'm not certain how to make that same change with the new version.
I'm certain that positional tracking is still functioning, as I'm able to view the cube from above or below based on the position of the rift.
Any thoughts for how to properly disable positional tracking using the new integration?
I've been trying to upgrade to the Oculus Utilities 0.1.0 beta for Unity 5.1.1p3 or 5.1.2p3.
With the new integration, I've been having difficulty disabling positional tracking and only maintaining rotational tracking.
I tested this out with a new project that only had the Oculus Utilities asset imported and a cube close to the OVRCameraRig, to test if positional tracking is working. The only other changes are that "Virtual Reality Supported" Is turned on, and "Use positional tracking" in the OVRManager script is unchecked, which does not appear to have any effect.
In the previous Unity integration, I recall having to edit the OVRManager class to disable positional tracking, but I'm not certain how to make that same change with the new version.
I'm certain that positional tracking is still functioning, as I'm able to view the cube from above or below based on the position of the rift.
Any thoughts for how to properly disable positional tracking using the new integration?
14 Replies
Replies have been turned off for this discussion
- vrdavebOculus StaffThis is unfortunately a known issue with the current utilities. It will be fixed in an upcoming release, which should be out in the next couple of weeks. For the time being, you can implement a tracking callback and register it with OVRCameraRig.UpdatedAnchors to remove positional changes from the center eye anchor's pose.
- dbuckHonored GuestVery much interested in this also.
A requirement for updating to the newer builds for us. - zulmanHonored GuestSame problem http://forum.unity3d.com/threads/way-to ... ng.350322/
- vrdavebOculus StaffThe fix will be out soon. In the meantime, you could do something like this:
void Awake()
{
var cameraRig = gameObject.GetComponentInChildren<OVRCameraRig>();
cameraRig.UpdatedAnchors += UpdateTransform;
}
public void UpdateTransform(OVRCameraRig rig)
{
rig.trackingSpace.FromOVRPose(CameraRig.centerEyeAnchor.ToOVRPose().Inverse();
} - BananaHavocExplorerThanks for the replies.
I'm afraid the code vrdaveb posted isn't working.
The trackingSpace parameter of cameraRig appears to be a Transform, which understandably doesn't have a method called FromOVRPose(), nor does it have a method called ToOVRPose().
Furthermore, the trackingSpace parameter of the method argument has a private set(), so it doesn't appear I'll be able to alter the camera position that way.
Is there something I'm missing? This is holding me back from 0.7.0 compatibility - vrdavebOculus StaffThose extension methods are all defined in the OVRCommon script. Looks like they actually didn't make it into the 0.1.0 release, but here they are. You might have to fix the math a little, I haven't tested this.
- BananaHavocExplorerThanks for the continued update.
The code you provided compiles now, but with it running the view seems to bounce between two positions each frame.
I tried creating a new pose and giving it a position at the origin without changing the rotation:
OVRPose pose;
pose = new OVRPose ();
pose.orientation = cameraRig.centerEyeAnchor.ToOVRPose ().orientation;
pose.position = Vector3.zero;
cameraRig.trackingSpace.FromOVRPose (pose);
But that causes the view to rotate wildly.
I'm sure you already know this, but it appears that the issue is that the call toovrp_SetCaps((Caps)caps);
doesn't take.
Do you have any other ideas? - vrdavebOculus StaffNote that tracking only sets the local pose of the center eye anchor. You should be able to set the tracking space's local pose in such a way that the center eye anchor's world position stays constant. You might have to build a TRS matrix, invert that, and then extract an OVRPose from it. If this is too complicated, I would recommend staying on Unity 4 and integration 0.6.1 until we release the updated utilities, which will include a fix for this.
- zulmanHonored Guest
"vrdaveb" wrote:
Note that tracking only sets the local pose of the center eye anchor. You should be able to set the tracking space's local pose in such a way that the center eye anchor's world position stays constant. You might have to build a TRS matrix, invert that, and then extract an OVRPose from it. If this is too complicated, I would recommend staying on Unity 4 and integration 0.6.1 until we release the updated utilities, which will include a fix for this.
It's normal practice to fix by manual replacement of CenterEyeAnchor position, but in Unity this approach (via Update, LateUpdate, and PreRender) produces micro camera jumps - so this practice is not working (or i am just making something wrong?) - BananaHavocExplorerI did the TRS matrix approach you mentioned, but it had the same result as the OVRPose inverse, where the camera appears to oscillate between two positions each frame.
I ended up getting it to work with the frustratingly simple line:TrackingSpace.position = CenterEyeAnchor.localPosition * -1f
(My OVRCamera happens to be at the origin, otherwise one would have to account for that offset)
Thanks for the help!
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 6 months ago
- 11 months ago