Setting the Camera Parameters
by Zixin Jiang
This is a quick guide to set the camera parameters such as contrast or brightness. This is particularly helpful for improve callback image quality.
Prerequisite
- A robot with a camera
- VNC
Basic Steps
Get the appropriate value
- Connect and launch your robot.
- Once your robot is ready, open vnc and run
rqt
. You can adjust the parameters with sliders in this window. - In a seperate terminal, run
rqt_image_view
. This will shows the camera call back image with any updated parameters. - However, any modification on parameters using this method is not going to save to robot. Thus, all the changes will be set back to default when you launch the robot again.
- Record all the changes you make, including the parameter name and value, such as "contrast" and "73".
Store the change to launch file.
- Connect to your desired robot, but don't bring it up. Locate to the launch file directory in the onboad terminal with following command:
- Copy the .launch file we usually use for bringup the robot with comment 'cp'.
- Open the new .launch file (let's call it new.launch), and modify the following lines: Add
<arg name=”contrast” value=”73”/>
between<include>
block. Change the contrast and 73 to the parameter and value you want. - Save the .launch file.
- Nevigate to camera launch folder with the follow command
- Since from the previous launch file we find that the camera is launched with file "camerav2_410x308_30fps.launch", we open this file and add the following change:
- And under the
<node type="raspicam_node">
, we add the following line: - Finally, launch the robot with the new launch file instead of the default one.