Skip to content

Building: GigE Camera Support

Christopher Canel edited this page Sep 5, 2018 · 1 revision

This document is about how to get GigE cameras (PtGray and AlliedVision) work with SAF. The guide should also work for other industrial cameras such as USB3 cameras. SAF is tested on these cameras:

And on these platforms:

Setting up PtGray cameras

This section will guide you through how to use the gige application with PtGray cameras.

Get the FlyCapture SDK

  • Download the FlyCapture SDK from PtGray's website, you need to download the correct version for your platform. For Tegra, you need to download the armv7 version if running 32 bit OS, and armv8 version if running 64 bit OS. TODO: link to the download page of the SDK.
  • Install the SDK to somewhere on the system, noted as PtGray_HOME. Under PtGray_HOME you should have an include directory and a lib directory which contain the header files and library files respectively.
  • It is highly recommended to check the installation of the SDK by running the official example binaries such as FlyCapture2Test

Compile SAF with FlyCapture SDK

  • Reconfigure the build with cmake [YOUR OPTIONS] -DUSE_PTGRAY=true -DPtGray_HOME=/path/to/your/FlyCaptureSDK, you should see FlyCapture YES from the config summary.
  • Then re-build the gige app with make gige

Control and record using the gige application

  • Add the camera entry in cameras.toml, the video URI of the camera is either pgr://[CAMERA INDEX] or pgr://[IP_ADDR]. [CAMEREA_INDEX] starts from 0, [IP_ADDR] is the IP address of the camera.
  • Run apps/gige. Use apps/gige -h to see the options
  • Refer to section Control GigE cameras with apps/gige to see the usage of the application

AlliedVision

Get the Vimba SDK

  • Download the Vimba SDK from AlliedVision website. The official Vimba SDK cannot work on armv8 (64-bit arm), they are planning to release the 64-bit version.
  • Follow the instructions by AlliedVision to install the SDK.
  • You should try the vimba viewer application to make sure you can get images from your camera.

Compile SAF with Vimba

  • Reconfigure the build with cmake [YOUR OPTIONS] -DUSE_VIMBA=true -DVIMBA_HOME=/path/to/your/VimbaSDK, you should see Vimba YES from the config summary.
  • Then re-build the gige app with make gige

Control and record using the gige application

  • Add the camera entry in cameras.toml, the video uri of the camera is either vmb://[CAMERA INDEX] or vmb://[IP_ADDR]. [CAMEREA_INDEX] starts from 0, [IP_ADDR] is the ip address of the camera.
  • Run apps/gige. Use apps/gige -h to see the options
  • Refer to section Control GigE cameras with apps/gige to see the usage of the application

Control GigE cameras with apps/gige

The gige command line application is used to control, capture and record using GigE cameras. use gige -h to show command line arguments.

gige -h

When the display is enabled (-d), a real-time viewer window will be displayed, a list of camera parameters will be listed on the left. There is a uppercase letter for each parameter, for example, E for exposure. For each parameter, typing the lowercase corresponding letter will decrease the value of that parameter, and typing the uppercase letter will increase the value of that parameter (type E to increase exposure, and e to decrease exposure). h and H controls image size. R will record video using current parameters, individual video frames will be stored in the folder named with the camera name and current timestamp. r will stop the recording. Notice that no parameter is allowed to be changed during recording.

TODO: add a screenshot

Best practices of OS settings

To get maximum frame rate for GigE cameras, it is crucial to set a large network buffer size as the sensor data is transmitted through ethernet.

  • For PtGray cameras, set up the buffer size following this link. Please look at the troubleshooting section at the end about increasing socket buffer size.
  • For AlliedVision cameras, set up the buffer size following the Vimba manual (you should have a copy of the manual when you purchase the camera, you can also find a copy here). In the manual, search for MTU, there is a section on how to increase MTU.

General guide to connect GigE cameras with a board

For a GigE camera, you need to connect the camera with a PoE switch, make sure you are connecting to the PoE port (some ports on the switch might not provide power) on the switch. To get maximum bandwidth to transfer large frame at a high frame rate, you should also use a 1G switch.

Once you connected the cameras, then connect the board to the same switch.

The board and the cameras have not been assigned IP addresses yet, because the switch itself may not run a DHCP server so no IP address is assigned to any device. The solution would be to connect the switch to a network that could assign an IP address, such as a router.

Now the cameras and the board are connected to the same local network.