neufieldrobotics / spinnaker_sdk_camera_driver

Point Grey (FLIR) Spinnaker based camera driver (Blackfly S etc.)
MIT License
125 stars 91 forks source link
bfs blackfly camera driver flir ros spinnaker

master: Build Status dev: Build Status

spinnaker_sdk_camera_driver

These are the ros drivers for running the Pt Grey (FLIR) cameras that use the Spinnaker SDK. This code has been tested with various Point Grey Blackfly S (BFS) cameras.

Compatibility Matrix

Spinnaker Architecture Ubnuntu 16.04 Xenial +
ROS Kinetic
Ubnuntu 18.04 Bionic +
ROS Melodic
Ubnuntu 20.04 Focal +
ROS Noetic
1.17.0.23 AMD64 :heavy_check_mark: :heavy_minus_sign: :heavy_minus_sign:
1.17.0.23 ARM64 :heavy_check_mark: :heavy_minus_sign: :heavy_minus_sign:
1.24.0.60 AMD64 :heavy_check_mark: :heavy_minus_sign: :heavy_minus_sign:
1.24.0.60 ARM64 :heavy_check_mark: :heavy_minus_sign: :heavy_minus_sign:
2.0.0.147 AMD64 :heavy_check_mark: :white_check_mark: :heavy_minus_sign:
2.0.0.147 ARM64 :heavy_check_mark: :heavy_minus_sign:
2.2.0.48 AMD64 :heavy_minus_sign: :heavy_check_mark: :white_check_mark:
2.2.0.48 ARM64 :heavy_minus_sign:
2.3.0.77 AMD64 :heavy_minus_sign: :x:
2.3.0.77 ARM64 :heavy_minus_sign: :x:

:heavy_check_mark: Tested :heavy_minus_sign: Not Applicable :white_check_mark: Reported to work :x: Known compatibility Issue

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

The pre-requisites for this repo include:

After installing spinnaker, Verify that you can run your cameras with SpinView.

For x86_64 or x86_32 architecture, install the following:


# after installing ros, install other pre-requisites with: 

sudo apt install libunwind-dev ros-kinetic-cv-bridge ros-kinetic-image-transport

For arm64 (aarch64) architecture, install pre-requisites with:

sudo apt install ros-kinetic-cv-bridge ros-kinetic-image-transport

Installing

To install this spinnaker_sdk_camera_driver

mkdir -p ~/spinnaker_ws/src
cd spinnaker_ws/src
git clone https://github.com/neufieldrobotics/spinnaker_camera_driver.git
cd ~/spinnaker_ws/
catkin_make
source ~/spinnaker_ws/devel/setup.bash
# add this to ~/.bashrc to make this permanent 

Running the drivers

Modify the params/test_params.yaml file replacing the cam-ids and master cam serial number to match your camera's serial number. Then run the code as:

# To launch nodelet verison of driver, use #
roslaunch spinnaker_sdk_camera_driver acquisition.launch

# To launch node version of driver, use #
roslaunch spinnaker_sdk_camera_driver node_acquisition.launch

# Test that the images are being published by running
rqt_image_view

Parmeters

All the parameters can be set via the launch file or via the yaml config_file. It is good practice to specify all the 'task' specific parameters via launch file and all the 'system configuration' specific parameters via a config_file.

Task Specific Parameters

node/nodelet Specific Parameters

System configuration parameters

Dynamic Reconfigure parameters

nodelet details

Camera info message details

Multicamera Master-Slave Setup

When using multiple cameras, we have found that the only way to keep images between different cameras synched is by using a master-slave setup using the GPIO connector. So this is the only way we support multicamera operation with this code. A general guide for multi camera setup is available at https://www.ptgrey.com/tan/11052, however note that we use a slightly different setup with our package. Refer to the params/multi-cam_example.yaml for an example on how to setup the configuration. You must specify a master_cam which must be one of the cameras in the cam_ids list. This master camera is the camera that is either explicitly software triggered by the code or triggered internally via a counter at a given frame rate. All the other cameras are triggered externally when the master camera triggers. In order to make this work, the wiring must be such that the external signal from the master camera Line2 is connected to Line3 on all slave cameras. To connect cameras in this way:

GPIO Pinouts for Blackfly S

GPIO Pinouts for Blackfly S

GPIO Connections for Master/Slave config

GPIO Connections for Master/Slave setup

License

This project is licensed under the MIT License - see the LICENSE file for details