Skip to content

PhilippSchmaelzle/avt_vimba_camera

 
 

Repository files navigation

avt_vimba_camera (ROS1)

This repo contains a ROS driver for cameras manufactured by Allied Vision Technologies. The driver relies on libraries provided by AVT as part of their Vimba SDK.

See the ROS2 version of this README here.

Installation

Dependencies

First, you will need to install the Vimba SDK. Download it from AVT's website here.

Also see the linux vimba installation instructions.

It is highly recommended to open the "Vimba Viewer" tool that came along with the SDK and make sure you can connect to your camera.

It may be useful to create a desktop shortcut to Vimba Viewer:

ln -sf "Vimba_5_0/Tools/Viewer/Bin/x86_64bit/VimbaViewer" "$HOME/Desktop"

ROS Driver

Once you've successfully connected to your camera using Vimba Viewer, you can continue with the ROS driver install:

sudo apt install ros-$ROS_DISTRO-avt-vimba-camera

Operational Advice

MTU Size

If you are using a GigE camera (ethernet-based camera), it is recommended to adjust some settings in your network interface to be able to handle the potentially high bandwidth usage of the camera stream.

On Linux, you will need to increase the MTU (Maximum Transmission Unit) on the network interface attached to the camera.

You can check what your current mtu setting is by running the following command:

ip a | grep mtu

According to AVT documentation, increase the mtu to 9014. If you use Network Manager, this can be done by opening the network interface settings and editing the "MTU" box under the "Identity" tab.

See the "Optimize system performance" section of your camera's technical manual for full details. For example, the Mako camera technical manual is available here.

Receive Buffer Size

It is also recommended to increase your network receive buffer size. By default, Ubuntu uses 212992.

You can check what your current buffer size is:

sudo sysctl 'net.core.rmem_max'

Update the buffer size with the following command:

sudo sysctl -w 'net.core.rmem_max=26214400'

26214400 has been tested successfully, but anything above 2000000 is likely fine.

Once you find a value that works for you, you can make the change permanent (persist across reboots) by updating the /etc/sysctl.conf file with the following line:

net.core.rmem_max=26214400

Camera Settings in General

If you are having difficulty getting the camera to do what you want using the ROS driver, it is suggested to first use Vimba Viewer to play around with settings that work. The Vimba Viewer GUI will help you determine what settings are available to your camera model and help you tune them easier. Once you have settings that you are happy with, save them into your own rosparam file or launch file, and the driver will use those settings every time it launches.

Note that this driver makes use of both ROS parameters and dynamic reconfigure. When the driver first starts, the dyanmic reconfigure server will initialize with all current ROS param values, then trigger a callback to configure the camera. This means ROS params will take precedence and should be the preferred way to save camera configs meant to be reused. After the driver initializes, changes to the parameters can be made using dynamic reconfigure RQT tool (rqt_reconfigure).

ROS Nodes

mono_camera_node

The mono_camera_node is the main driver that connects to the camera, configures it according to ROS parameters/dynamic reconfigure, and starts publishing image frames. The driver uses image_transport to publish image frames, so all expected image topics should be available. See the config file (cfg/AvtVimbaCamera.cfg) for documentation regarding the various parameters that can be used to configure the camera itself. See the launch file (launch/mono_camera.launch) for documentation regarding the operational parameters of the driver.

trigger_node

The trigger_node is a standalone node for sending out ethernet-based action commands to AVT cameras. Action commands are useful for triggering frame captures over ethernet. See AVT's application note for more details. Note that cameras must be configured to receive the action commands in addition to running the trigger_node.

Clock Synchronization

If you wish to use the exact time the image was measured in the header of the ROS messages, it is suggested to use PTP synchronization. PTP will ensure the clock on the camera is synchronized with the computer, so that measurement times are all based off of the same clock. Setting the use_measurement_time parameter will set the ROS header timestamp to the frame timestamp, but it is up to you to make sure the camera clock is synced with the computer. linuxptp is a great tool for PTP synchronization and is suggested for ensuring the camera is in sync with the computer. See the links below for more details on PTP sync.

Useful Technical References and Application Notes

About

ROS1/2 Driver for AVT cameras using VIMBA SDK.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 79.8%
  • C 16.3%
  • Python 2.4%
  • CMake 1.5%