logger: avoid data bursts by distributing slow subscription updates over time

There's an increasing amount of slow logged topics at 1-2Hz, which were all
updated in the same logger iteration, leading to data bursts. For log
streaming this started to exceed uart buffer sizes. By distributing updates
more equal over time those bursts are removed, reducing buffer size
requirements.

Tests showed during steady state a reduction of maximum topic updates per
iteration from 40 down to 17.
Also the SD log buffer fill level is more constant.
This commit is contained in:
Beat Küng
2021-08-12 10:09:11 -04:00
committed by Daniel Agar
parent d3c45c00c7
commit f88f224fe6
3 changed files with 39 additions and 0 deletions
@@ -152,6 +152,11 @@ public:
*/
void set_interval_ms(uint32_t interval) { _interval_us = interval * 1000; }
/**
* Set the last data update
* @param t should be in range [now, now - _interval_us]
*/
void set_last_update(hrt_abstime t) { _last_update = t; }
protected:
Subscription _subscription;