diff --git a/src/modules/interface/sitaw.h b/src/modules/interface/sitaw.h index 42df88928b..714050f631 100644 --- a/src/modules/interface/sitaw.h +++ b/src/modules/interface/sitaw.h @@ -42,7 +42,11 @@ void sitAwInit(void); void sitAwUpdateSetpoint(setpoint_t *setpoint, const sensorData_t *sensorData, const state_t *state); /* Enable the situation awareness framework. */ -//#define SITAW_ENABLED +#define SITAW_ENABLED +/* Enable the different functions of the situation awareness framework. */ +//#define SITAW_FF_ENABLED /* Uncomment to enable */ +//#define SITAW_AR_ENABLED /* Uncomment to enable */ +#define SITAW_TU_ENABLED /* Uncomment to enable */ /* Configuration options for the 'Free Fall' detection. */ #define SITAW_FF_THRESHOLD 0.1 /* The default tolerance for AccWZ deviations from -1, indicating Free Fall. */ diff --git a/src/modules/src/sitaw.c b/src/modules/src/sitaw.c index 5b2c568fab..f472caec99 100644 --- a/src/modules/src/sitaw.c +++ b/src/modules/src/sitaw.c @@ -322,7 +322,13 @@ bool sitAwTuDetected(void) */ void sitAwInit(void) { +#ifdef SITAW_FF_ENABLED sitAwFFInit(); +#endif +#ifdef SITAW_AR_ENABLED sitAwARInit(); +#endif +#ifdef SITAW_TU_ENABLED sitAwTuInit(); +#endif } diff --git a/src/modules/src/stabilizer.c b/src/modules/src/stabilizer.c index 4ffb710d65..eccc70983c 100644 --- a/src/modules/src/stabilizer.c +++ b/src/modules/src/stabilizer.c @@ -65,9 +65,10 @@ void stabilizerInit(StateEstimatorType estimator) stateEstimatorInit(estimator); stateControllerInit(); powerDistributionInit(); -#if defined(SITAW_ENABLED) - sitAwInit(); -#endif + if (estimator == kalmanEstimator) + { + sitAwInit(); + } xTaskCreate(stabilizerTask, STABILIZER_TASK_NAME, STABILIZER_TASK_STACKSIZE, NULL, STABILIZER_TASK_PRI, NULL);