ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
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 -0600

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 -0600

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 -0600 )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 -0600 )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 -0600 )edit

Question Tools

1 follower


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

Seen: 773 times

Last updated: Jul 02 '18