Plane: fix bug in RTL_AUTOLAND with rally points #23458
Merged
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.
After loading the rally point,
ModeRTL:navigate
checks if rally altitude has been reached beforealtitude_error_cm
gets updated:What this means is that with
RTL_AUTOLAND = 1
, if RTL is entered near a rally point, it will skip straight to the landing sequence instead of climbing to the rally point's altitude first.Instead of the fix in this PR, is there a reason we don't update this variable inside of
Plane::set_target_altitude_location
? That would seem to be the better place to do it, but I wasn't 100% sure. There are multiple places where we set the altitude error variable immediately after this function:ardupilot/ArduPlane/mode_guided.cpp
Lines 88 to 89 in 50eaa1c
ardupilot/ArduPlane/mode_qrtl.cpp
Lines 199 to 200 in 5c3d464