DataFlash: Only log EKF messages when enabled

This commit is contained in:
Paul Riseborough 2015-11-06 22:52:52 +11:00 committed by Andrew Tridgell
parent 624f169b9b
commit 46e4c45537

View File

@ -1111,6 +1111,8 @@ void DataFlash_Class::Log_Write_POS(AP_AHRS &ahrs)
#if AP_AHRS_NAVEKF_AVAILABLE #if AP_AHRS_NAVEKF_AVAILABLE
void DataFlash_Class::Log_Write_EKF(AP_AHRS_NavEKF &ahrs, bool optFlowEnabled) void DataFlash_Class::Log_Write_EKF(AP_AHRS_NavEKF &ahrs, bool optFlowEnabled)
{ {
// only log EKF if enabled
if (ahrs.get_NavEKF().enabled()) {
// Write first EKF packet // Write first EKF packet
Vector3f euler; Vector3f euler;
Vector3f posNED; Vector3f posNED;
@ -1254,6 +1256,7 @@ void DataFlash_Class::Log_Write_EKF(AP_AHRS_NavEKF &ahrs, bool optFlowEnabled)
}; };
WriteBlock(&pkt5, sizeof(pkt5)); WriteBlock(&pkt5, sizeof(pkt5));
} }
}
// do EKF2 as well if enabled // do EKF2 as well if enabled
if (ahrs.get_NavEKF2().enabled()) { if (ahrs.get_NavEKF2().enabled()) {