New To The Forum? Click Here To Read The How To Guide. -- Developers Click Here.

New "VR Object" examples ?

CoffeeODCoffeeOD Posts: 10
NerveGear
We are quite interested to start playing around with "VR Object" but failed to find any information about integrating VR objects with Unity. Any idea where I could find some information about this?

Comments

  • imperativityimperativity Posts: 1,448 Oculus Staff
    Hi,

    Can I get some more information regarding what "VR Object" is referring to in this context?

  • mfmfmfmf Posts: 53 Oculus Staff
    Is this referring to the public test realm mixed reality support? We're hoping to have more information on this before long. We will post it to the forum when it's available.
  • CoffeeODCoffeeOD Posts: 10
    NerveGear
    Correct, on the 1.16 update. Where you can pair third touch controller as "VR Object".


  • ConstellationConstellation Posts: 190
    Art3mis
    mfmf said:
    Is this referring to the public test realm mixed reality support? We're hoping to have more information on this before long. We will post it to the forum when it's available.
    Any update on this? I actually don't need to do any MR capture; I mainly want to get access to the position & orientation of the VR Object in Unity so I can attach a third Touch controller something (in the real world) and track it.

  • ConstellationConstellation Posts: 190
    Art3mis
    I couldn't find a way to do it from Unity but I could do it via the SDK and it should be easy enough to make a native plugin to make the call from Unity. Here's my code:

                ovrPoseStatef pose;
    ovrTrackedDeviceType type = ovrTrackedDevice_Object0;
    ovr_GetDevicePoses(Session, &type, 1, 0, &pose);


  • imperativityimperativity Posts: 1,448 Oculus Staff
    @Constellation

    Thanks for this. I am pinging @mfmf regarding your inquiry.
  • ConstellationConstellation Posts: 190
    Art3mis
    I feel like I'm pretty close to getting it working in Unity. I found a Node called DeviceObjectZero and I had a hunch it would correspond with ovrTrackedDevice_Object0. I can get the orientation of the VR Object (third Touch) as follows:

    OVRPose p = OVRPlugin.GetNodePose(OVRPlugin.Node.DeviceObjectZero, OVRPlugin.Step.Render).ToOVRPose();

    For some reason it doesn't seem to update position; any ideas?

  • mfmfmfmf Posts: 53 Oculus Staff
    Hmm, that should work. Are you sure the object's actually being positionally tracked? (e.g. if it's not in view of the sensors, the position won't be updated)
  • ConstellationConstellation Posts: 190
    Art3mis
    Since I was only working with the (third) Touch and mostly working in Visual Studio I'd actually left my Rift on my desk. Once the head sensor inside the Rift was activated (in this case by holding my thumb over it) the Touch position tracking started working. When I uncovered the sensor again the position tracking continued to work for a while but eventually it stopped. From looking at the LED's on the cameras it seems like the head sensor in the Rift is what turns the cameras on and off; is there any way to decouple this other than by putting tape over the sensor? I have a use case where I'd like to be able to track a real world object using a third Touch and I need to always maintain tracking, even if the user temporarily removes the Rift.

    I've noticed that the orientation tracking of the Touch seems to work even when both the Rift and Touch are outside the camera range and the cameras are off; I suppose the updates I'm getting are purely IMU based. I've also noticed that I'm getting position updates as well, the values are non-zero but I can't figure out what they're actually based on. I modified my Update() to check GetNodePositionTracked and GetNodeOrientationTracked so I'm not sure why those updates are coming through. It would be nice if these functions only returned true if the Node in question was within range of the cameras (and the cameras were obviously on).

    Here's my Update():
            OVRPose p = OVRPlugin.GetNodePose(OVRPlugin.Node.DeviceObjectZero, OVRPlugin.Step.Render).ToOVRPose();

    if (OVRPlugin.GetNodePositionTracked(OVRPlugin.Node.DeviceObjectZero))
    {
    this.transform.position = p.position;
    }

    if (OVRPlugin.GetNodeOrientationTracked(OVRPlugin.Node.DeviceObjectZero))
    {
    this.transform.rotation = p.orientation;
    }



  • mfmfmfmf Posts: 53 Oculus Staff
    Odd-- yeah, unlike the hands, the tracked object assumes it's always tracked. (Your code should work as expected for the hands.) I'll ask around about that. May be a limitation of our implementation, though.
  • mfmfmfmf Posts: 53 Oculus Staff
    Update: looks like we're planning a fix for that in an upcoming integration, but it could still be a month or so out.
  • ferdi6785ferdi6785 Posts: 1
    NerveGear
    i had a question about the use of more then 1 vr objects and the 2 touch controllers, are you working on that in a future update or is it a hardware limitation? We want to use more then 1 vr object in our recent project.
  • ConstellationConstellation Posts: 190
    Art3mis
    mfmf said:
    Update: looks like we're planning a fix for that in an upcoming integration, but it could still be a month or so out.
    I got the 1.17 update yesterday and it looks like it's already fixed! Thanks!!
  • user042user042 Posts: 3
    NerveGear
    @Constellation
    Can you maybe write a little guide what you all did to get object tracking to work?
    At work, i could play a little bit around with two vive tracker. 
    Really nice extensions. 
    With final IK i got really easy basic body tracking to run. 
    Having foot tracking is a thing i would love to see in future VR Applications.
  • ConstellationConstellation Posts: 190
    Art3mis
    I simply followed the VR Object section of the mixed reality setup guide from Oculus. I've paired a third Touch as a VR Object to three different systems now and it's really pretty streamlined & quick; I've not had any issues with getting it setup. To access the position and orientation of the object you'll need to use the SDK or Unity code I posted above. I'm guessing there's also a similar binding the Unreal plugin but I haven't used that yet.
  • user042user042 Posts: 3
    NerveGear
    Thanks 
    I'm using unity. 
    In which Script did you add your code?
    Or did you made a new gameobject with your Script, which is the the tracked object?

  • ConstellationConstellation Posts: 190
    Art3mis
    I was just testing so I simply made a cube and attached a new script to it so applying the position & orientation to the "this" object will update it:
          this.transform.position = p.position;


  • ConstellationConstellation Posts: 190
    Art3mis
    mfmf said:
    Update: looks like we're planning a fix for that in an upcoming integration, but it could still be a month or so out.
    I got the 1.17 update yesterday and it looks like it's already fixed! Thanks!!

    @mfmf I'm afraid there was a regression with 1.18 because this issue has come back. I wish I could downgrade to 1.17 to verify that bit AFAIK that's not possible. I was wrong to have hijacked this thread with this issue so I've started a new thread.
Sign In or Register to comment.