Thumb fd1b9352 fbcf 406e 88bd 98d31f121b88

From Zero to Image Robotics Edition

Check out a short tutorial for a ROS-Driver for Basler Cameras to publish images from the cam. Supported are Basler cameras with USB 3.0 and GigE and also the dart cameras. It is developed by Magazino GmbH.

Project State

Public Project

Licences

Software Licence: Project has no software
Hardware Licence: Project has no hardware

Admins

svholdt
StudentCV

Members

jfritsch1984
Imaginghub
harry-hatten
vishwas-gupta
Anvitha

Does this project pique your interest?

Login or register to join or follow this project.

A ROS-Driver for Basler Cameras

developed by Magazino GmbH, using the pylon Software Camera Suite by Basler AG, written for the ROS Wiki  https://raw.githubusercontent.com/magazino/pylon_camera/indigo-devel/wiki_imgs/logos_small.png

 

 

 

Overview

This package offers many functions of the Basler-pylon API inside the ROS-Framwork.

The package supports Baslers USB 3.0, GigE as well as the DART cameras.

Images can continuously be published over /image_raw or the /image_rect topic. The latter just in case the intrinsic calibration matrices are provided through the camera_info_url parameter.

The camera-characteristic parameter such as hight, width, projection matrices and camera_frame were published over the /camera_info topic. Furthermore an action-based image grabbing with desired exposure, gain, gamma and / or brightness is provided. Hence one can grab a sequence of images with above target settings as well as a single image.

Adapting camera's settings regarding binning (in x and y direction), exposure, gain, gamma and brightness can be done using provided set_* services. These changes effect the continuous image acquisition and hence the images provided through the image topics.

The default node operates in Software-Trigger Mode. This means that the image acquisition is triggered with a certain rate and the camera is not running in the continuous mode.

The package opens either a predefined camera (using a given 'device_user_id' parameter) or, if no camera id is predefined the first camera device it can find.

 

Installation

The package has been tested for ROS-Indigo. For other ROS versions, please replace 'indigo' with your desired ROS-Version in the following install instructions.

The pylon_camera-pkg requires the pylonSDK to be installed on your system. In order to build the package, you need to configure rosdep (i.e. the ROS command-line tool for checking and installing system dependencies for ROS packages) such that it knows how to resolve this dependency. This can be achived by executing the following commands:

 

sudo sh -c 'echo "yaml https://raw.githubusercontent.com/magazino/pylon_camera/indigo-devel/rosdep/pylon_sdk.yaml"; > /etc/ros/rosdep/sources.list.d/15-plyon_camera.list'

 

rosdep update

Then, clone the pylon_camera-pkg, and the camera_control_msgs-pkg and install the pylon SDK in your catkin_ws:

 

cd ~/catkin_ws/src/ && git clone https://github.com/magazino/pylon_camera.git && git clone https://github.com/magazino/camera_control_msgs.git

 

rosdep install --from-paths . --ignore-src --rosdistro=$ROS_DISTRO -y

Build the pylon_camera package as you would build a standard ROS-package unsing p.e.

 

cd ~/catkin_ws && catkin_make

 

Parameters

All parameters are listed in the default config file: config/default.yaml

 

Common parameters

camera_frame

  • The tf frame under which the images were published

device_user_id

  • The DeviceUserID of the camera. If empty, the first camera found in the device list will be used

camera_info_url

  • The CameraInfo URL (Uniform Resource Locator) where the optional intrinsic camera calibration matrices are stored. This URL string will be parsed from the CameraInfoManager:

binning_x & binning_y

  • Binning factor to get downsampled images. It refers here to any camera setting which combines rectangular neighborhoods of pixels into larger "super-pixels." It reduces the resolution of the output image to (width / binning_x) x (height / binning_y). The default values binning_x = binning_y = 0 are considered the same as binning_x = binning_y = 1 (no subsampling).

frame_rate

  • The desired publisher frame rate if listening to the topics. This parameter can only be set once at start-up. Calling the GrabImages-Action can result in a higher frame rate.

 

Image Intensity Settings

The following settings do NOT have to be set. Each camera has default values which provide an automatic image adjustment resulting in valid images

exposure

  • The exposure time in microseconds to be set after opening the camera.

gain

  • The target gain in percent of the maximal value the camera supports. For USB-Cameras, the gain is in dB, for GigE-Cameras it is given in so called 'device specific units'.

gamma

  • Gamma correction of pixel intensity. Adjusts the brightness of the pixel values output by the camera's sensor to account for a non-linearity in the human perception of brightness or of the display system (such as CRT).

brightness

  • The average intensity value of the images. It depends the exposure time as well as the gain setting. If '**exposure**' is provided, the interface will try to reach the desired brightness by only varying the gain. (What may often fail, because the range of possible exposure values is many times higher than the gain range). If '**gain**' is provided, the interface will try to reach the desired brightness by only varying the exposure time. If '**gain**' AND '**exposure**' are given, it is not possible to reach the brightness, because both are assumed to be fix.

brightness_continuous

  • Only relevant, if 'brightness' is set: The brightness_continuous flag controls the auto brightness function. If it is set to false, the brightness will only be reached once. Hence changing light conditions lead to changing brightness values. If it is set to true, the given brightness will be reached continuously, trying to adapt to changing light conditions. This is only possible for values in the possible auto range of the pylon API which is e.g. [50 - 205] for acA2500-14um and acA1920-40gm

exposure_auto & gain_auto

  • Only relevant, if 'brightness' is set: If the camera should try to reach and / or keep the brightness, hence adapting to changing light conditions, at least one of the following flags must be set. If both are set, the interface will use the profile that tries to keep the gain at minimum to reduce white noise. The exposure_auto flag indicates, that the desired brightness will be reached by adapting the exposure time. The gain_auto flag indicates, that the desired brightness will be reached by adapting the gain.

 

Optional and device specific parameter

gige/mtu_size

  • The MTU size. Only used for GigE cameras. To prevent lost frames configure the camera has to be configured with the MTU size the network card supports. A value greater 3000 should be good (1500 for RaspberryPI)

gige/inter_pkg_delay

  • The inter-package delay in ticks. Only used for GigE cameras. To prevent lost frames it should be greater 0. For most of GigE-Cameras, a value of 1000 is reasonable. For GigE-Cameras used on a RaspberryPI this value should be set to 11772.

 

Usage

The pylon_camera_node can be started over the launch file which includes a config file with desired parameters as frame rate or exposure time

 

roslaunch pylon_camera pylon_camera_node.launch

or

rosrun pylon_camera pylon_camera_node

Images were only published if another node connects to the image topic. The published images can be seen using the image_view node from the image_pipeline stack:

 

rosrun image_view image_view image:=/pylon_camera_node/image_raw

 

Questions

Please provide your qustions via http://answers.ros.org/questions/ and tag them with 'pylon_camera'

GitHub Repository

https://github.com/magazino/pylon_camera

Commits

Marcel Debout
pushed e2cc087ebb360c98faa20def6ffe9e2bb81476cb
0.10.4
2017-09-11 07:15:07 UTC
Marcel Debout
pushed 03b8f7098b4cd2efc2f53af0caa7dc64bd757940
Regeneration of brightness indices after binning change
2017-09-08 08:36:57 UTC
Marcel Debout
pushed 77ff6de5b8be450e6aba7381873fe9cc723f4b83
0.10.3
2017-08-31 11:46:37 UTC
Marcel Debout
pushed d3cac65b36e97634b1507f122d4ed26f5f80d489
Removed all non-ascii symbols from the changelog
2017-08-31 11:45:35 UTC
Marcel Debout
pushed 1eecfffcb660ae435bfc1498c37d980c036b16df
0.10.2
2017-08-31 10:09:40 UTC
Marcel Debout
pushed 288a315d802525308055c3d10c1ff8ec38f19117
Fixed CHANGELOG.rst
2017-08-31 10:08:34 UTC
Marcel Debout
pushed 4e68957c9334dd684c4b1f6487d62dee56177b73
0.10.1
2017-08-31 09:48:46 UTC
Marcel Debout
pushed 599d91126cad69cef3c2b9a48e88ba0bdb973ae4
Bugfix: gain of 0.0 was rejected due to wrong empty check
2017-08-31 08:47:04 UTC
Markus Grimm
pushed 4116a1dfc3ae55a6ef50003ef368fd4008c7e5a6
CMAKE_INSTALL_RPATH_USE_LINK_PATH for pylon deb
2017-08-09 11:18:18 UTC
Magazino Version Daemon
pushed 17dd21857ff28b72f4022781443b3b5209fa8c7d
0.10.0
2017-07-17 08:17:50 UTC
Magazino Version Daemon
pushed aaa36f8f4f9cec8245738428eba76c0d89ae34ec
Updated message dependencies
2017-07-17 08:14:11 UTC
Magazino Version Daemon
pushed 85c4f7436b65545b1026103d7aef71784daf9fe9
0.9.2
2017-06-26 12:32:41 UTC
Nikolas Engelhard
pushed 883e3051e2f450ab1585d02b54f226e93c3369a0
SW-1177 No longer using node_name as frame_name but keeping frame_name from configuration file
2017-06-26 12:30:57 UTC
Magazino Version Daemon
pushed 76ec8d58e7fb462cf1eebc05eaa04013efbe7774
0.9.1
2017-04-18 15:41:58 UTC
Ulrich Klank
pushed 773cd988fde331cdd3f92dd7958059e1421768aa
removed cv bridge version
2017-04-18 15:40:25 UTC
Magazino Version Daemon
pushed b3bbd0df4c8e554b11b17f24365c6b3e33e59bcd
0.9.0
2017-04-18 07:25:03 UTC
Magazino Version Daemon
pushed d0609408927bf5b9ec71013c63bc1bdee4f4fbf0
Updated message dependencies
2017-04-18 07:23:40 UTC
Magazino Version Daemon
pushed 307afd6cf8af29fae0a3008e7bda882418325c72
0.8.1
2017-04-18 07:22:19 UTC
Ulrich Klank
pushed 8ded6a566f37bd18b4d405d49ccb58b516a7a047
removed cv bridge version
2017-04-18 07:20:36 UTC
Magazino Version Daemon
pushed f991fda3eb9b5569b2a6fe51477f2f25f69c12ad
0.8.0
2017-04-12 19:03:59 UTC
Magazino Version Daemon
pushed f97f5831daeebf8546bfe9717eeb7c58ace505a7
Updated message dependencies
2017-04-12 19:02:39 UTC
Magazino Version Daemon
pushed 67bbe68f4f5cfcb5dd8b0881fb9a6af355b3e9d1
0.7.7
2017-04-12 16:46:34 UTC
Marcel Debout
pushed c76fe4274a11f020ca73ffd972d3a0109fa4b5fb
Force recompile (blank line CMakeLists.txt)
2017-04-12 16:29:47 UTC
Magazino Version Daemon
pushed b3ddf0b9b3e59820dc26bd47c30d86e192de5fd3
0.7.6
2017-04-12 09:02:16 UTC
Marcel Debout
pushed e6441f1f25dcdcd2a4bf435d349d9fccfed0874d
Tested the auto-exp-upprper-lim and adapted fail output
2017-04-12 08:59:35 UTC
Marcel Debout
pushed fbbefd4c5ff9006d1ff2d52d2ce458d5f894a368
Added upper-exp-limit for exp/brightness search
2017-04-11 15:31:39 UTC
Magazino Version Daemon
pushed fb082e20cf51e3d0d3e79f47ab74d5b7557a043e
0.7.5
2017-04-06 14:14:20 UTC
Marcel Debout
pushed 5393828cc0bf9213b541a9a7ab1f3b72b56dee71
Improved smart exp search for values < 50
2017-04-06 09:12:37 UTC
Magazino Version Daemon
pushed 2144ceae880e32572d58eaef875700d71cb82c85
0.7.4
2017-04-06 07:32:21 UTC
Marcel Debout
pushed cbef7b566d3c250c8e385e1a645f1b279a6ac20a
Updated invalid logo path
2017-04-06 07:27:27 UTC

Comments