Skip to content

Commit

Permalink
ArduPlane:bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Hwurzburg committed Dec 28, 2024
1 parent 76f686d commit b6aa8ca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ArduPlane/takeoff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ bool Plane::auto_takeoff_check(void)
// Reset states if process has been interrupted, except initial_direction.initialized if set
#if MODE_AUTOLAND_ENABLED
bool takeoff_dir_initialized = takeoff_state.initial_direction.initialized;
float takeoff_dir = takeoff_state.initial_direction.heading;
#endif
if (takeoff_state.last_check_ms && (now - takeoff_state.last_check_ms) > 200) {
memset(&takeoff_state, 0, sizeof(takeoff_state));
#if MODE_AUTOLAND_ENABLED
takeoff_state.initial_direction.initialized = takeoff_dir_initialized; //restore dir init state
takeoff_state.initial_direction.heading = takeoff_dir;
#endif
return false;
}
Expand Down

0 comments on commit b6aa8ca

Please sign in to comment.