I’ve been modifying the code to add different logs, and no matter what I try I have been unable to log anything at > 50 Hz, regardless of how often the function is called. I have tried both the “easy way” and “hard way” outlined in the documentation, and I have tried both calling my logging function at a high frequency from the scheduler as well as calling it from within another function that updates at a high frequency. Nothing seems to work so far. I’m using a Pixhawk 1 board if that makes a difference. Does this mean the code is failing to run at high frequencies or is it updating at a high frequency and just failing to log fast enough?
Additionally, the logging frequency does not seem precise. E.g. when trying to record at 25 Hz, I get frequency ranges from 24.5 to 25.5 which is undesirable.
Ah, alright that is helpful. Is there any reason the main loop is at 50 Hz by default even though some tasks are called at frequencies up to 400 Hz in the scheduler?
After upping the frequency I get an error as large ±10 Hz for the logging. While error in the logging frequency isn’t too bad like you’re saying, for the work I’m doing I want to be able to ensure that the low level control responds at precisely the desired frequency. It seems testing this through logging is not the best way, is there a better way you recommend?