How to control the exposure and gain and the switch of emitter by programming instead of realsenseviewer?
| 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?
Hi @Destinyzc Check out controlling the laser, exposure and gain can be controlled in a similar way.
@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.
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 It works perfectly! Thank you very much!
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