AP_NavEKF: log EKF data source set changes

This commit is contained in:
Peter Barker 2021-07-16 11:54:55 +10:00 committed by Randy Mackay
parent 110d48e6fa
commit 1db7e9e2e2

View File

@ -16,6 +16,7 @@
#include "AP_NavEKF_Source.h"
#include <AP_Math/AP_Math.h>
#include <AP_DAL/AP_DAL.h>
#include <AP_Logger/AP_Logger.h>
extern const AP_HAL::HAL& hal;
@ -151,6 +152,12 @@ void AP_NavEKF_Source::setPosVelYawSourceSet(uint8_t source_set_idx)
// sanity check source idx
if (source_set_idx < AP_NAKEKF_SOURCE_SET_MAX) {
active_source_set = source_set_idx;
static const LogEvent evt[AP_NAKEKF_SOURCE_SET_MAX] {
LogEvent::EK3_SOURCES_SET_TO_PRIMARY,
LogEvent::EK3_SOURCES_SET_TO_SECONDARY,
LogEvent::EK3_SOURCES_SET_TO_TERTIARY,
};
AP::logger().Write_Event(evt[active_source_set]);
}
}