From abfcf89f5e6061cecec6bdef8c57e54931b42920 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 30 Apr 2016 09:34:38 +1000 Subject: [PATCH] Plane: reduced the rate of EKF and attitude logging to 25Hz this will reduce the log file size while not appreciably reducing the ability to analyse logs --- ArduPlane/ArduPlane.cpp | 5 +---- ArduPlane/Log.cpp | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ArduPlane/ArduPlane.cpp b/ArduPlane/ArduPlane.cpp index e0e428ab68..4be062d862 100644 --- a/ArduPlane/ArduPlane.cpp +++ b/ArduPlane/ArduPlane.cpp @@ -74,6 +74,7 @@ const AP_Scheduler::Task Plane::scheduler_tasks[] = { SCHED_TASK(update_trigger, 50, 100), SCHED_TASK(log_perf_info, 0.2, 100), SCHED_TASK(compass_save, 0.016, 200), + SCHED_TASK(Log_Write_Attitude, 25, 300), SCHED_TASK(update_logging1, 10, 300), SCHED_TASK(update_logging2, 10, 300), SCHED_TASK(parachute_check, 10, 200), @@ -158,10 +159,6 @@ void Plane::ahrs_update() ahrs.update(); - if (should_log(MASK_LOG_ATTITUDE_FAST)) { - Log_Write_Attitude(); - } - if (should_log(MASK_LOG_IMU)) { Log_Write_IMU(); DataFlash.Log_Write_IMUDT(ins); diff --git a/ArduPlane/Log.cpp b/ArduPlane/Log.cpp index 8b3a99b422..7ae8f1e713 100644 --- a/ArduPlane/Log.cpp +++ b/ArduPlane/Log.cpp @@ -158,6 +158,9 @@ void Plane::do_erase_logs(void) // Write an attitude packet void Plane::Log_Write_Attitude(void) { + if (!should_log(MASK_LOG_ATTITUDE_FAST)) { + return; + } Vector3f targets; // Package up the targets into a vector for commonality with Copter usage of Log_Wrote_Attitude targets.x = nav_roll_cd; targets.y = nav_pitch_cd;