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

ARSessionOrigin orientation and GPS coordinates

Discussion in 'AR' started by dmbfm, Nov 1, 2018.

  1. dmbfm

    dmbfm

    Joined:
    Apr 13, 2016
    Posts:
    17
    Hello everyone,

    I'm trying to place objects in a scene using real world GPS coordinates using AR Foundation.

    My problem currently it that, while latitude/longitude coordinates are given along the cardinal directions, I don't know how the session coordinates are oriented in relation to them.

    In ARKit you can use to
    ARConfiguration.WorldAlignment
    to choose the orientation. Is
    there anything similar when using AR Foundation?

    Thanks!
     
    Jelmersb and newguy123 like this.
  2. Jelmersb

    Jelmersb

    Joined:
    Jul 12, 2016
    Posts:
    66
    The orientation you could solve with https://docs.unity3d.com/ScriptReference/Compass.html
    Doing something with GPS coordinates however is more tricky (ARConfiguration.WorldAlignment doesn't do that either) and I would be interested in an answer too.

    EDIT: this might work https://answers.unity.com/questions/1500577/gps-2d-compass-to-point-to-longitude-and-latitude.html

    EDIT2: though be aware, using GPS+compass in an AR app doesn't work well, I can tell from apps that have tried this. Because the compass is not reliable enough. if you point at an object 1km away, and the compass is a few degrees off, you send to user to a completely wrong location. You will need to calibrate the compass by using GPS, which requires the user to "walk in a line" which is not very user friendly.
    You can read more about it here: https://www.instructables.com/id/Placing-AR-Objects-at-GPS-Coordinates-in-Augmented/
     
    Last edited: Nov 5, 2018
    dmbfm likes this.