Sub: allow NavEKFs to be compiled out

This commit is contained in:
Peter Barker 2020-01-15 23:05:58 +11:00 committed by Andrew Tridgell
parent 797aa51025
commit 6092a415a5
2 changed files with 12 additions and 0 deletions

View File

@ -546,13 +546,17 @@ const AP_Param::Info Sub::var_info[] = {
GOBJECT(rcmap, "RCMAP_", RCMapper),
#endif
#if HAL_NAVEKF2_AVAILABLE
// @Group: EK2_
// @Path: ../libraries/AP_NavEKF2/AP_NavEKF2.cpp
GOBJECTN(ahrs.EKF2, NavEKF2, "EK2_", NavEKF2),
#endif
#if HAL_NAVEKF3_AVAILABLE
// @Group: EK3_
// @Path: ../libraries/AP_NavEKF3/AP_NavEKF3.cpp
GOBJECTN(ahrs.EKF3, NavEKF3, "EK3_", NavEKF3),
#endif
// @Group: MIS_
// @Path: ../libraries/AP_Mission/AP_Mission.cpp

View File

@ -154,11 +154,19 @@ void Sub::init_ardupilot()
// We only have onboard baro
// No external underwater depth sensor detected
barometer.set_primary_baro(0);
#if HAL_NAVEKF2_AVAILABLE
ahrs.EKF2.set_baro_alt_noise(10.0f); // Readings won't correspond with rest of INS
#endif
#if HAL_NAVEKF3_AVAILABLE
ahrs.EKF3.set_baro_alt_noise(10.0f);
#endif
} else {
#if HAL_NAVEKF2_AVAILABLE
ahrs.EKF2.set_baro_alt_noise(0.1f);
#endif
#if HAL_NAVEKF3_AVAILABLE
ahrs.EKF3.set_baro_alt_noise(0.1f);
#endif
}
leak_detector.init();