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), GOBJECT(rcmap, "RCMAP_", RCMapper),
#endif #endif
#if HAL_NAVEKF2_AVAILABLE
// @Group: EK2_ // @Group: EK2_
// @Path: ../libraries/AP_NavEKF2/AP_NavEKF2.cpp // @Path: ../libraries/AP_NavEKF2/AP_NavEKF2.cpp
GOBJECTN(ahrs.EKF2, NavEKF2, "EK2_", NavEKF2), GOBJECTN(ahrs.EKF2, NavEKF2, "EK2_", NavEKF2),
#endif
#if HAL_NAVEKF3_AVAILABLE
// @Group: EK3_ // @Group: EK3_
// @Path: ../libraries/AP_NavEKF3/AP_NavEKF3.cpp // @Path: ../libraries/AP_NavEKF3/AP_NavEKF3.cpp
GOBJECTN(ahrs.EKF3, NavEKF3, "EK3_", NavEKF3), GOBJECTN(ahrs.EKF3, NavEKF3, "EK3_", NavEKF3),
#endif
// @Group: MIS_ // @Group: MIS_
// @Path: ../libraries/AP_Mission/AP_Mission.cpp // @Path: ../libraries/AP_Mission/AP_Mission.cpp

View File

@ -154,11 +154,19 @@ void Sub::init_ardupilot()
// We only have onboard baro // We only have onboard baro
// No external underwater depth sensor detected // No external underwater depth sensor detected
barometer.set_primary_baro(0); 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 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); ahrs.EKF3.set_baro_alt_noise(10.0f);
#endif
} else { } else {
#if HAL_NAVEKF2_AVAILABLE
ahrs.EKF2.set_baro_alt_noise(0.1f); ahrs.EKF2.set_baro_alt_noise(0.1f);
#endif
#if HAL_NAVEKF3_AVAILABLE
ahrs.EKF3.set_baro_alt_noise(0.1f); ahrs.EKF3.set_baro_alt_noise(0.1f);
#endif
} }
leak_detector.init(); leak_detector.init();