realsense-ros icon indicating copy to clipboard operation
realsense-ros copied to clipboard

D435i how to turn auto exposure ON/OFF on launch?

Open rakshith95 opened this issue 2 years ago • 7 comments

Hello, I'm unable to find a parameter to turn the auto exposure ON/OFF for the D435i cameras. The only way I can do it now is to run rosrun rqt_reconfigure rqt_reconfigure and do it through the GUI, but I wish to do this from a script.

Thank you!

rakshith95 avatar Oct 05 '22 14:10 rakshith95

Hi @rakshith95 Are you able to set enable_auto_exposure with rosrun without accessing the GUI by using the commands below in the ROS terminal during runtime, please

OFF rosrun dynamic_reconfigure dynparam set /camera/stereo_module enable_auto_exposure 0

ON rosrun dynamic_reconfigure dynparam set /camera/stereo_module enable_auto_exposure 1

MartyG-RealSense avatar Oct 05 '22 15:10 MartyG-RealSense

This works, thank you! Why isn't this a launch parameter though?

rakshith95 avatar Oct 05 '22 15:10 rakshith95

Rosparam code for depth and color auto-exposure enable / disable is below.

OFF

<rosparam>
  /camera/rgb_camera/enable_auto_exposure: false
  /camera/stereo_module/enable_auto_exposure: false
</rosparam>

ON

<rosparam>
  /camera/rgb_camera/enable_auto_exposure: true
  /camera/stereo_module/enable_auto_exposure: true
</rosparam>

MartyG-RealSense avatar Oct 05 '22 15:10 MartyG-RealSense

Thank you! Closing this

rakshith95 avatar Oct 06 '22 10:10 rakshith95

@MartyG-RealSense setting the parameters doesn't seem to work for me. The auto exposure is the same status irrespective of setting the parameter to true or false

rakshith95 avatar Oct 10 '22 14:10 rakshith95

The only other way that I know of for setting it in launch instead of rosrun would be to define it in a yaml configuration file and then import the yaml into the launch file, as described at https://github.com/IntelRealSense/realsense-ros/issues/2366#issuecomment-1147104915

MartyG-RealSense avatar Oct 10 '22 14:10 MartyG-RealSense

hi @rakshith95 Do you require further assistance with this case, please? Thanks!

MartyG-RealSense avatar Oct 15 '22 08:10 MartyG-RealSense

No, thank you.

rakshith95 avatar Oct 17 '22 09:10 rakshith95

Thanks very much @rakshith95 for the update!

MartyG-RealSense avatar Oct 17 '22 10:10 MartyG-RealSense

@MartyG-RealSense Hi, I am also facing with an auto exposure problem. I found that when I enable the laser emitter, my d435i cannot auto-exposure correctly. I test it with realsense-viewer. When I enable auto-exposure with emitter off, the actual exposure of infrared image can change with the lighting condition. But once I turn on the emitter (when the infrared camera is on), the actual exposure is freezing and will not change with lighting. In addition, when I turn on the camera with auto-exposure on and emitter on, the actual exposure is fixed at the maximal value at current fps (about 31400 us for 30 fps). I hope to confirm is this normal? Thank you!

chenhanpolyu avatar Mar 08 '23 03:03 chenhanpolyu

Hi @chenhanpolyu How the depth auto-exposure should operate when correct is that exposure can update but the exposure value can no longer update until auto-exposure is disabled. Instead, depth auto-exposure should be read from the camera metadata parameter ACTUAL_EXPOSURE whilst depth auto-exposure is enabled.

MartyG-RealSense avatar Mar 08 '23 10:03 MartyG-RealSense

Take a look on this PR #2612, it mainly for ROS2, but it should be the same solution for ros1 by editing your launch file.

SamerKhshiboun avatar Mar 22 '23 15:03 SamerKhshiboun