Skip to content

Correct builds where no POI_LOCK is in but terrain is out#33396

Merged
rmackay9 merged 2 commits into
ArduPilot:masterfrom
peterbarker:pr-claude/mount-poi-no-terrain-build
Jun 16, 2026
Merged

Correct builds where no POI_LOCK is in but terrain is out#33396
rmackay9 merged 2 commits into
ArduPilot:masterfrom
peterbarker:pr-claude/mount-poi-no-terrain-build

Conversation

@peterbarker

Copy link
Copy Markdown
Contributor

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)

  • Checked by a human programmer
  • Non-functional change
  • No-binary change
  • Infrastructure change (e.g. unit tests, helper scripts)
  • Automated test(s) verify changes (e.g. unit test, autotest)
  • Tested manually, description below (e.g. SITL)
  • Tested on hardware
  • Logs attached
  • Logs available on request
Board                    AP_Periph  antennatracker  blimp  bootloader  copter  heli  iofirmware  plane  rover  sub
CubeOrange-periph-heavy  *                                 *                                                   
Durandal                            *               *      *           8       8                 0      8      0
Hitec-Airspeed           *                                 *                                                   
KakuteH7-bdshot                     *               *      *           0       8                 8      8      0
MatekF405                           *               *      *           *       *                 *      *      *
Pixhawk1-1M-bdshot                  *               *                  *       *                 *      *      *
SITL_x86_64_linux_gnu               *               *                  0       0                 0      0      0
YJUAV_A6SE                          *               *      *           8       0                 8      8      8
f103-QiotekPeriph        *                                 *                                                   
f303-MatekGPS            *                                 *                                                   
f303-Universal           *                                 *                                                   
iomcu                                                                                *                         
revo-mini                           *               *      *           *       *                 *      *      *
skyviper-v2450                                                         *                                       
speedybeef4                         *               *      *           *       *                 *      *      *

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.

peterbarker and others added 2 commits June 10, 2026 22:35
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>

@Hwurzburg Hwurzburg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats missing from this??? #32010

pretty sure it worked for me when terrain was not compiled in....could be imagining I suppose

@Hwurzburg Hwurzburg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I must have only tested with terrain disabled, not missing...tried to compile with terrain library missing on CubeOrange and it failed...then tried your PR with terrain not compiled in and the build succeeded...mea cupa

@peterbarker

Copy link
Copy Markdown
Contributor Author

You're right, I must have only tested with terrain disabled, not missing...tried to compile with terrain library missing on CubeOrange and it failed...then tried your PR with terrain not compiled in and the build succeeded...mea cupa

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.

@tpwrules

Copy link
Copy Markdown
Contributor

There's a secret bug fix commit here, has it been studied?

@rmackay9 rmackay9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks correct to me

@rmackay9 rmackay9 merged commit 1ee3fdd into ArduPilot:master Jun 16, 2026
130 of 132 checks passed
@peterbarker peterbarker deleted the pr-claude/mount-poi-no-terrain-build branch June 17, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending

Development

Successfully merging this pull request may close these issues.

5 participants