Improve new logger update rate (#5073)

* logger: disable some default topics, which are most likely not used

This is also to safe CPU and lower the amount of file descriptors used.

* logger: use the hrt timer for more accurate scheduling

Under NuttX with the default rate of 285Hz, the actual measured rate was
only 200Hz while on Linux it was ~280Hz. The reason is that NuttX only
uses a usleep() granularity of 1ms, so that the typical sleep time is
longer than what we set.

Now the logger waits on a semaphore, which gets activated periodically
with a hrt timer. With this the measured rate is exactly the expected one,
285Hz.
This commit is contained in:
Beat Küng
2016-07-15 16:55:32 -07:00
committed by Lorenz Meier
parent ee58f0d11d
commit a1b710025b
2 changed files with 29 additions and 9 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ struct LoggerSubscription {
class Logger
{
public:
Logger(size_t buffer_size, unsigned log_interval, bool log_on_start,
Logger(size_t buffer_size, uint32_t log_interval, bool log_on_start,
bool log_until_shutdown, bool log_name_timestamp);
~Logger();