This hrl_camera package was designed simpler usage and management of cameras. It includes 3 components. First, it includes scripts for making cameras accessible over ROS. Second, it provides a method to uniquely reference different cameras. Finally, it provides a python interfrace for cameras to be accessed using Python code.
In Python, to use cameras declared in this package's camera_config.py:
import hrl_camera.hrl_camera as hc camera_object = hc.find_camera('CAMERA_NAME')
The function find_camera takes as input a string, looks up that string in the dictionary declared in camera_config.py, then instantiate and returns an object of the appropriate class.
For the above steps to work, each entry in camera_config.py needs to be a dictionary entry mapping from a human friendly name (CAMERA_NAME in the above snipplet) to a dictionary of parameters containing the keys 'class' and 'uuid'. The value specified by 'class' must be the Python legal class name of the object that needs to be instantiated and must be in the PYTHON_PATH of the process that executes find_camera. The value in 'uid' should be the camera's UID provided by the utility camera_uid.py.
To be compatible with this package new camera classes needs to have an __init__() method that takes in the configuration dictionary defined in camera_config.py. For examples, look at dragonfly2.py and firefly.py.