Jump to content

Streamed AR for Unity - VIVE XR Elite


Virtus

Recommended Posts

Sure !

For the sample scene it also doesn't work, unfortunately. There might be something i'm missing in what I am doing, but I am following all the steps given by the tutorials.

For the error I get, I used the sample code given. 

private void OnEnable()
{
    //Check whether feature is supported on device or not
    if ((Int erop.WVR_GetSupportedFeatures() & (ulong)WVR_SupportedFeature.WVR_SupportedFeature_ScenePerception) != 0)
    {
        WVR_Result result = scenePerceptionManager.StartScene();
        if (result == WVR_Result.WVR_Success)
        {
            result = scenePerceptionManager.StartScenePerception(WVR_ScenePerceptionTarget.WVR_ScenePerceptionTarget_2dPlane); //Start perceiving 2D planes

            if (result == WVR_Result.WVR_Success)
            {
                isSceneCMPStarted = true;
                //Examples of things to do here:
                //Scene Planes
                ScenePerceptionGetState();
                //- Call scenePerceptionManager.GetScenePerceptionState() to see the current WVR_ScenePerceptionState of a specific WVR_ScenePerceptionTarget
                //- Call scenePerceptionManager.StopScenePerception() to stop perceiving a specific WVR_ScenePerceptionTarget
                //
                //Spatial Anchors
                //- Call scenePerceptionManager.GetSpatialAnchors() to retrieve all handles of existing anchors
                //scenePerceptionManager.GetSpatialAnchors();
                //- Using the retrieved handles, call scenePerceptionManager.GetSpatialAnchorState() to get information of the Spatial Anchors
            }
        }
    }
    else
    {
       Debug.Log("--------SCENE PERCEPTION NOT AVAILABLE ON DEVICE--------");
    }
}

private void OnDisable()
{
    if (isSceneCMPStarted)
    {
        scenePerceptionManager.StopScene();
    }
}

//Sample Code for getting the 2D plane perception state

public void ScenePerceptionGetState()
{
    WVR_ScenePerceptionState latestPerceptionState = WVR_ScenePerceptionState.WVR_ScenePerceptionState_Empty;
    WVR_Result result = scenePerceptionManager.GetScenePerceptionState(WVR_ScenePerceptionTarget.WVR_ScenePerceptionTarget_2dPlane, ref latestPerceptionState);
    if (result == WVR_Result.WVR_Success)
    {
        //Check perception state here
        if (latestPerceptionState == WVR_ScenePerceptionState.WVR_ScenePerceptionState_Completed)
        {
            //When perception for 2d planes is completed, you can retrieve the data of the perceived Scene Planes
            WVR_ScenePlane[] latestScenePlanes;
            result = scenePerceptionManager.GetScenePlanes(ScenePerceptionManager.GetCurrentPoseOriginModel(), out latestScenePlanes);

            if (result == WVR_Result.WVR_Success)
            {
                Debug.Log("--- Scene Perception State for 2D PLANE : OK ---");
                //Handle the retrieved data of the Scene Planes here
                //For example:
                //- Cache Scene Plane data for future reference
                //- Compare extent and pose of cached Scene Planes with the freshly retrieved ones to see if there are any updates
            }
            else
            {
                Debug.Log("-----ERROR : NOT ABLE TO RETRIEVE SCENE PLANES-----");
            }
        }
    }
}

Those are the functions given, and I get the error at the beginning, saying that scene perception is not available on device. I tried to bypass it by removing the compatibility check, and the code runs successfully to retrieving scene planes, except that there are no scene planes in "latestScenePlanes". I scanned the room in order to be sure that there are scene planes stored in the device.
I guess it is because Unity takes the computer as the device, and of course a computer isn't a scene perception compatible device. I don't know how to fix this though.

packages.png

Link to comment
Share on other sites

Yes, I enabled both Scene Perception and Scene Mesh in my Wave XR settings. I can provide you some screenshots of my project settings.

 

image.png

image.png

image.png

image.png

Link to comment
Share on other sites

I just created an empty project, and Oculus is added via XR Plugin Management plugin. So I don't think it is possible to remove it. 


 

Link to comment
Share on other sites

Posted (edited)

For the AndroidManifest.xml, I did something like this to finally get one : 
In project settings > Wave XR > XRDSK > Import Feature - Custom Android Manifest

then I copied the file located in Assets/Wave/XR/Platform/Android at Assets/Plugins/Android and added  

    <uses-feature android:name="wave.feature.sceneperception" android:required="true" />
    <uses-permission android:name="wave.permission.GET_SCENE_MESH" />

under </application>

(sorry for VS color theme, I know it's too much 😂)

image.png

Edited by Virtus
Link to comment
Share on other sites

Hi @Virtus,

Could you collect the log before you launch your application until you get the error?

> adb logcat > filename

Thanks!

11 hours ago, Virtus said:

I just created an empty project, and Oculus is added via XR Plugin Management plugin. So I don't think it is possible to remove it. 

I think Oculus is included by default. I forgot about this.

Link to comment
Share on other sites

  • 4 weeks later...
Posted (edited)

Hello,

Sorry for the late reply, had to send the Headset to the After-Sales Service, so I couldn't dev on it.
I don't know how to retrieve the logs, I don't use adb for now since I don't build the project for embedded testing. I launch the project directly from unity and get the passthrough on the headset.
I have followed the Scene Perception tutorial (https://hub.vive.com/storage/docs/en-us/UnityXR/UnityXRScenePerception.html), but neither Scene Planes nor Scene Meshes are retrieved. The whole process works with the WVR_Success result, but at the end I don't get any data.

Best regards

Edited by Virtus
Link to comment
Share on other sites

Create an account or sign in to comment

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

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...