mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 07:43:34 +08:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user