Change logging frequency from specific sensors

Hello,
I trying to find out if it’s possible to change the logging frequency from specific sensors. I didn’t find in the documentation and the only post here relevant to this, logging frequency, doesn’t have any replies.
I know you can change the gps with GPS_RATE_MS, but didn’t find parameters for the others.

I did look at the code, and I think it’s related with SCHED_TASK and SCHED_TASK_CLASS, but before modifying the code, I wanted to ask here

Contains the information you seek

So, for the sensors that are fixed, like VIBE, the only way to change them is by modifying the firmware, which is not recommended for this, because it may cause problems.

It is open source. You can change it. Beginers shouldn’t do it. Knowledgeable users can do it.

why the controllers frequencies are so high if the sensors are well below their values?

What vehicle type which sensor exactly? What problem are you trying to solve?

it’s not a problem, just a curiosity. GPS for example is between 5 Hz and 20 Hz, but the controller have frequency well beyond that. Not saying all sensors have the same frequency as GPS, but most of the sensors that are used as input are very slow compared to the controllers’ frequencies.

IMU sensors work between 1 and 8KHz
So much faster than the control loop

2 Likes

The GPS update rate between 5Hz and 20Hz is a limitation of the GPS module, not Ardupilot.

1 Like

Log file sizes would spiral out of control if we logged all values as fast as possible. Logging rates are curated to be useful for analysis without generating huge files. Some of the rates are configurable via parameters, as you found. The vast majority are logged at non-configurable rates but could be customized via source code changes. But I’d be very curious to know what issue has arisen that would require that.

1 Like