Closed juj closed 5 years ago
Tested on Huawei Nexus 6P (Android 8.1.0, API 27) with
I native : version_check.cc:23 ARCore Version: APK version:1.5.180910096
I native : version_check.cc:24 ARCore Version: emulated SDK version:1.5.180815000
I third_party/arcore/ar/core/android/sdk/session_create.cc: ARCore Version: SDK build name: 1.5
Thank you for this report, we're attempting to reproduce this behavior. Given the thoroughness of your report though I suspect this is a real bug.
We've been able to reproduce this issue and should have it fixed in the next major release (1.6). Thanks again for pointing this out.
This is fixed in ARCore 1.6 which was released yesterday.
To continuously print out the number of currently tracked planes in an application, one can write
in a frame update loop, which works well. This starts off printing
n:0
, thenn:1
as a plane is picked up, and thenn:2
after a second plane is found and so on, like expected. This code pattern is what thehello_ar_c
sample does.However, reading documentation for
ArSession_getAllTrackables()
at https://developers.google.com/ar/reference/c/group/session#group__session_1ga40d6d589ca361ceba8a1c39e1404b8ad, it says the following aboutout_trackable_list
:which suggests that the above kind of code pattern that
hello_ar_c
sample uses is a bad practice, and one should essentially create ArTrackableLists and ArAnchorLists only once and reuse them per frame, instead of creating and destroying them each frame. The above code thus transforms towhich should behave the same, and be more performant and a better practice? However, after doing this transformation, the print
n: <number>
will go wild, and after a few seconds of running, the list will grow to thousands of elements. It looks like the implementation ofArSession_getAllTrackables()
does not clear the existing list of planes, contrary to the documentation suggesting it should?I have not been able to test, but I wonder if the function
ArSession_getAllAnchors()
has the same bug, it at least has the same documentation "If previously used, the list will first be cleared." (https://developers.google.com/ar/reference/c/group/session#arsession_getallanchors)