From fef42ecd8c850a121e6c59d1c63d0da7c057ede7 Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Fri, 16 Sep 2022 16:13:19 +0100 Subject: [PATCH] Plane: log: only log yaw and steer PIDs when active --- ArduPlane/Log.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ArduPlane/Log.cpp b/ArduPlane/Log.cpp index 47cdfcb3ef..c5490782f6 100644 --- a/ArduPlane/Log.cpp +++ b/ArduPlane/Log.cpp @@ -42,8 +42,14 @@ void Plane::Log_Write_Attitude(void) logger.Write_PID(LOG_PIDR_MSG, rollController.get_pid_info()); logger.Write_PID(LOG_PIDP_MSG, pitchController.get_pid_info()); - logger.Write_PID(LOG_PIDY_MSG, yawController.get_pid_info()); - logger.Write_PID(LOG_PIDS_MSG, steerController.get_pid_info()); + + if (yawController.enabled()) { + logger.Write_PID(LOG_PIDY_MSG, yawController.get_pid_info()); + } + + if (steerController.active()) { + logger.Write_PID(LOG_PIDS_MSG, steerController.get_pid_info()); + } AP::ahrs().Log_Write(); }