fix(navigator): enforce NAV_MIN_LTR_ALT in MC braking loiter#27680
Open
saad1551 wants to merge 1 commit into
Open
fix(navigator): enforce NAV_MIN_LTR_ALT in MC braking loiter#27680saad1551 wants to merge 1 commit into
saad1551 wants to merge 1 commit into
Conversation
69ef25b to
344e6e3
Compare
Contributor
🔎 FLASH Analysispx4_fmu-v5x [Total VM Diff: 48 byte (0 %)]px4_fmu-v6x [Total VM Diff: 48 byte (0 %)]Updated: 2026-06-17T05:19:54 |
When a multicopter enters Hold (AUTO.LOITER) below NAV_MIN_LTR_ALT the documented behavior is to first climb to that minimum altitude. The clamp was added in 2022 to setLoiterItemFromCurrentPosition (the fixed-wing branch) but never applied to the sibling setLoiterItemFromCurrentPositionWithBraking, which is the rotary-wing Hold path selected at loiter.cpp:131. As a result, multicopters silently held at the entry altitude. Apply the same min-altitude clamp in the braking variant so the rotary-wing path matches the fixed-wing one. Verified in SITL (jMAVSim x500): with NAV_MIN_LTR_ALT=20 and Hold engaged from a 5m hover, the vehicle now climbs to 20m as documented. Fixes PX4#27578 Signed-off-by: saad1551 <saad.ashraf.9094@gmail.com>
344e6e3 to
4100aee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Multicopter Hold/AUTO.LOITER silently ignores
NAV_MIN_LTR_ALTwhen entered below the configured altitude, contradicting the documented behavior. The min-altitude clamp was added toMissionBlock::setLoiterItemFromCurrentPositionin 2022 but never applied to the siblingsetLoiterItemFromCurrentPositionWithBraking, which is the multicopter Hold path selected atloiter.cpp:131(vehicle_type == ROTARY_WING). Fixed-wing keeps working because it takes the non-braking branch.This PR copies the same four-line clamp into the braking variant so the rotary-wing path matches.
Reproduced and verified in SITL (jMAVSim x500):
NAV_MIN_LTR_ALT=20, Hold entered at ~5 m → vehicle held at 5 m for 30 s.Local sanity:
make px4_sitlbuilds cleanmake px4_fmu-v6xnot built locally (no arm toolchain on this machine — CI covers it)Fixes #27578