Plane: revert auto_state.checked_for_autoland back to Plane

This commit is contained in:
Tom Pittenger 2016-11-23 03:07:50 -08:00 committed by Tom Pittenger
parent 3814b5a38b
commit fc2f518f31
4 changed files with 8 additions and 8 deletions

View File

@ -798,7 +798,7 @@ void Plane::update_navigation()
set_mode(QRTL, MODE_REASON_UNKNOWN); set_mode(QRTL, MODE_REASON_UNKNOWN);
break; break;
} else if (g.rtl_autoland == 1 && } else if (g.rtl_autoland == 1 &&
!landing.checked_for_autoland && !auto_state.checked_for_autoland &&
reached_loiter_target() && reached_loiter_target() &&
labs(altitude_error_cm) < 1000) { labs(altitude_error_cm) < 1000) {
// we've reached the RTL point, see if we have a landing sequence // we've reached the RTL point, see if we have a landing sequence
@ -809,10 +809,10 @@ void Plane::update_navigation()
// prevent running the expensive jump_to_landing_sequence // prevent running the expensive jump_to_landing_sequence
// on every loop // on every loop
landing.checked_for_autoland = true; auto_state.checked_for_autoland = true;
} }
else if (g.rtl_autoland == 2 && else if (g.rtl_autoland == 2 &&
!landing.checked_for_autoland) { !auto_state.checked_for_autoland) {
// Go directly to the landing sequence // Go directly to the landing sequence
if (landing.jump_to_landing_sequence()) { if (landing.jump_to_landing_sequence()) {
// switch from RTL -> AUTO // switch from RTL -> AUTO
@ -821,7 +821,7 @@ void Plane::update_navigation()
// prevent running the expensive jump_to_landing_sequence // prevent running the expensive jump_to_landing_sequence
// on every loop // on every loop
landing.checked_for_autoland = true; auto_state.checked_for_autoland = true;
} }
radius = abs(g.rtl_radius); radius = abs(g.rtl_radius);
if (radius > 0) { if (radius > 0) {

View File

@ -472,6 +472,9 @@ private:
// in FBWA taildragger takeoff mode // in FBWA taildragger takeoff mode
bool fbwa_tdrag_takeoff_mode:1; bool fbwa_tdrag_takeoff_mode:1;
// have we checked for an auto-land?
bool checked_for_autoland:1;
// Altitude threshold to complete a takeoff command in autonomous modes. Centimeters // Altitude threshold to complete a takeoff command in autonomous modes. Centimeters
// are we in idle mode? used for balloon launch to stop servo // are we in idle mode? used for balloon launch to stop servo
// movement until altitude is reached // movement until altitude is reached

View File

@ -335,7 +335,7 @@ void Plane::set_mode(enum FlightMode mode, mode_reason_t reason)
auto_state.next_wp_no_crosstrack = true; auto_state.next_wp_no_crosstrack = true;
// reset landing check // reset landing check
landing.checked_for_autoland = false; auto_state.checked_for_autoland = false;
// reset go around command // reset go around command
landing.commanded_go_around = false; landing.commanded_go_around = false;

View File

@ -102,9 +102,6 @@ public:
// once landed, post some landing statistics to the GCS // once landed, post some landing statistics to the GCS
bool post_stats; bool post_stats;
// have we checked for an auto-land?
bool checked_for_autoland;
// denotes if a go-around has been commanded for landing // denotes if a go-around has been commanded for landing
bool commanded_go_around; bool commanded_go_around;