diff --git a/ArduCopter/Copter.cpp b/ArduCopter/Copter.cpp index 345b464504..b3d355a031 100644 --- a/ArduCopter/Copter.cpp +++ b/ArduCopter/Copter.cpp @@ -28,7 +28,6 @@ Copter::Copter(void) : ins_sample_rate(AP_InertialSensor::RATE_400HZ), flight_modes(&g.flight_mode1), sonar_enabled(true), - ahrs(ins, barometer, gps, sonar), mission(ahrs, FUNCTOR_BIND_MEMBER(&Copter::start_command, bool, const AP_Mission::Mission_Command &), FUNCTOR_BIND_MEMBER(&Copter::verify_command, bool, const AP_Mission::Mission_Command &), diff --git a/ArduCopter/Copter.h b/ArduCopter/Copter.h index 9f733a9ceb..072e1bd58e 100644 --- a/ArduCopter/Copter.h +++ b/ArduCopter/Copter.h @@ -177,7 +177,8 @@ private: #endif // Inertial Navigation EKF - AP_AHRS_NavEKF ahrs; + NavEKF EKF{&ahrs, barometer, sonar}; + AP_AHRS_NavEKF ahrs{ins, barometer, gps, sonar, EKF}; #if CONFIG_HAL_BOARD == HAL_BOARD_SITL SITL sitl; diff --git a/ArduCopter/Parameters.cpp b/ArduCopter/Parameters.cpp index a1b79f276d..bf061bd2a5 100644 --- a/ArduCopter/Parameters.cpp +++ b/ArduCopter/Parameters.cpp @@ -1004,7 +1004,7 @@ const AP_Param::Info Copter::var_info[] PROGMEM = { #if AP_AHRS_NAVEKF_AVAILABLE // @Group: EKF_ // @Path: ../libraries/AP_NavEKF/AP_NavEKF.cpp - GOBJECTN(ahrs.get_NavEKF(), NavEKF, "EKF_", NavEKF), + GOBJECTN(EKF, NavEKF, "EKF_", NavEKF), #endif // @Group: MIS_