diff --git a/flight/modules/StateEstimation/stateestimation.c b/flight/modules/StateEstimation/stateestimation.c index 3ed9dfe02..b8216b120 100644 --- a/flight/modules/StateEstimation/stateestimation.c +++ b/flight/modules/StateEstimation/stateestimation.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -254,7 +255,7 @@ static const filterPipeline *ekf13Queue = &(filterPipeline) { static void settingsUpdatedCb(UAVObjEvent *objEv); static void sensorUpdatedCb(UAVObjEvent *objEv); -static void homeLocationUpdatedCb(UAVObjEvent *objEv); +static void criticalConfigUpdatedCb(UAVObjEvent *objEv); static void StateEstimationCb(void); static inline int32_t maxint32_t(int32_t a, int32_t b) @@ -292,7 +293,8 @@ int32_t StateEstimationInitialize(void) RevoSettingsConnectCallback(&settingsUpdatedCb); - HomeLocationConnectCallback(&homeLocationUpdatedCb); + HomeLocationConnectCallback(&criticalConfigUpdatedCb); + AuxMagSettingsConnectCallback(&criticalConfigUpdatedCb); GyroSensorConnectCallback(&sensorUpdatedCb); AccelSensorConnectCallback(&sensorUpdatedCb); @@ -538,9 +540,9 @@ static void settingsUpdatedCb(__attribute__((unused)) UAVObjEvent *ev) } /** - * Callback for eventdispatcher when HomeLocation has been updated + * Callback for eventdispatcher when HomeLocation or other critical configs (auxmagsettings, ...) has been updated */ -static void homeLocationUpdatedCb(__attribute__((unused)) UAVObjEvent *ev) +static void criticalConfigUpdatedCb(__attribute__((unused)) UAVObjEvent *ev) { // Ask for a filter init (necessary for LLA filter) // Only possible if disarmed