How to sensor_msgs/CompressedImage to sensor_msgs/Image

asked 2022-06-09 06:08:00 -0500

shuto gravatar image

updated 2022-06-21 21:43:45 -0500

Hi, I tried the following method.

rosrun image_transport republish compressed in:=ego/image_raw_compressed out:=ego/image_raw

/ego/image_raw is displayed safely in the rostopic list.

However, the message is not displayed. I'm in trouble.

There is no response when doing rostopic echo /ego/image_raw and rostopic hz /ego/image_raw .

If you are kind, please give me a solution.

Added(2022/6/22): Result of rostopic echo ego/image_raw_compressed | head -n 15

・・・51, 50, 5, 0, 18, 73, 36, 12, 0, 57, 36, 244, 0, 119, 169, 87, 118, 74, 255, 0, 19, 219, 125, 219, 183, 205, 219, 214, 254, 97, 166, 183, 237, 253, 125, 219, 252, 143, 255, 217] 
---
header:
   seq: 2
   stamp:
       secs: 1637895523
       nsecs: 115781888
    frame_id: "/camera_ego"
edit retag flag offensive close merge delete

Comments

  1. Have you installed ros-melodic-image-transport-plugins pkg?

  2. Are there any messages on topic ego/image_raw_compressed? Please edit your description to show us the first 15 lines of a message as it is displayed by rostopic echo.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-06-19 12:13:28 -0500 )edit

Thank you for responding.

  1. The package has been successfully installed.
  2. The execution result was added.
shuto gravatar image shuto  ( 2022-06-20 00:23:56 -0500 )edit

You have shown us the end of the message. I need to see the beginning, which shows meta-data about the image. Try this command:

rostopic echo ego/image_raw_compressed | head -n 15
Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-06-20 08:22:29 -0500 )edit

I was ashamed to not know the command. Thank you for your useful knowledge. The execution result of the command was added.

shuto gravatar image shuto  ( 2022-06-21 21:45:32 -0500 )edit

You almost got it. That topic should have messages of type sensor_msgs/Image, and I want to see all the lines from "header:" to the first line of "data:".

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-06-22 07:50:47 -0500 )edit

try:

rostopic echo ego/image_raw_compressed --noarr

to hide the array.

hank880907 gravatar image hank880907  ( 2023-07-05 03:26:29 -0500 )edit