Correct builds where no POI_LOCK is in but terrain is out#33396
Merged
rmackay9 merged 2 commits intoJun 16, 2026
Conversation
dc9edc7 enabled AP_MOUNT_POI_LOCK_ENABLED on all >1MB boards, but update_poi_lock_target() calls calculate_poi_at_home_alt() and get_poi(), which are only compiled in when AP_MOUNT_POI_TO_LATLONALT_ENABLED is set; that option additionally requires AP_TERRAIN_AVAILABLE, so >1MB boards without filesystem-backed terrain (e.g. BeastH7) failed to compile. calculate_poi_at_home_alt() has no terrain dependency, so compile it in whenever AP_MOUNT_POI_LOCK_ENABLED is set, and only attempt the terrain-intersection get_poi() refinement when AP_MOUNT_POI_TO_LATLONALT_ENABLED is set. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
calculate_poi_at_home_alt() can fail (no AHRS location, gimbal pointing above the horizon, target beyond 5km); its result was used regardless, locking the gimbal onto a default-constructed Location. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
9 tasks
Hwurzburg
approved these changes
Jun 14, 2026
Contributor
Author
Thanks for re-testing! ... and I think I approved the original, so we're all at fault here :-) I would still like to look at upending the deps at some stage, because I think that's going to bite us at some stage. |
Contributor
|
There's a secret bug fix commit here, has it been studied? |
rmackay9
approved these changes
Jun 15, 2026
rmackay9
left a comment
Contributor
There was a problem hiding this comment.
this looks correct to me
rmackay9
approved these changes
Jun 16, 2026
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.
Summary
Corrects compilation where an attempt was made to enable POI_LOCK but terrain's not available.
Classification & Testing (check all that apply and add your own)
BEASTH7 compiles afterwards.
Description
Sometimes boards can POI-lock their mount, but can't use terrain as they don't have anywhere to store the tiles (that's what the AP_TERRAIN_AVAILABLE is all about).
rejig things so that you can still poi-lock and it will use home rather than terrain altitude.
We should consider rejigging these defines to be the "correct way up" - so the dependent feature requires the base feature rather than enabling it.