Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -h option to gz topic command line #446

Open
TheotimeBalaguer opened this issue Sep 27, 2023 · 2 comments
Open

Add -h option to gz topic command line #446

TheotimeBalaguer opened this issue Sep 27, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@TheotimeBalaguer
Copy link

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 the ros2 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

  • The user runs gz topic -h -t /my/topic/name
  • A Gazebo transport node activate and subscribe to the given topic, count the number of receptions, and print each second to the standard output relevant information being the number of received message during this second, the average time between messages, etc. (to be discussed)

Additional context

For reference, the output of a ros2 hz command :
image

@TheotimeBalaguer TheotimeBalaguer added the enhancement New feature or request label Sep 27, 2023
@TheotimeBalaguer
Copy link
Author

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"

@azeey
Copy link
Contributor

azeey commented Nov 30, 2023

-h is already used for "help", so we should probably use a different flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: To do
Development

No branches or pull requests

3 participants