Copter: log EKF height reset

This commit is contained in:
Randy Mackay 2015-07-05 17:38:04 +09:00
parent 221ddb545e
commit cfe046c9d1
2 changed files with 2 additions and 0 deletions

View File

@ -325,6 +325,7 @@ enum FlipState {
#define DATA_MOTORS_INTERLOCK_ENABLED 57
#define DATA_ROTOR_RUNUP_COMPLETE 58 // Heli only
#define DATA_ROTOR_SPEED_BELOW_CRITICAL 59 // Heli only
#define DATA_EKF_ALT_RESET 60
// Centi-degrees to radians
#define DEGX100 5729.57795f

View File

@ -156,6 +156,7 @@ bool Copter::init_arm_motors(bool arming_from_gcs)
if (ap.home_state == HOME_UNSET) {
// Reset EKF altitude if home hasn't been set yet (we use EKF altitude as substitute for alt above home)
ahrs.get_NavEKF().resetHeightDatum();
Log_Write_Event(DATA_EKF_ALT_RESET);
} else if (ap.home_state == HOME_SET_NOT_LOCKED) {
// Reset home position if it has already been set before (but not locked)
set_home_to_current_location();