google-ar / arcore-android-sdk

ARCore SDK for Android Studio
https://developers.google.com/ar
Other
4.91k stars 1.2k forks source link

Error in getMillimetersDepth() #1625

Open wasimsafdar opened 7 months ago

wasimsafdar commented 7 months ago

I am getting an error in getMillimetersDepth() function for some x and y values. The error is "1 buffers were freed while being dequeued". I am mapping camera coordinates into Depth Image coordinates and getting an error. For example, if I map [100,100] then I am getting [25,9] as Depth Image coordinates and use these values to get depth then I am getting depth for different frames. However, if I use [500,500] as camera coordinates and convert them into Depth Image coordinates then I get a above mentioned error error. Now the issue is that may be buffer at that specific coordinate was dequeued but how can we know that it is dequeued because 1 way of doing is that you just move to other coordinates. Is there any way that we can know that buffer is dequeued or we can check it's value? For example here in getMillimetersDepth() function.

val buffer = plane.buffer.order(ByteOrder.nativeOrder())