Robotics StackExchange | Archived questions

How to sensor_msgs/CompressedImage to sensor_msgs/Image

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" 

Asked by shuto on 2022-06-09 05:09:32 UTC

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.

Asked by Mike Scheutzow on 2022-06-19 12:13:28 UTC

Thank you for responding.

  1. The package has been successfully installed.
  2. The execution result was added.

Asked by shuto on 2022-06-20 00:23:56 UTC

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

Asked by Mike Scheutzow on 2022-06-20 08:22:29 UTC

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

Asked by shuto on 2022-06-21 21:45:32 UTC

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:".

Asked by Mike Scheutzow on 2022-06-22 07:50:47 UTC

try:

rostopic echo ego/image_raw_compressed --noarr

to hide the array.

Asked by hank880907 on 2023-07-05 03:26:29 UTC

Answers