Balluff - BVS CA-GX0 / BVS CA-GX2 Technical Documentation
|
If you are planning to use Balluff/MATRIX VISION GenICam™ devices in a ROS-application, we recommend to use two packages, maintained by the Roboception GmbH:
Since these packages can be a solid foundation for your ROS project, the following chapters describe how you can use them.
apt install ros-noetic-rc-genicam-api ros-noetic-rc-genicam-camera
if you are using ROS Noetic Ninjemys)To test your setup, you may use the gc_info command-line tool, that comes with the rc_genicam_api package. This tool will use the GenICam Transport Layer that is found within the GENICAM_GENTL64_PATH. A first step might be to list all available devices:
gc_info -l
The output should look similar to this:
The GenICam Transport Layer assigns an individual DeviceID to all devices, which can be used to address the device.
Start the node with the command:
rosrun rc_genicam_camera rc_genicam_camera _device:=DeviceID_from_step_before
With this setup, the node will publish images to the topic /image_raw. You can now use the tool of your choice to view the image data, for example RQT, that comes with the ROS distribution.
The rc_genicam_camera node accepts an optional config file on startup, to launch the device with a defined setup. There is some more information about this file on the GitHub page of rc_genicam_camera, but in short it is a list of <property>=<value>, using one line per property. The contents of this file could look like this:
# A comment line
Width=720
Height=480
ExposureAuto=Continuous
mvExposureAutoUpperLimit=20000
To launch the node with the config file, simply append it to the rosrun call:
rosrun rc_genicam_camera rc_genicam_camera _device:=DeviceID _config_file:=/path/to/config/file
To request a list of all available properties that are accepted by the device, use the gc_info tool again. Calling
gc_info DeviceID
will return a list, that contains all registered properties:
You may also use ImpactControlCenter to search for available properties. There, you can find the possible options within the GenICam tree. If you are uncertain about valid values for a property, right click on it and choose 'Detailed Feature Information'.
Many properties can be changed while the device is already streaming. This can be accomplished with the set_genicam_parameter-service, offered by the rc_genicam_camera node. For testing, you may try to use the rosservice command. Call rosservice list to see all available services.
To set a property, e.g. the mvExposureAutoUpperLimit, execute:
rosservice call /rc_genicam_camera/set_genicam_parameter 'mvExposureAutoUpperLimit=10000'
This will attempt to set the mvExposureAutoUpperLimit property to the provided value and return 0 if successful.
Another service, get_genicam_parameter is available to read values from properties. E.g. if you want to get the image width, you could execute
rosservice call /rc_genicam_camera/get_genicam_parameter 'Width'
For a more detailed description of the services, have a look at the rc_genicam_camera Github page.