Plane: changes for new AHRS API

This commit is contained in:
Andrew Tridgell 2015-06-01 16:16:49 +10:00
parent 04ba5fa0bd
commit 9adc879253
2 changed files with 15 additions and 14 deletions

View File

@ -1190,7 +1190,7 @@ const AP_Param::Info Plane::var_info[] PROGMEM = {
#if AP_AHRS_NAVEKF_AVAILABLE
// @Group: EKF_
// @Path: ../libraries/AP_NavEKF/AP_NavEKF.cpp
GOBJECTN(ahrs.get_NavEKF_const(), NavEKF, "EKF_", NavEKF),
GOBJECTN(EKF, NavEKF, "EKF_", NavEKF),
#endif
AP_VAREND

View File

@ -172,9 +172,22 @@ private:
AP_InertialSensor ins;
#if RANGEFINDER_ENABLED == ENABLED
// rangefinder
RangeFinder rangefinder;
struct {
bool in_range;
float correction;
uint32_t last_correction_time_ms;
uint8_t in_range_count;
} rangefinder_state;
#endif
// Inertial Navigation EKF
#if AP_AHRS_NAVEKF_AVAILABLE
AP_AHRS_NavEKF ahrs {ins, barometer, gps, rangefinder};
NavEKF EKF{&ahrs, barometer, rangefinder};
AP_AHRS_NavEKF ahrs {ins, barometer, gps, rangefinder, EKF};
#else
AP_AHRS_DCM ahrs {ins, barometer, gps};
#endif
@ -229,18 +242,6 @@ private:
// a pin for reading the receiver RSSI voltage.
AP_HAL::AnalogSource *rssi_analog_source;
#if RANGEFINDER_ENABLED == ENABLED
// rangefinder
RangeFinder rangefinder;
struct {
bool in_range;
float correction;
uint32_t last_correction_time_ms;
uint8_t in_range_count;
} rangefinder_state;
#endif
// Relay
AP_Relay relay;