ros_comm icon indicating copy to clipboard operation
ros_comm copied to clipboard

Fix #2249: Topic statistics do not handle well ROS time jumping back

Open peci1 opened this issue 2 years ago • 3 comments

First, I'm submitting a failing test.

It makes 4 repetitions of receiving 10000 messages, each time resetting ROS time from 1.0 onwards. First repetition is okay. If #2249 is not fixed, the following iterations will take considerably longer because the internal lists are never cleared.

peci1 avatar Jun 06 '22 01:06 peci1

And the fix comes.

peci1 avatar Jun 06 '22 06:06 peci1

Is there actually reason to copy the whole stats structure twice in each callback? Wouldn't it be better to modify it directly via an auto&? Could the reason be keeping the lists consistent even in usage by different threads? But that would mean some data would be lost if more threads were overwriting the stats structure...

peci1 avatar Jun 06 '22 07:06 peci1

@mjcarroll @sloretz friendly ping

peci1 avatar Apr 09 '23 21:04 peci1