'I want to create AR app in UNITY the uses GPS, but the sensor is jumpy
On one hand i have the image-based AR that Unity provides me, which is amazing in making things seem as if they are actually around my in the real world.
Problem is - this is only localized based on the imagery of my surrounding, disregarding my location on the latitude-longitude coordinates and my Azimuth (compass).
However, if i use the compass and GPS sensors on my Android i get a fidgety readings, and that causes the virtual objects around my to be jumpy.
I don't want to use Vuforia / Wikitude / Mapbox. I want to build this myself using only UNITY.
Is this possible? what should be the algorithm for combining image-based spatial-localization with GPS and compass data?
How did Niantic solve this in 2016 with Pokemon GO?
Solution 1:[1]
The short answer is "No", neither compass or GPS data is accurate enough for AR. You will never get a stable AR experience based on these two sensors, especially you are using mobile devices.
But it's not impossible, you can instantiate your starting position based on GPS reference, and compass if possible. But, the compass sensor quality is terribly bad on most of Android devices. You will have very high chance of getting wrong direction on mobile nowadays.
If you are in city with many tall buildings, you will end-up with ~10+ meters off from reality. And the compass sensor would be interfered a lot.
Once you initialised your starting position, then you have to switch to marker-less tracking. It will try to trace all the feature points from your webcam. It means, it only works well in day time environment as none of mobile webcam works well at night.
Solution 2:[2]
Niantic just released the Lightship ARDK in Unity. It is the basis for Pokemon Go. They are slowly releasing more capabilities in the ADRK, so the features you're asking for (called VPS) are not yet out in the wild but are due very soon (Q2, 2022 - possibly May 24). I've been working with it for a few weeks now and it's a powerful and exciting platform in its early stages.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 |