0
$\begingroup$

Rosanswers logo

Hello,

I made some measurements with ros2 topic hz and ros2 topic bw.

I saw, that bw seems to keep on increasing its data source pool forn its measurements (later output has more messages as input) because it prints MB/s from 18 messages, where the number gets bigger over time.

On the other side, when I change the frequency, hz does not instantly increases its rate, but the average only goes up over time, so I was wondering, if hz also just gathers input data and uses all of it for its output, or only 1 window?

Also why is the deviation in s (not in Hz as I would expect it for a rate dev)?

TLDR Is the last output of hz the best estimation, or do I have to calculate the mean from all outputs myself? Is the standard deviation related to the rate? What does it display?

Edit:

I thought about it, and maybe min, max and std dev are for the intervals between messages. So the dev is not the one of the rate, but maybe the one of the intervals? Is there a way to get the dev of the rate directly?

Thanks


Originally posted by Zeckurbo on ROS Answers with karma: 105 on 2022-10-11

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

The output is in seconds because it it is a SI unit . The output window is the number of samples used for the computing of all statistics parameters. The longer ros2 topic hz runs the more it represent the values


Originally posted by duck-development with karma: 1999 on 2022-10-11

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by Zeckurbo on 2022-10-12:
Thanks for your answer. What I dont understand is, why is the rate in Hz (1/s) but the std dev is in s (not Hz). Does it mean, that this deviation is not the one of the measured rate?

Comment by duck-development on 2022-10-12:
It has to be in seconds because it deviates around the mean hz period time plus and minus. If you have a 1hz signal then 0.5s stdvdev means you signal around 0.5hz and 1.5hz but the mean is 1hz

And low std div would result in big hz values and misslead.

$\endgroup$
0
$\begingroup$

Rosanswers logo

I found the code under /opt/ros/foxy/lib/python3.8/site-packages/ros2topic/verb/hz.py

In the method get_hz() the calculation is as follows:

n = Window = number of message intervals for calculation
mean rate = 1/ mean of intervals between 2 received messages (of all n intervals in the window)
min/ max = min / max interval

Now that I think about it, it is logical that one can not measure the rate directly, but only the intervals between 2 messages. So the standard deviation is only for the intervals (so in seconds), not for the rate (in Hz)!

Also the bigger the window count, the more data was used


Originally posted by Zeckurbo with karma: 105 on 2022-10-13

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.