Browse Source
This fixes the case where we sometimes switch to altitude control instead of position control when RC is regained. What happens is that we detect that the pilot wants to take over control right when RC comes back. This means that we try to go in position control in main_state_transition, however, we are already in position control because we come back from the failsafe state. The result of main_state_transition is then TRANSITION_NOT_CHANGED, and therefore we "fall back" to altitude control even though being already in position control would have been fine. This fix checks the return result of main_state_transition correctly and only reacts to TRANSITION_CHANGED and TRANSITION_DENIED but ignores TRANSITION_NOT_CHANGED.master
Julian Oes
4 years ago
1 changed files with 16 additions and 9 deletions
Loading…
Reference in new issue