Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Vuforia Ground Plane, no Positional Tracking on Google Pixel or Samsung S7

Discussion in 'Vuforia' started by Radical435, Jan 23, 2018.

  1. Radical435

    Radical435

    Joined:
    Oct 20, 2014
    Posts:
    24
    Hello --

    I've been developing a cross platform ground plane app; it works perfectly on iOS. On android, plane finding behaviour successfully finds planes successfully but there is only rotational tracking. We need the 6 DOF for this app to work. We may need to ditch Vuforia if it's not happening soon.

    I installed the Reporter asset to check out runtime logs; there are no errors. It mentions that it did start the Positional Tracker.

    Is this issue on the Vuforia team's radar? I also tried 2018.1b4 which includes Vuforia 7.1; I have the same issue.

    It happens in both our custom project, and with the GroundPlane demo asset scene.
     
    bduguid likes this.
  2. christian-svr

    christian-svr

    Joined:
    Jan 18, 2018
    Posts:
    1
    I noticed this as well. Worked perfectly on IOS, but as soon as I tried to deploy to Android (Samsung Galaxy S8), only rotational tracking worked. There was no documentation on Vuforia's website that suggests that this was a limitation on Android, but there it is.
     
    Last edited: Feb 5, 2018
  3. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Due to the nature of the technology, Ground Plane may not be able to provide 6DoF tracking in all environments. This article includes some information for an ideal Ground Plane environment: https://library.vuforia.com/articles/Training/ground-plane-guide.html

    Specifically, the following is relevant to this issue:
    Ground Plane utilizes images from the device camera to understand the basic geometry of your environment. Therefore it is necessary to stage Ground Plane experiences in settings that enable the camera to accurately capture the details of the surroundings.
    Recommendations:
    • Stable lighting conditions
    • Moderate lighting - not too bright or too dark
    • Avoid glare and dark shadows
    • Surface details help to reveal geometry and improve accuracy and performance


    Doing my own experiments, I found that in ares with low detail surfaces I was able to improve the experience by taking additional time to scan the environment before performing the first hit test. While not guaranteed to work, I was able to 6DoF/positional tracking in a wide variety of environments such as low detail carpet, tiles, and pavement.

    The basic thought is that the more information the system has from environment scanning (floors, table tops, etc.), the more likely you are to gain a 6DoF pose.

    The Ground Plane feature will continue to improve with future Vuforia releases. APIs that provide information on the tracking quality are coming in the future. These can be used to determine the quality of the area you are scanning and allow you to advise the user of what steps they can take to improve their experience.
     
  4. IvanRoyale

    IvanRoyale

    Joined:
    Apr 4, 2017
    Posts:
    2
    Hi Vuforia-Strasza - I've just tested Vuforia ground plane on iOS and Android, vs using straight-up ARKit and ARCore. Vuforia ground plane is clearly not ready for prime time, when compared against the other two. I'm building an app that needs to use ground planes and image recognition, but as separate features, they don't need to interact. I want to use the ARCore/ARKit plugins for ground planes WITHOUT Vuforia, and use Vuforia ONLY for image recognition on Android. But now that Vuforia is integrated, Unity won't allow the inclusion of both Vuforia and ARCore. Is there a way to get around this and just use Vuforia's image recognition?
     
  5. robbbbbbbbb

    robbbbbbbbb

    Joined:
    Feb 4, 2016
    Posts:
    2
    @Vuforia-Strasza I'm also left pretty baffled after a couple of days trying to use GroundPlane as a cross-platform replacement for ARCore/ARKit. I'd appreciate your feedback on the below to make sure I haven't missed something obvious.

    From reverse engineering PlaneFinderBehaviour and ContentPositioningBehaviour I've figured out that SmartTerrain and PositionalTrackingBehaviour seem to be the main classes involved in getting 6DoF tracking and surface detection working (basically the key functionality 90% of developers want from ARKit/Core).

    However, 6DoF seems to not start until PositionalTrackingBehaviour.CreatePlaneAnchor is called. This in turn needs to raycast against SmartTerrain. Until CreatePlaneAnchor is called only 3DoF tracking is happening. Until that point the Camera simply stays at world origin, irrespective of where the device has been moved to, and SmartTerrain performs raycasts against a virtual, imaginary plane 1.4m below the origin. If you start the app standing up with your phone at 1.4m height, then you can kind of fool yourself that plane detection is happening, but set this value to a different number, or start the app with the phone a few inches from a table and the illusion is broken pretty quickly (in the latter case you get the charming result that it thinks the table is the floor, the device is 1.4m from it, and therefore makes all the content teeny tiny).

    Unless I'm missing something (which is definitely possible, there are lots of docs, but I found them pretty hard to parse in to a usable guide) this makes 'GroundPlane' not really a very useful technology, as you can't actually use it as you can ARCore/Kit to provide 6DoF with real-world correct units and to detect actual (as opposed to user-curated) surfaces.
     
    andersemil and knarfin like this.
  6. robbbbbbbbb

    robbbbbbbbb

    Joined:
    Feb 4, 2016
    Posts:
    2
    For clarity, and in case it helps spot where I'm going wrong, here's a minimal version of the code I've got.

    Other than this the scene is as-per the GroundPlane tutorial (this class is intended to replace the AnchorInputListenerBehaviour, PlaneFinderBehaviour and ContentPositioningBehaviour in that sample).

    Code (CSharp):
    1. using System;
    2. using UnityEngine;
    3. using Vuforia;
    4.  
    5. public class VuforiaGazePositioning : MonoBehaviour
    6. {
    7.     public GameObject PlaneIndicator;
    8.     public GameObject AnchorContent;
    9.  
    10.     SmartTerrain mSmartTerrain;
    11.  
    12.     void Awake()
    13.     {
    14.         SmartTerrainARController.Instance.AutoInitAndStartTracker = true;
    15.         VuforiaARController.Instance.RegisterVuforiaStartedCallback(VuforiaStarted);
    16.         DeviceTrackerARController.Instance.RegisterDevicePoseUpdatedCallback(PoseUpdated);
    17.         AnchorContent.SetActive(false);
    18.     }
    19.  
    20.     private void Update()
    21.     {
    22.         if (Input.touchCount > 0)
    23.         {
    24.             Touch t = Input.GetTouch(0);
    25.             if (t.phase == TouchPhase.Began)
    26.             {
    27.                 HitTestResult result = default(HitTestResult);
    28.                 if (mSmartTerrain.HitTest(new Vector2(.5f, .5f), 1.4f, out result))
    29.                 {
    30.                     var anchor = TrackerManager.Instance.GetTracker<PositionalDeviceTracker>().CreatePlaneAnchor("Anchor_" + Guid.NewGuid().ToString(), result);
    31.                     if (!anchor)
    32.                     {
    33.                         Debug.LogError("Failed to create plane anchor");
    34.                     }
    35.                     else
    36.                     {
    37.                         AnchorContent.SetActive(true);
    38.                         AnchorContent.transform.parent = anchor.transform;
    39.                         AnchorContent.transform.localPosition = Vector3.zero;
    40.                         AnchorContent.transform.localRotation = Quaternion.identity;
    41.                     }
    42.                 }
    43.             }
    44.         }
    45.     }
    46.  
    47.  
    48.     private void VuforiaStarted()
    49.     {
    50.         mSmartTerrain = TrackerManager.Instance.GetTracker<SmartTerrain>();
    51.     }
    52.  
    53.     private void PoseUpdated()
    54.     {
    55.         if (mSmartTerrain != null)
    56.         {
    57.             HitTestResult result = default(HitTestResult);
    58.             bool flag = this.mSmartTerrain.HitTest(new Vector2(.5f, .5f), 1.4f, out result);
    59.             if (flag)
    60.             {
    61.                 this.PlaneIndicator.transform.position = result.Position;
    62.                 this.PlaneIndicator.transform.rotation = result.Rotation;
    63.             }
    64.         }
    65.     }
    66.  
    67. }
    68.  
     
  7. Sunderer

    Sunderer

    Joined:
    Mar 16, 2015
    Posts:
    35
    Basically, go vuforia configuration in unity and make sure ARCore Requirement : Required selected. And make the minimum android version 8+ in player settings-other settings.