ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to deactivate image_transport plugins?

asked 2017-03-02 02:04:35 -0500

Stanley666 gravatar image


I would like to deactivate image_transport plugins from a launch file. My robot has many cameras and I am not using the compressed images. It would save CPU time if I can do that. I would prefer a solution involving a launch file since other members of my team may use those compressed images. If you have no solution with a launch file, I am open to any suggestion.

Thanks in advance


edit retag flag offensive close merge delete


I'm going to take a look at adding this feature to image_transport. Though I believe in your case the compression is not actually performed unless there is a subscriber on that topic, so there shouldn't be much cpu load (but it still would be nice to disable undesired plugins).

lucasw gravatar image lucasw  ( 2017-03-17 17:39:27 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-03-17 18:47:07 -0500

lucasw gravatar image

updated 2017-11-13 15:07:43 -0500 hydro-devel branch now has a disabling plugins feature merged in:

rosparam set /camera/image/disable_pub_plugins "['image_transport/compressedDepth', 'image_transport/theora']"
rosrun image_transport_tutorial my_publisher

And also the launch file equivalent:

<node name="my_publisher" pkg="image_transport_tutorial" type="my_publisher" />
<group ns="camera/image" >
  <rosparam param="disable_pub_plugins">
    - 'image_transport/compressedDepth'
    - 'image_transport/theora'
edit flag offensive delete link more


Hi there, this might be a silly question, but is this working on ros-kinetic?

bpinaya gravatar image bpinaya  ( 2019-12-04 07:28:39 -0500 )edit

I just tested it in kinetic on ubuntu 16.04 and it does work. Most likely there is a mismatch between your actual image topic and the namespace you are setting disable_pub_plugins in.

lucasw gravatar image lucasw  ( 2019-12-04 09:32:33 -0500 )edit

you can also just uninstall the unnecessary image_transport pluggins like:

sudo apt-get remove ros-melodic-theora-image-transport
sudo apt-get remove ros-melodic-compressed-image-transport
sudo apt-get remove ros-melodic-compressed-image-transport
darshb34 gravatar image darshb34  ( 2020-07-10 02:18:47 -0500 )edit

@lucasw where i must put the first few lines of your solution, sorry I dont get it. I found only the header files and changed the commits there, but cant find the image_transport.cpp and the publisher.cpp. Would be glad if you can help me with that

Petros ADLATUS gravatar image Petros ADLATUS  ( 2022-05-18 07:08:26 -0500 )edit

You need to set the disable_pub_plugins list parameter in the namespace of your camera, in my example above the namespace is camera/image. Probably you want to set in your launch file, you shouldn't have to change any header or cpp files.

At some point I'll add a dynamic reconfigure solution so they can be toggled on and off live.

lucasw gravatar image lucasw  ( 2022-05-19 12:11:27 -0500 )edit

thank you for your answer, so i miss probably the namespace just use rosparam. sound good with the option to switch it manually :)

Petros ADLATUS gravatar image Petros ADLATUS  ( 2022-05-20 00:40:14 -0500 )edit

Question Tools



Asked: 2017-03-02 02:04:35 -0500

Seen: 5,722 times

Last updated: Nov 13 '17