Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

If you separate your camera driver and the image processing into two nodes (as i think it's the most common pattern when using ROS) you can e. g. record the images of your camera driver into a ros bag file and then replay the recorded images for testing your image processing algorithm as often as you like without having to be connected to any physical camera device/robot hardware. The main advantage of using ros for such approach is that for your processor node it will be completely transparent from where the images are coming (rosbag/real camera/whatever). You do not have to change any line of code in your processor node for running it with rosbag or with the camera driver.

The drawback of two nodes is of course that the image data will be copied when it is published from driver to processor node. This might have some computational costs, exp. for images at high resolution/frame rate. But you can even overcome this problem if you put your driver and processor into nodelets (http://wiki.ros.org/nodelet) and use shared_ptrs when for the publish/subscribe methods/calbacks. This implements separable code without unrequired copies.