// run land and crash detectors // called at MAIN_LOOP_RATE void Sub::update_land_and_crash_detectors() { // update 1hz filtered acceleration Vector3f accel_ef = ahrs.get_accel_ef_blended(); accel_ef.z += GRAVITY_MSS; land_accel_ef_filter.apply(accel_ef, MAIN_LOOP_SECONDS); update_land_detector(); crash_check(); }
// run land and crash detectors // called at MAIN_LOOP_RATE void Copter::update_land_and_crash_detectors() { // update 1hz filtered acceleration Vector3f accel_ef = ahrs.get_accel_ef_blended(); accel_ef.z += GRAVITY_MSS; land_accel_ef_filter.apply(accel_ef, MAIN_LOOP_SECONDS); update_land_detector(); #if PARACHUTE == ENABLED // check parachute parachute_check(); #endif crash_check(); }