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

Unable to show depth cloud with compressed RGB

asked 2019-09-15 12:40:21 -0600

mun gravatar image

updated 2019-09-15 17:18:48 -0600

jayess gravatar image


I'm having some trouble showing a depth cloud using /camera/rgb/image_raw/compressed as the colour topic. It just doesn't show in rviz:

image description

However, rostopic list shows the following:


Does anyone how to carry this out? Here's the rosbag.


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2019-09-16 03:18:21 -0600

pavel92 gravatar image

updated 2019-09-16 03:23:10 -0600

You cannot use the /camera/rgb/image_raw/compressed (with sensor_msgs/CompressedImage) topic there since in the plugin the color image topic requires sensor_msgs/Image . You will need to decompress the images and republish them. For example, try using image_transport as suggested in this answer:

rosrun image_transport republish compressed in:=/camera/rgb/image_raw raw out:=/camera/rgb/image_raw

or if you have a launch file just add this:

<node name="republish" type="republish" pkg="image_transport" output="screen" args="compressed in:=/camera/rgb/image_raw raw out:=/camera/rgb/image_raw" />

If you are wondering why the in:topic_name and out:topic_name are the same, it appears that image transport adds /compressed to the in:topic_name image description

edit flag offensive delete link more

answered 2019-09-16 03:44:25 -0600

Choco93 gravatar image

updated 2019-09-16 05:25:23 -0600

I am not sure if directly subscribing to a compressed image topic and displaying it in rviz is possible. You can use image transport to decompress and then visualize the raw image using

rosrun image_transport republish compressed in:=/camera/rgb/image_raw/compressed out:=/camera/rgb/image_raw

Also if you just want to view the image you can use image_view like

rosrun image_view image_view image:=/camera/rgb/image_raw _image_transport:=compressed


rosrun image_transport republish compressed in:=/camera/rgb/image_raw out:=/camera/rgb/image_raw
edit flag offensive delete link more



In this case, the image_transport will throw the following warning:

[ WARN] [1568628376.366592207]: [image_transport] It looks like you are trying to subscribe directly to a transport-specific image topic '/camera/rgb/image_raw/compressed', in which case you will likely get a connection error. Try subscribing to the base topic '/camera/rgb/image_raw' instead with parameter ~image_transport set to 'compressed' (on the command line, _image_transport:=compressed). See for details.

It looks like image_transport is adding /compressed automatically to the input topic. The answer bellow addresses this issue

pavel92 gravatar image pavel92  ( 2019-09-16 05:08:33 -0600 )edit

yes, I removed it from image_view but forgot to remove it from republish node, thanks for correction.

Choco93 gravatar image Choco93  ( 2019-09-16 05:13:41 -0600 )edit

Question Tools



Asked: 2019-09-15 12:40:21 -0600

Seen: 1,578 times

Last updated: Sep 16 '19