logger: add raw FIFO high-rate IMU logging profiles

Minimum requirement to use: set IMU_GYRO_RATEMAX to 400.

Logging rate of a single topic: ~85 KB/s. If multiple should be logged,
a really good SD card has to be used.
This commit is contained in:
Beat Küng
2020-06-09 11:36:07 +02:00
committed by Daniel Agar
parent 590b65ebfb
commit 0fcb873636
4 changed files with 42 additions and 2 deletions
+13
View File
@@ -490,6 +490,19 @@ bool Logger::initialize_topics()
return false;
}
if ((sdlog_profile & SDLogProfileMask::RAW_IMU_ACCEL_FIFO) || (sdlog_profile & SDLogProfileMask::RAW_IMU_GYRO_FIFO)) {
// if we are logging high-rate FIFO, reduce the logging interval & increase process priority to avoid missing samples
PX4_INFO("Logging FIFO data: increasing task prio and logging rate");
_log_interval = 800;
sched_param param{};
param.sched_priority = SCHED_PRIORITY_ATTITUDE_CONTROL;
int ret = pthread_setschedparam(pthread_self(), SCHED_DEFAULT, &param);
if (ret != 0) {
PX4_ERR("pthread_setschedparam failed (%i)", ret);
}
}
delete[](_subscriptions);
_subscriptions = nullptr;