Ask Your Question

How to understand the result of the "ros2 topic info /camera/color/image_raw" is 0

asked 2018-07-01 22:27:48 -0500

RachelRen gravatar image

When I launch realsense_ros2_camera ,I use ros2 topic info /camera/color/image_raw to print information about the /camera/color/image_raw topic,the result is :

Topic: /camera/color/image_raw
Publisher count: 0
Subscriber count: 0

In subscriber,it can't auto call the callback function.I want to know if it is because there is no publisher lead to can't auto call the callback function.

To be honest,I don't understand that there is no publisher why does the topic exist.

Thanks very much.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-07-02 17:16:28 -0500

It appears you have no one subscribed to the topic- do you have another application which is actively using that information? rostopic tools won't count themselves as sub/pubs.

edit flag offensive delete link more


I writed a subscriber for it.When I launched the subscriber,the subscriber count is 1,but the callback function not executed.

RachelRen gravatar image RachelRen  ( 2018-07-02 20:58:52 -0500 )edit

The callback will be executed when messages are received on that topic. If you publish to that topic (e.g. with ros2 topic pub /camera/color/image_raw sensor_msgs/Image) the callback should be called.

The issue seems to be that the launched realsense node doesn't publish any message on the topic

marguedas gravatar image marguedas  ( 2018-07-04 14:04:34 -0500 )edit

@marguedas Thanks for you explanation,I understand why the callback is not called.

Thanks everyone.

RachelRen gravatar image RachelRen  ( 2018-07-04 23:05:04 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-07-01 22:27:48 -0500

Seen: 495 times

Last updated: Jul 02 '18