Items with no label
3338 ディスカッション

What would cause an unknown error exception to be thrown when calling get_option(RS2_OPTION_GAIN) in Android?

DSams3
ビギナー
1,338件の閲覧回数

I have upgraded my RS415 and RS435 to the latest firmware and I am using librealsense2.28.0. Both of these cameras are throwing an exception when attempting to get/set gain in Android. Get/set exposure option works just fine. I have caught and printed out the exception error, but it is no help. Also, I drilled down in the RS SDK source code and I can see that this error is caught by a catch(...) in translate_exception. I am running my Android app on a Galaxy S10e and a HTC U12+. Also, I am running the exact same code (compiled for Windows) with the cameras connected to a Windows 10 machine with no problems.

0 件の賞賛
1 返信
MartyG
名誉コントリビューター III
1,107件の閲覧回数

I must emphasize first that the Android wrapper is not one of my specialist areas. For expert advice on Android, the RealSense GitHub is a better place to ask. You can do so by visiting the link below and clicking the New Issue button.

 

https://github.com/IntelRealSense/librealsense/issues

 

Getting exposure and gain is slightly complicated. My understanding is that to get a correct response from functions such as RS2_OPTION_GAIN, you should first turn off auto-exposure and use manual values for exposure and gain, otherwise the exposure value does not update correctly. If auto-exposure is on, then it is recommended to retrieve the values from metadata, as described in this link:.

 

https://github.com/IntelRealSense/librealsense/issues/1624#issuecomment-389085387

 

Windows 10 supports metadata by default. In Linux the support has to be patched in. I would imagine that the Android wrapper also does not support it by default either, though I have no firm knowledge of this.

 

Documentation about metadata can be found in the link below:

 

https://github.com/IntelRealSense/librealsense/blob/master/doc/frame_metadata.md

 

For more definitive advice on the subject, I would recommend asking on the GitHub. Good luck!

返信