diff --git a/libraries/AP_Motors/AP_Motors_Thrust_Linearization.cpp b/libraries/AP_Motors/AP_Motors_Thrust_Linearization.cpp index 6a7632feb5..bfdc1f3765 100644 --- a/libraries/AP_Motors/AP_Motors_Thrust_Linearization.cpp +++ b/libraries/AP_Motors/AP_Motors_Thrust_Linearization.cpp @@ -3,11 +3,17 @@ #include "AP_Motors_Class.h" #include #include +#include #define AP_MOTORS_BATT_VOLT_FILT_HZ 0.5 // battery voltage filtered at 0.5hz -#ifndef AP_MOTORS_DENSITY_COMP -#define AP_MOTORS_DENSITY_COMP 1 +#if APM_BUILD_TYPE(APM_BUILD_UNKNOWN) + // Example does not instantiate baro so cannot do density compensation + #define AP_MOTORS_DENSITY_COMP 0 +#else + #ifndef AP_MOTORS_DENSITY_COMP + #define AP_MOTORS_DENSITY_COMP 1 + #endif #endif