librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

How to control the exposure and gain and the switch of emitter by programming instead of realsenseviewer?

Open GloriousTan opened this issue 8 years ago • 5 comments


Required Info
Camera Model D400
Firmware Version (05.08.15.00)
Operating System & Version ubuntu 16.04
Kernel Version (Linux Only) 4.13.0
Platform PC
SDK Version { legacy / 2.<10>.<4> }

Issue Description

How to control the exposure and gain and the switch of emitter by programming based on sdk 2.0 instead of realsenseviewer?

GloriousTan avatar May 07 '18 04:05 GloriousTan

Hi @Destinyzc Check out controlling the laser, exposure and gain can be controlled in a similar way.

dorodnic avatar May 07 '18 05:05 dorodnic

@dorodnic I tried the control of laser, and it's helpful. Thank you~ But for exposure and gain, can you give more information? I can't find something similar.

GloriousTan avatar May 07 '18 07:05 GloriousTan

Try using the same API calls, but replace RS2_OPTION_EMITTER_ENABLED with RS2_OPTION_EXPOSURE and RS2_OPTION_GAIN. You can use get_option_range function to discover the valid range of values for each option.

dorodnic avatar May 07 '18 09:05 dorodnic

@dorodnic It works perfectly! Thank you very much!

GloriousTan avatar May 07 '18 09:05 GloriousTan

yes i already turned the automatic exposure Off. i used the mentioned api: depth_sensor.set_option(RS2_OPTION_EXPOSURE, range.max) to correctly set the exposure for the IR camera......but i would like to do the same thing for the RGB camera, is there something equivalent to: auto depth_sensor = selected_device.firstrs2::depth_sensor();

to get the rgb_sensor instead of the depth_sensor ?

Thanks

HamdiBouchech avatar Feb 07 '19 12:02 HamdiBouchech