ArduPlane:bug fix
This commit is contained in:
parent
3647c67e73
commit
055c6242f6
@ -25,11 +25,13 @@ bool Plane::auto_takeoff_check(void)
|
|||||||
// Reset states if process has been interrupted, except initial_direction.initialized if set
|
// Reset states if process has been interrupted, except initial_direction.initialized if set
|
||||||
#if MODE_AUTOLAND_ENABLED
|
#if MODE_AUTOLAND_ENABLED
|
||||||
bool takeoff_dir_initialized = takeoff_state.initial_direction.initialized;
|
bool takeoff_dir_initialized = takeoff_state.initial_direction.initialized;
|
||||||
|
float takeoff_dir = takeoff_state.initial_direction.heading;
|
||||||
#endif
|
#endif
|
||||||
if (takeoff_state.last_check_ms && (now - takeoff_state.last_check_ms) > 200) {
|
if (takeoff_state.last_check_ms && (now - takeoff_state.last_check_ms) > 200) {
|
||||||
memset(&takeoff_state, 0, sizeof(takeoff_state));
|
memset(&takeoff_state, 0, sizeof(takeoff_state));
|
||||||
#if MODE_AUTOLAND_ENABLED
|
#if MODE_AUTOLAND_ENABLED
|
||||||
takeoff_state.initial_direction.initialized = takeoff_dir_initialized; //restore dir init state
|
takeoff_state.initial_direction.initialized = takeoff_dir_initialized; //restore dir init state
|
||||||
|
takeoff_state.initial_direction.heading = takeoff_dir;
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user