Search Issue Tracker

By Design

Votes

3

Found in

2019.4

2020.3

2020.3.17f1

2021.1

2021.2

2022.1

Issue ID

1362877

Regression

No

[Mobile] ARTrackedImage is added/removed multiple times when scanning an image

ARFoundation

-

Reproduction steps:
1. Open the user's attached project "ARTrackedImageFlicker.zip"
2. Go to Assets/Targets and open the first image
3. Build and Run on the device
4. Click Load Images in the device's bottom-right corner
5. Scan the first image which is opened in the Editor
6. Observe the logs

Expected result: ARTrackedImage is added and removed
Actual result: ARTrackedImage is removed and added multiple times

Reproducible with: 2019.31f1, 2020.3.20f1, 2021.1.24f1, 2021.2.0b15, 2022.1.0a12

Reproduces with these devices:
VLNQA00264, Samsung Galaxy S10+ (SM-G975F), Android 10, CPU: NOT FOUND, GPU: Mali-G76
VLNQA00318, Oneplus 7Pro (GM1913), Android 10, CPU: Snapdragon 855 SM8150, GPU: Adreno (TM) 640
VLNQA00231, Huawei HUAWEI Mate 20 Pro (LYA-L29), Android 9, CPU: HiSilicon Kirin 980, GPU: Mali-G76

Could not test with:
VLNQA00078, Motorola Nexus 6 (Nexus 6), Android 7.1.1, CPU: Snapdragon 805 APQ8084AB, GPU: Adreno (TM) 420(Project could not open)
----------, Huawei - (ELS-NX9), Android 10, CPU: NOT FOUND, GPU: Mali-G76(No Google Play Services for AR)

Notes:
-User tested devices that reproduced the issue:
iPad (6th Generation), iPhone 12 Pro Max, iPhone X
Samsung Galaxy S8, Samsung Galaxy S8+, Samsung Galaxy S21 Ultra

  1. Resolution Note (2022.1.X):

    Whenever a job of adding an image to a "RuntimeReferenceImageLibrary" finishes, it sets the AR session config to dirty. This triggers an update of the configuration by ARCore. ARFoundation poll every frame to see what’s in the list of tracked images by ARCore. If ARCore stop reporting on a tracked image, then ARFoundation will report it as having been removed. So, if ARCore is removing the tracked image after a configuration update triggered due to image addition then ARFoundation removes it as well.

    Adding a snippet from Android Logcat for reference. Notice how "Removed: 000bb3614053f7f1b04d859088156e64" is listed after a configuration update.

    ------------------------------------------------------------------------------------------------------------------------
    4475 5918 Verbose Unity-ARCore Configuration will be updated with these features enabled:
    4475 5918 Verbose Unity-ARCore RearCamera
    4475 5918 Verbose Unity-ARCore PositionAndRotation
    4475 5918 Verbose Unity-ARCore ImageDetection
    4475 5918 Verbose Unity-ARCore AutoFocus
    4475 5918 Verbose Unity-ARCore OnBeforeSetConfiguration
    4475 5918 Verbose Unity-ARCore AugmentedImageDatabase: 0xb400007745580350
    4475 5918 Verbose Unity-ARCore LightEstimationMode: 0
    4475 5918 Verbose Unity-ARCore PlaneFindingMode: 0
    4475 5918 Verbose Unity-ARCore UpdateMode: 0
    4475 5918 Verbose Unity-ARCore FocusMode: 1
    4475 5918 Verbose Unity-ARCore AugmentedFaceMode: 0
    4475 5918 Verbose Unity-ARCore DepthMode: 0
    4475 5918 Verbose Unity-ARCore InstantPlacementMode: 0
    4475 5918 Info native I1117 22:04:30.326650 5918 session.cc:559] Session::CheckAndWriteCurrentConfig returning OK.
    4475 5918 Warn Unity Removed: 000bb3614053f7f1b04d859088156e64
    4475 5918 Warn Unity ARController:OnTrackedImagesChanged(ARTrackedImagesChangedEventArgs)
    4475 5918 Warn Unity System.Action`1:Invoke(T)
    4475 5918 Warn Unity UnityEngine.XR.ARFoundation.ARTrackedImageManager:OnTrackablesChanged(List`1, List`1, List`1)
    4475 5918 Warn Unity UnityEngine.XR.ARFoundation.ARTrackableManager`5:Update()
    ------------------------------------------------------------------------------------------------------------------------

    This behavior is govern by ARCore and not in control of ARFoundation. The issue will not appear if the scanning of an image is done after all the images are done loading.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.