Internal:Using Gstreamer and UDP to offload computational demands
From Brown University Robotics
Revision as of 02:53, 8 September 2010 by Chriscrick
The Gstreamer UDP node
On a netbook computer with a webcam installed, run the following:
gst-launch-0.10 v4l2src device=/dev/video0 ! jpegenc ! rtpjpegpay ! udpsink port=1234 host=192.168.0.105
Where port and host correspond to an arbitrary selected port number and the IP address of the computer you will be using as your processing node, and device is the device address assigned to the camera you wish to use.
On that computer, set your GSCAM_CONFIG variable thus:
export GSCAM_CONFIG="udpsrc port=1234 caps=\"application/x-rtp, media=(string)video\" ! rtpjpegdepay ! jpegdec ! ffmpegcolorspace ! video/x-raw-rgb ! identity name=ros ! fakesink"
Again, the port number is whatever arbitrary one you selected above. Now, as far as ROS is concerned, the imagery is coming from a local camera, and whatever processing you wish to do can be done on an arbitrarily powerful machine. This can be combined with a BAM module, for instance, for robot control.