EKF: Enable control mode transitions to be detected

Save the previous value of the filter control modes
This commit is contained in:
Paul Riseborough 2016-02-16 10:40:05 +11:00
parent 402206a305
commit d9bf4e9870
2 changed files with 6 additions and 0 deletions

View File

@ -151,6 +151,8 @@ void Ekf::controlFusionModes()
_control_status.flags.wind = false;
}
// Store the status to enable change detection
_control_status_prev.value = _control_status.value;
}
void Ekf::calculateVehicleStatus()

View File

@ -85,8 +85,12 @@ public:
bool collect_gps(uint64_t time_usec, struct gps_message *gps);
bool collect_imu(imuSample &imu);
// this is the current status of the filter control modes
filter_control_status_u _control_status = {};
// this is the previous status of the filter control modes - used to detect mode transitions
filter_control_status_u _control_status_prev = {};
// get the ekf WGS-84 origin position and height and the system time it was last set
void get_ekf_origin(uint64_t *origin_time, map_projection_reference_s *origin_pos, float *origin_alt);