Add _position_lock_gained bool and associated logic remaining to close PR #6523. #12769
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe problem solved by the proposed pull request
Nearly all of the changes proposed in PR #6523 have been incorporated in PX4:master at this point. This PR captures the only work remaining from PR #6523 so that it can be closed without losing the remaining work.
Test data / coverage
The changes in this PR affect the state of the local bools
some_switch_changed
andshould_evaluate_rc_mode_switch
inCommander::set_main_state_rc()
. Ifposition_lock_gained
is false, the boolshould_evaluate_rc_mode_switch
will evaluate false and the method will returnTRANSITION_NOT_CHANGED
.Anytime
position_lock_gained
is true, the results in Commander will be unchanged. The instances ofposition_lock_gained = false
need careful examination. (I believe I have captured @LorenzMeier's original intent, but the logic in Commander.cpp has changed quite a lot from when the PR was originally proposed so I could use a hand ensuring this logic is correct.)Flight tests on a 250 quad and pixhawk 4 mini performed identical to PX4:master, position lock is identified, the position tone plays and led color change is observable in the same way as upstream, and flight mode changes are obeyed from the RC transmitter:
Additional context
See PR #6523. @dagar and @julianoes , this PR is as we discussed in the dev call.
Hi @LorenzMeier , would you be willing to look this PR over and see if I've captured your intent?
All, please feel free to close this PR, (and #6523), if these changes are no longer required.
Thanks!
-Mark