From e449b3c4a12e65d28e98a87a6c37bdb2db1cb220 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 1 Jun 2015 16:17:15 +1000 Subject: [PATCH] Rover: changes for new AHRS API --- APMrover2/Parameters.cpp | 2 +- APMrover2/Rover.cpp | 5 ----- APMrover2/Rover.h | 7 ++++--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/APMrover2/Parameters.cpp b/APMrover2/Parameters.cpp index 37b258de4d..ca09b35f4c 100644 --- a/APMrover2/Parameters.cpp +++ b/APMrover2/Parameters.cpp @@ -517,7 +517,7 @@ const AP_Param::Info Rover::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_ diff --git a/APMrover2/Rover.cpp b/APMrover2/Rover.cpp index 12347ffb7b..d6ca3d6981 100644 --- a/APMrover2/Rover.cpp +++ b/APMrover2/Rover.cpp @@ -30,11 +30,6 @@ Rover::Rover(void) : #endif in_log_download(false), modes(&g.mode1), -#if AP_AHRS_NAVEKF_AVAILABLE - ahrs(ins, barometer, gps, sonar), -#else - ahrs(ins, barometer, gps), -#endif L1_controller(ahrs), nav_controller(&L1_controller), steerController(ahrs), diff --git a/APMrover2/Rover.h b/APMrover2/Rover.h index ba910a390b..80402d53f4 100644 --- a/APMrover2/Rover.h +++ b/APMrover2/Rover.h @@ -156,11 +156,12 @@ private: // flight modes convenience array AP_Int8 *modes; - // Inertial Navigation EKF +// Inertial Navigation EKF #if AP_AHRS_NAVEKF_AVAILABLE - AP_AHRS_NavEKF ahrs; + NavEKF EKF{&ahrs, barometer, sonar}; + AP_AHRS_NavEKF ahrs {ins, barometer, gps, sonar, EKF}; #else - AP_AHRS_DCM ahrs; + AP_AHRS_DCM ahrs {ins, barometer, gps}; #endif AP_L1_Control L1_controller;