ros2cli icon indicating copy to clipboard operation
ros2cli copied to clipboard

Make possible for ros2 topic hz to monitor the rates of multiple topics simultaneously as ros1 rostopic hz does.

Open martinakos opened this issue 1 year ago • 7 comments

Feature request

Feature description

Make possible for ros2 topic hz to monitor the rates for of multiple topics simultaneously as ros1 rostopic hz does.

In ROS1 I can do:

rostopic hz /topic1 /topic2 /topic3

In ROS2 Humble I can only check the rate for one topic at a time:

ros2 topic hz /topic1

martinakos avatar May 11 '23 15:05 martinakos

yeah, i think it is nice to have.

the following is output from rostopic hz from ROS 1 just a reference.

root@4b5f2b7e1de8:~# rostopic hz /chatter /rosout
subscribed to [/chatter]
subscribed to [/rosout]
 topic      rate   min_delta   max_delta    std_dev    window
=============================================================
/chatter   9.995   0.09971     0.1004      0.0001937   10
/rosout    9.996   0.09978     0.1004      0.0001766   10

 topic      rate   min_delta   max_delta    std_dev    window
=============================================================
/chatter   9.998   0.0997      0.1004      0.0001685   20
/rosout    9.998   0.09967     0.1004      0.0001661   20
....<snip>

fujitatomoya avatar May 11 '23 20:05 fujitatomoya

Hi @fujitatomoya This feature sounds cool, If it's not implemented yet, I would like to give it a try. Can I ?

yaswanth1701 avatar Jan 05 '24 09:01 yaswanth1701

i think @iuhilnehc-ynos created https://github.com/ros2/ros2cli/pull/831 already. it would be nice if you can do review for that 👍

fujitatomoya avatar Jan 05 '24 16:01 fujitatomoya

i think @iuhilnehc-ynos created #831 already. it would be nice if you can do review for that 👍

I haven't done a review before for PR but I will give it a try, thanks!

yaswanth1701 avatar Jan 05 '24 19:01 yaswanth1701

Just a side note: If once accepts new dependencies, it might make sense to not reinvent table printing here and use something proven. For example: rich or others.

felixdivo avatar Jan 08 '24 10:01 felixdivo

Just a side note: If once accepts new dependencies, it might make sense to not reinvent table printing here and use something proven. For example: rich or others.

We are careful with adding new dependencies. At the very least, the dependency needs to be available as a system package on Debian and Ubuntu (and preferably RHEL-9). Even then, we still have to deal with what happens on Windows. If we think the dependencies will make a significant difference, we can consider it, but someone needs to make the argument for it.

clalancette avatar Jan 08 '24 13:01 clalancette

So, rich would be available on Ubuntu. I don't find it for Debian. Cons are the usual ones for new dependencies. Pros are

  • Very simple UI creation, the code in this repo only does what it is responsible for: Collecting and structuring the HZ data. Displaying is done by a library that specializes on it
  • It's still a command line tool and very portable and fairly minimalist
  • Colors, highlights, ... make it easiert to maintain an overview
  • Such a library might be useful in other places in this CLI tool as well

Similar pro arguments probably hold for other tools to. I like rich because it contains other nice CLI building blocks too, like pretty progress bars, for example. It is well maintained and from my experience very stable.

felixdivo avatar Jan 08 '24 13:01 felixdivo