roboracing-software
roboracing-software copied to clipboard
Auto-Brightness Camera Reconfigure
Goal: A node that will adjust the camera exposure using dynamic_reconfigure to account for the dynamic lighting conditions in a region of interest (ROI) and the node is easily configurable through a launch file.
Notes: Our Flir blackfly camera has very nice auto-exposure capabilities. However, the sky takes up so much of our image and the camera adjusts to see the sky. In contrast, our region of interest in the road. We need a way to adjust to dynamic lighting conditions based on the road portion of the image. There exists a node dynamic_exposure.py, that has the logic to do this and has worked in the past. However, the node was written in less than an hour and thus the launch file for it is broken and the code is unclear. Your job is to rewrite the node in a clean, understandable manner with a working launch file.
New Files Created (at least): <-None->
Files Edited (at least): /rr_platform/src/camera/dynamic_exposure.py
Returning Member Mentor: Brian Cochran @btdubs --Ask him questions! When you believe you have finished the success criteria below, submit a pull request to merge your code into master.
Success Criteria:
- Node launches without crashing using
$roslaunch rr_platform dynamic_exposure.launch
- Node parameters configurable through launch file.
- Able to select region of interest in launch file and visualize in rqt (ROI shown in different color than rest of image).
- When camera pointed at bright area, the node should shorten the camera exposure (darken the image)
- When camera pointed at a dark area, the node should lengthen the camera exposure (brighten the image)
Future Work (if you want to give it a try, but don't waste too much time on it):
- Automatically determine the amount of exposure change per step. In bright conditions, a small step will do nothing. In dark, small step has huge effect. Auto find a good step based on brightness.
- Proportional brightness change. If suddenly the sun were to go out, the camera should react quickly by proportionally setting the step amount of exposure.
Adding a note here. The camera has a set of allowable shutter speeds, so when you attempt to update it, it is possible it doesn't change or solely moves to the closest available value. That is why the current code adds to the current_upage
until there is finally a change. The allowable shutter speeds are not obviously spread out in a linear manner.