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

Unable to show depth cloud with compressed RGB

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

mun gravatar image

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

jayess gravatar image

Hi

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:

/camera/depth_registered/camera_info
/camera/depth_registered/image_raw
/camera/rgb/camera_info
/camera/rgb/image_raw/compressed
/clicked_point
/clock
/initialpose
/move_base_simple/goal
/rosout
/rosout_agg
/tf
/tf_static

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

Thanks

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

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

pavel92 gravatar image

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

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
1

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

Choco93 gravatar image

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

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

EDIT:

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

Comments

1

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 http://ros.org/wiki/image_transport 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 -0500 )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 -0500 )edit

Question Tools

2 followers

Stats

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

Seen: 1,619 times

Last updated: Sep 16 '19