# No output from ros2 topic hz

When I run ros2 topic hz for certain topics, there will be no output and the terminal will lock.

For example, I have launched turtlebot3_world.launch.py and run teleop_keyboard, and also am running rqt_graph (I'm not sure if all these will be relevant but I'm just stating the current circumstances). Then when I run

user@ubuntu:~/ros2_ws$ros2 topic hz /scan average rate: 4.995 min: 0.199s max: 0.201s std dev: 0.00046s window: 6 average rate: 4.995 min: 0.199s max: 0.201s std dev: 0.00060s window: 11  And it goes on outputting the average publish rate. This happens for /clock, /cmd_vel, /imu, /joint_states, /odom, /tf, /tf_static. However, for /parameter_events, /robot_description, /rosout, this happens: user@ubuntu:~/ros2_ws$ ros2 topic hz /rosout

^Cuser@ubuntu:~/ros2_ws\$


The terminal remains locked and no average publishing rate is outputted (I had to Ctrl-C the process).

May I know why this is so? Is it because it is not publishing any msgs at all?

edit retag close merge delete

ros2 topic hz ... shows nothing when ros2 topic echo ..., shows nothing. So yes, it's because of no messages. BTW ros2 topic hz /rosout shows something on my pc because there are messages.