Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Check if Ground Plane is supported at runtime

Discussion in 'Vuforia' started by weliketoparty, Jan 16, 2018.

  1. weliketoparty

    weliketoparty

    Joined:
    Aug 17, 2011
    Posts:
    124
    Hello,
    I'm currently integrating Ground Plane on my project.
    As Vuforia Ground Plane supports a limited amount of devices (LIST), I'm trying to implement inside my system, a fallback logic.
    Basically when the device is supported, we use Ground Plane, when it's not, we use a simple gyro driven system we built as replacement.
    The problem here is that I'm not completely sure about how to check the Ground Plane support on the device.
    As far as I understood from the API and samples, Vuforia uses the PositionalDeviceTracker class to "tracks a device in the world by relying on 6DOF sensor tracking", as it says on this Documentation page.
    My guesses are that if the device is not able to rely on Ground Plane, no 6DOF can be archived, and so the property PositionalDeviceTracker.IsActive should return FALSE.
    Unfortunately the description "If the Tracker is currently active" doesn't help at all.
    Can anyone from the Vuforia team confirm this?
     
  2. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
  3. rdl-fhjoanneum-at

    rdl-fhjoanneum-at

    Joined:
    Jan 26, 2017
    Posts:
    1
    Hi Vuforia-Strasza
    Is there like a roadmap or something? We're currently working on an project relying more or less on your ground plane stuff. When do you guys think this will be fixed?
     
  4. TheJosean

    TheJosean

    Joined:
    Feb 7, 2018
    Posts:
    1
    Vuforia-Strasza Would you tell me what is that API or if there is something new?
     
    Last edited: Feb 7, 2018
  5. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Last edited: Feb 26, 2018
  6. weliketoparty

    weliketoparty

    Joined:
    Aug 17, 2011
    Posts:
    124
    @Vuforia-Strasza I updated to Vuforia 7.0.47 and Unity 2017.3.0p4 in order to solve this issue.
    I was using your workaround posted here: https://gist.github.com/vad710/e9047eb834648a42cc6e5f9b16806bc7 .

    Unfortunately it looks like your method PositionalDeviceTracker::init() isn't available.
    On your message you probably intended to share the documentation link, but there's no link. Could you please review it?
    First thing that came into my mind is that the syntax isn't c#, it looks more like c++. Is the method only available on the native version?
    I suppose the PositionalDeviceTracker documentation can be found at this LINK. In all base classes there is no init method.

    At the moment it looks like I will need to rely on the classes linked above. Could you please tell me if it is solid? All these hardcoded models scares me a lot.
    Thank you for your hard work.
     
  7. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Starting the positional tracker via code or checking the box in the Vuforia Configuration is what initializes it. This returning null or false will be your indicator. Short example below:

    Code (CSharp):
    1. void start(){
    2.  
    3.       positionalDeviceTracker = TrackerManager.Instance.GetTracker<PositionalDeviceTracker>();
    4.  
    5. }
    6.  
    7. bool isSupported (){
    8.  
    9.       return (positionalDeviceTracker != null)
    10.  
    11. }
     
  8. andersemil

    andersemil

    Joined:
    Feb 2, 2015
    Posts:
    111
    Hi, iPhone 5S is listed as supported for ground plane experience. However, when we run our Unity project (which works fine on iPhone X) on 5S, we only get 3dof, no positional tracking. Is this to be expected? And will the above code return false if 6dof is not available? We obviously need to differentiate our gameplay depending on whether 6dof is available or not.
     
  9. jtbentley

    jtbentley

    Joined:
    Jun 30, 2009
    Posts:
    1,397
    I must say, this is not a particularly robust system... We really need two things from Vuforia, the ability to check if a device supports ground plane support, and check whether the user has given the application camera permission... Without the ability to check for camera support, we can't send them to the app settings pages, etc.
     
  10. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Please see my most recent comment on this thread for the proper API for checking for Ground Plane support.

    Checking if camera permission has been granted is a not a Vuforia functionality, but a device/os check. This thread appears to have addressed it, https://forum.unity.com/threads/request-and-get-state-of-camera-permission.281858/, and there may be other solutions as well.

    Thanks
     
  11. jtbentley

    jtbentley

    Joined:
    Jun 30, 2009
    Posts:
    1,397
    Actually, it turned out that your plugin does have appropriate calls in it, there's a DefaultInitializationErrorHandler, which inside receives an error code, one of which is a camera error. To trigger this error, you have to sneakily run AR, but you can do this behind some UI, it only needs to be for a split second, and then you can show an appropriate dialogue.

    Moving forward from that, I would perhaps recommend a documented callback system (or at least a error variable that's visible on the VuforiaManager the instant Init() is executed) so that we can better implement our custom error dialogues, or hide our 'go to ar mode' buttons, etc.

    I agree that checking for a camera isn't necessarily Vuforia's "job", but without that camera permission the plugin is entirely useless, and it seems you already have done the work, this also seems like something of meaningful value to developers :D
     
    Vuforia-Strasza likes this.
  12. rahul_noob

    rahul_noob

    Joined:
    Oct 3, 2017
    Posts:
    26
    Yes, it's showing unsupported on iPhone 5S. It's probably best to use GitHub link.
     
  13. nebnes

    nebnes

    Joined:
    Sep 15, 2014
    Posts:
    2
  14. rahul_noob

    rahul_noob

    Joined:
    Oct 3, 2017
    Posts:
    26
    So basically you guys don't have an API to check that.
     
    jaycausing-fb likes this.
  15. waqar-hussain

    waqar-hussain

    Joined:
    Dec 5, 2016
    Posts:
    1
    Any one tell me, can i use ground plane stage on oppo f7????
     
  16. rahul_noob

    rahul_noob

    Joined:
    Oct 3, 2017
    Posts:
    26
  17. lloydhooson

    lloydhooson

    Joined:
    Apr 7, 2008
    Posts:
    77
    I don't know if the Vuforia is updating or maintaining that list at all. Where is the Google Pixel 3? I'm pretty sure (haven't one to hand) that googles flagship device should be supported. Or maybe it's not supported then Vuforia need to sort it.
     
  18. meedabit

    meedabit

    Official Vuforia Employee Vuforia

    Joined:
    Dec 8, 2016
    Posts:
    266
    Hello @lloydhooson,

    The Vuforia Fusion supported devices page is primarily meant to represent devices that Vuforia supports (though our calibration process), but ARKit/ARCore do not.

    In the case of the Pixel 3, this device supports ARCore so Vuforia VIO is not required. Thus, there is no need to calibrate as Vuforia Fusion prioritizes platform CV.

    Thanks,
    Vuforia Engine Support