|Note: This tutorial assumes that you have completed the previous tutorials: ROS tutorials, Connecting to an IEEE 1394 Camera, Setting Dynamic Parameters.|
|Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.|
How to Configure IEEE 1394 Camera FeaturesDescription: This tutorial explains how to set IIDC feature parameters for an IEEE 1394 digital camera.
Tutorial Level: BEGINNER
Next Tutorial: Camera Calibration
If the camera produces color images, show the color output from image_proc:
$ rosrun image_view image_view image:=camera/image_color
For a monochrome camera, show the image_mono topic, instead:
$ rosrun image_view image_view image:=camera/image_mono
The IIDC specification lists a number of optional features that may be provided by conforming camera implementations. These are currently supported by the driver as parameters:
While the standard mentions the names of these features, it does not define what they do. Consult the technical specifications of the camera: manufacturers have great latitude in determining which features to support, what values they can take, and the meanings of those values.
Feature Control States
For each supported feature there is a corresponding auto_ parameter (auto_brightness, auto_exposure, etc.) providing user control. Different cameras handle these controls in various ways. Most do not support them all.
The possible control states are:
Off (0): turns the feature off
Query (1): returns the current mode and (if possible) the value of the feature, with no change to the device
Auto (2): the camera sets the value continuously
Manual (3): sets a specific value from the corresponding parameter
OnePush (4): the camera sets the value once, then holds it constant
None (5): the camera does not provide this feature
The Query control is not an actual camera mode, but rather a command to the driver that returns the current camera mode and possibly its value (if available). This is the default initial setting of all these control parameters, which causes all the current camera settings to appear in the GUI.
Many cameras provide an Auto mode for some features, adjusting them to reasonable settings. It's worthwhile to try setting the control state to Auto. If that feature does not support Auto mode, its control state will quickly revert to the previous setting.
If the Auto settings are not to your liking, Query the current value, then change the mode to Manual. If the feature has no Manual mode, that update may fail, but it should work with most devices. If Manual mode is available, try different values using the slider, or by typing a number into the value box followed by the Enter key.
Camera features advertise minimum and maximum value limits. The driver is not currently able to expose those limits directly in the GUI. But, values set via Manual mode will be clipped to fall in the allowed range, the modified value being updated in the appropriate GUI entry.
For some computer vision applications it is confusing when the camera changes its settings during operation. A few cameras provide features with a OnePush mode to address this problem. OnePush causes the camera to adjust the feature automatically, then lock in the value selected. This differs from Auto, which will continue to make adjustments if lighting conditions change.
Although many cameras do not provide OnePush, it is often possible to perform the same task manually. That only works if the camera provides both Auto and Manual modes for the feature in question, and can return the correct value for a Query command:
Wait until the picture stops changing, then Query the value
Select Manual to lock in that value
Note that Auto mode generally changes settings very gradually. The feature value may continue to change slightly even after the picture appears stable. If that matters for your application, repeat the Query and wait for the value to stop changing before switching to Manual.
Using the Parameter Server
All these parameters can be configured via the normal ROS parameter server mechanism. Both the driver and the dynamic reconfigure GUI get their initial values from the parameter server, and update it whenever a value changes.
For IIDC features, don't forget to set the control state to Manual (3), otherwise the corresponding value will be ignored unless the device is already in the Manual state when the driver starts.
To set brightness to 256 on the command line:
$ rosrun camera1394 camera1394_node _auto_brightness:=3 _brightness:=256.0
To set the same value in a launch file: