To learn how to use the existing republish node to change an image transport type (ie compress and decompress image streams), scroll down the image_transport package page to the Nodes section.
Otherwise, continue reading this page.
Before starting any of the image_transport tutorials below, take the time to create a scratch package to work in and manipulate the example code. Create a sandbox package with the following dependencies:
$ roscreate-pkg learning_image_transport image_transport cv_bridge
Make sure that the learning_image_transport directory is included in your ROS_PACKAGE_PATH and build it:
$ rosmake learning_image_transport
$ mkdir -p ~/image_transport_ws/src $ cd ~/image_transport_ws/src $ source /opt/ros/indigo/setup.bash $ catkin_create_pkg learning_image_transport image_transport cv_bridge
Make sure to include the correct setup file, in the above example it is for ROS Indigo on Ubuntu and for bash. Once you have created the empty package, build it:
$ cd ~/image_transport_ws $ rosdep install --from-paths src -i -y --rosdistro indigo $ catkin_make $ source devel/setup.bash
- Writing a Simple Image Publisher (C++)
This tutorial shows how to publish images using all available transports.
- Writing a Simple Image Subscriber (C++)
This tutorial shows how to subscribe to images using any available transport. By using the image_transport subscriber to subscribe to images, any image transport can be used at run-time. To learn how to actually use a specific image transport, see the next tutorial.
- Running the Simple Image Publisher and Subscriber with Different Transports
This tutorial discusses running the simple image publisher and subscriber using multiple transports.
- Managing Transport Plugins
This tutorial covers how to discover which transport plugins are included in your system and make them available for use. No programming required!
- Writing a New Transport
This tutorials covers how to write publisher and subscriber plugins for a new image transport option.