Open TheotimeBalaguer opened 9 months ago
For the curious out there, the VERY clumsy one-liner to have an (imprecise !) idea of the number of messages per second :
watch -n 1 "( timeout 1s gz topic -e -t /model/px4vision_lidar_2/odometry | grep nsec || true ) | wc -l"
-h
is already used for "help", so we should probably use a different flag.
Desired behavior
There is no straight-forward way of getting the number of messages per second published on a gazebo transport topic. Basically, this is an extension of the
gz topic
command with a new option (I propose-h
for consistency with gazebo-classic) that prints the number of received messages on a particular topic. The functioning would be very close to theros2 topic hz <topic_name>
command of the ROS middleware.Alternatives considered
There could be an alternative using a mix of
watch
,grep
,wc -l
but that is not easily usable for everyone.Implementation suggestion
gz topic -h -t /my/topic/name
Additional context
For reference, the output of a ros2 hz command :![image](https://github.com/gazebosim/gz-transport/assets/37147004/2103119b-a5ff-4496-8533-252e9ec6f964)