02-22-2016 11:31 AM
10-24-2016 11:49 AM
10-24-2016 07:56 PM
10-25-2016 03:59 PM
11-03-2016 04:47 AM
using UnityEngine;
using System.Collections;
public class FakeTracking : MonoBehaviour
{
public OVRPose centerEyePose = OVRPose.identity;
public OVRPose leftEyePose = OVRPose.identity;
public OVRPose rightEyePose = OVRPose.identity;
public OVRPose leftHandPose = OVRPose.identity;
public OVRPose rightHandPose = OVRPose.identity;
public OVRPose trackerPose = OVRPose.identity;
void Awake()
{
OVRCameraRig rig = GameObject.FindObjectOfType<OVRCameraRig>();
if (rig != null)
rig.UpdatedAnchors += OnUpdatedAnchors;
// print("in awake");
}
void OnUpdatedAnchors(OVRCameraRig rig)
{
if (!enabled)
return;
//This doesn't work because VR camera poses are read-only.
//rig.centerEyeAnchor.FromOVRPose(OVRPose.identity);
//Instead, invert out the current pose and multiply in the desired pose.
OVRPose pose = rig.centerEyeAnchor.ToOVRPose(true).Inverse();
OVRPose correctedCenterEyePose;
correctedCenterEyePose.position = rig.centerEyeAnchor.ToOVRPose(true).position;
correctedCenterEyePose.orientation = rig.centerEyeAnchor.ToOVRPose(true).orientation;
correctedCenterEyePose.orientation *= Quaternion.Euler(-38.25f, 0.0f, 0.0f);
// pose = centerEyePose * pose;
pose = correctedCenterEyePose * pose;
rig.trackingSpace.FromOVRPose(pose, true);
//OVRPose referenceFrame = pose.Inverse();
//The rest of the nodes are updated by OVRCameraRig, not Unity, so they're easy.
rig.leftEyeAnchor.FromOVRPose(leftEyePose);
rig.rightEyeAnchor.FromOVRPose(rightEyePose);
rig.leftHandAnchor.FromOVRPose(leftHandPose);
rig.rightHandAnchor.FromOVRPose(rightHandPose);
rig.trackerAnchor.FromOVRPose(trackerPose);
}
}
11-03-2016 10:00 AM
08-16-2017 04:33 AM
vrdaveb said:
Sorry, the ability to disable rotation tracking was never prioritized. It's unlikely to get fixed in the near future. However, if you are tracking rotation at all with your own system, the high-frequency data from TimeWarp should complement it and reduce latency rather than cause wobble. You can set whatever position and rotation you want as follows:using UnityEngine;
using System.Collections;
public class FakeTracking : MonoBehaviour
{
public OVRPose centerEyePose = OVRPose.identity;
public OVRPose leftEyePose = OVRPose.identity;
public OVRPose rightEyePose = OVRPose.identity;
public OVRPose leftHandPose = OVRPose.identity;
public OVRPose rightHandPose = OVRPose.identity;
public OVRPose trackerPose = OVRPose.identity;
void Awake()
{
OVRCameraRig rig = GameObject.FindObjectOfType<OVRCameraRig>();
if (rig != null)
rig.UpdatedAnchors += OnUpdatedAnchors;
}
void OnUpdatedAnchors(OVRCameraRig rig)
{
if (!enabled)
return;
//This doesn't work because VR camera poses are read-only.
//rig.centerEyeAnchor.FromOVRPose(OVRPose.identity);
//Instead, invert out the current pose and multiply in the desired pose.
OVRPose pose = rig.centerEyeAnchor.ToOVRPose(true).Inverse();
pose = centerEyePose * pose;
rig.trackingSpace.FromOVRPose(pose, true);
//OVRPose referenceFrame = pose.Inverse();
//The rest of the nodes are updated by OVRCameraRig, not Unity, so they're easy.
rig.leftEyeAnchor.FromOVRPose(leftEyePose);
rig.rightEyeAnchor.FromOVRPose(rightEyePose);
rig.leftHandAnchor.FromOVRPose(leftHandPose);
rig.rightHandAnchor.FromOVRPose(rightHandPose);
rig.trackerAnchor.FromOVRPose(trackerPose);
}
}
I see this thread was last commented at on november 2016.
I am currently using the CV1 with a Mocap suit, and uses the code quoted to "disable" the tracking on the CV1. So that the camera is able to behave as a child of the head mocap suit.
My problem is that when i move slightly with my head, there's still a tiny bit of movement. And I this that this is making me feel sick.
Does anyone know if you can fully dissable all of this, and that the rotation of the camera is coming from the parent head of my mocap suit etc.
I can completely turn off the tracking with this code:using System.Collections;using System.Collections.Generic;using UnityEngine;public class EnableDisableOVRPosAndRotTracking : MonoBehaviour {public bool useOVRTracking = false;// Use this for initializationvoid Start() {OVRPlugin.rotation = useOVRTracking;OVRPlugin.position = useOVRTracking;}// Update is called once per framevoid Update() {}}
___________________________________________________
Problem is that when in play mode the headset is displaying the camera render in a 2D window in a completely black space.
10-31-2017 02:28 AM
vrdaveb said:
> I have no idea what your code does.
This code forces the head and hand poses to match ones that you provide by assigning to the *Pose fields. It applies your poses right after OVRCameraRig normally would have applied our tracking data by subscribing to the UpdatedAnchors event.
> Can you explain how exactly I insert my mocap data into this code?
Write your own MonoBehavior and in an Update function, set FakeTracking.*Pose to the values reported by your mocap data.
> Also, where would I attach that script? On an empty Game Object?
Yep, that should work. I tested it by attaching it to the same GameObject as my OVRCameraRig, but it's up to you.
//This doesn't work because VR camera poses are read-only.
//rig.centerEyeAnchor.FromOVRPose(OVRPose.identity);
Are there any ways to modify centerEyeAnchor transform?
I would to use my own mocap data to override centerEyeAnchor
07-25-2019 07:16 AM