Skip to content

AP_Landing: fixed assumption of AMSL WPs #30041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tridge
Copy link
Contributor

@tridge tridge commented May 12, 2025

the AP_Landing library assumed AMSL waypoints for both prev_WP_loc and next_WP_loc. This led to an incorrect glide slope for a NAV_LAND fixed wing landing when the landing WP is terrain relative.

This change fixes the code to handle either an AGL or AMSL location, which are the only two location types used in plane

fixes an issue in 4.6.0-beta reported here: https://discuss.ardupilot.org/t/plane-4-6-0-beta/126358/183

tested in SITL

the AP_Landing library assumed AMSL waypoints for both prev_WP_loc and
next_WP_loc. This led to an incorrect glide slope for a NAV_LAND fixed
wing landing when the landing WP is terrain relative.

This change fixes the code to handle either an AGL or AMSL location,
which are the only two location types used in plane
Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

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

Looks right.

I don't think this is a regression in 4.6, is it?

... but really should have an autotest.

if (loc.get_alt_frame() == Location::AltFrame::ABOVE_TERRAIN) {
// if we can't get true terrain then assume flat terrain
// around home
return loc.alt + ahrs.get_home().alt;
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice to not reference the private-in-the-future .alt field directly in new code.

@tridge
Copy link
Contributor Author

tridge commented May 12, 2025

@peterbarker it is a regression from 4.5.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants