How to run image_view with compression

asked 2020-03-14 20:33:41 -0500

Cerin gravatar image

How do you run an image_view node so that it uses compression when consuming data from a usb_cam node?

The usb_cam wiki says it "Uses the image_transport library to allow compressed image transport", so I thought all I had to do was simply specify image_transport:="compression", but that doesn't seem to work.

If I run the standard roslaunch usb_cam usb_cam-test.launch, which runs a usb_cam node and a image_view node without compression, that correctly generates a window showing webcam video.

However, if I modify that so that the image_view node explicitly uses compression, with the launch file:

  <node name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="screen" >
    <param name="video_device" value="/dev/video0" />
    <param name="image_width" value="640" />
    <param name="image_height" value="480" />
    <param name="pixel_format" value="yuyv" />
    <param name="camera_frame_id" value="usb_cam" />
    <param name="io_method" value="mmap"/>
  <node name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen">
    <remap from="image" to="/usb_cam/image_raw"/>
    <param name="autosize" value="true" />
    <param name="image_transport" value="compressed" />

it runs the usb_cam node, but the image_view node immediately exits with just the output:

[ INFO] [1584235215.892228366]: Initializing nodelet with 4 worker threads.
[ INFO] [1584235216.181954413]: Using transport "compressed"

Why is this?

edit retag flag offensive close merge delete