Repository: AR-js-org/AR.js

Issue #547: Location Based AR (AFRAME) android - gps-entity-place floating in random spaces, relative to starting orientation. It works okey on iOS.
Created: 2023-06-18T10:02:57Z
Do you want to request a feature or report a bug?
a bug


What is the current behavior?
Location Based AR (AFRAME) doesn't work on android
I've used this repository several times last year. All these apps stopped working on android.
The camera on device turns on, but objects gps-entity-place or gps-new-entity-place are floating in random positions.
Location based AR still works great on iphone, but is messed up on android. I've checked on several devices: samsung S22, Samsung S8, Samsug S7.
In general it seems that the location of points is related to a direction in which I start the app.
Of course I've tried to run current Location Based example, with the newest library versions (both aframe and ar-js (aframe-ar-nft.js, aframe-ar.js)
If the current behavior is a bug, please provide the steps to reproduce.
Just run   Location Based Example from this github page. It will work great on iOS, but entities will be floating in wrong positions on Android.


Please mention other relevant information such as the browser version, Operating System and Device Name
Any android and chrome. In particular: Samsung S22, model name SM-S901B/DS, Android 13, Chrome: 114.0.5735.61
What is the expected behavior?
Displaying gps-entity-place or gps-new-entity-place in correct positions, exactly how it works on iOS.

Duplicate issue #566: In location based AR, I am not able to walk around the 3-D model.
Created: 2023-09-08T19:08:08Z
Do you want to request a feature or report a bug?
Report a bug


What is the current behavior?
When I create and run the AR.js app for goe-location-based AR model rendering, the model rendered stays there, and when I move towards it, it moves back. By this I mean, am not able to move around the model as the model keeps facing me. Is this expected ? I am trying out in Bangalore, India.
If the current behavior is a bug, please provide the steps to reproduce.


Please mention other relevant information such as the browser version, Operating System and Device Name
Tested this in chrome & safari on phone
What is the expected behavior?
I should be able to move around the model
If this is a feature request, what is motivation or use case for changing the behavior?
Not a feature
Code:
<script lang="ts">
    let testEntityAdded = false;

    window.onload = () => {
        const el = document.querySelector("[gps-new-camera]");

        el.addEventListener("gps-camera-update-position", (e: any) => {
            if(!testEntityAdded) {
                alert(`Got first GPS position: lon ${e.detail.position.longitude} lat ${e.detail.position.latitude}`);
                // Add a box to the north of the initial GPS position
                const entity = document.createElement("a-entity");
                entity.setAttribute("scale", {
                    x: 10, 
                    y: 10,
                    z: 10
                });
                entity.setAttribute('animation', "property: rotation; to: 0 360 0; easing: linear; loop: true; dur: 10000" );
                entity.setAttribute('gltf-model', './assets/models/pokemon/movie_camera.glb' );
                entity.setAttribute('gps-new-entity-place', {
                    latitude: e.detail.position.latitude + 0.0005,
                    longitude: e.detail.position.longitude
                });
                document.querySelector("a-scene").appendChild(entity);
            }
            testEntityAdded = true;
        });
}
</script>


<a-scene vr-mode-ui='enabled: false' arjs='sourceType: webcam; videoTexture: true; debugUIEnabled: false' renderer='antialias: true; alpha: true'>
    <a-camera gps-new-camera='gpsMinDistance: 2'></a-camera>
</a-scene>

Libraries Used:
<script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script>
 <script type='text/javascript' src='https://raw.githack.com/AR-js-org/AR.js/master/three.js/build/ar-threex-location-only.js'></script>
 <script type='text/javascript' src='https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js'></script>

Closing comment (2023-12-26T18:12:52Z): I don't think this is anything to do with the Southern Hemisphere, but possibly inherent limitations in the sensors of specific devices and/or iOS-related bugs. Perhaps related to #547 #552 #590? We haven't yet identified a definite cause as the occurrence is rather random, which suggests it's a device-specific issue.
GPS only has a certain accuracy though, being able to "walk around" a model on GPS alone is unlikely to work as GPS isn't that accurate.