Skip to content
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

Plane: fixed terrain RTL rally bug #25165

Merged
merged 2 commits into from
Oct 13, 2023

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Oct 3, 2023

this fixes a bug where if the terrain database cache does not have the tile for the location of a rally point then RTL to the rally point with TERRAIN_FOLLOW=1 will not track terrain

The underlying issue is that Location::loc.change_alt_frame() will return false if the location is not in the terrain memory cache. We can't just extrapolate as the rally point could be in a totally different terrain area to the current location. So instead we set it as terrain_following_pending and fix it as soon as the terrain cache is filled.

this fixes #25157

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.

The fix look good, but we still have several calls to change_alt_frame which are not checked. Not all that many, actually.

Tools/autotest/arduplane.py Show resolved Hide resolved
Tools/autotest/common.py Outdated Show resolved Hide resolved
Tools/autotest/common.py Show resolved Hide resolved
Tools/autotest/arduplane.py Outdated Show resolved Hide resolved
Tools/autotest/arduplane.py Show resolved Hide resolved
Tools/autotest/arduplane.py Show resolved Hide resolved
Tools/autotest/arduplane.py Outdated Show resolved Hide resolved
Tools/autotest/arduplane.py Outdated Show resolved Hide resolved
@peterbarker
Copy link
Contributor

... should have mentioned #25168 contains that new method.

@tridge tridge removed the DevCallEU label Oct 4, 2023
this fixes a bug where if the terrain database cache does not have the
tile for the location of a rally point then RTL to the rally point
with TERRAIN_FOLLOW=1 will not track terrain

The underlying issue is that Location::loc.change_alt_frame() will
return false if the location is not in the terrain memory cache. We
can't just extrapolate as the rally point could be in a totally
different terrain area to the current location. So instead we set it
as terrain_following_pending and fix it as soon as the terrain cache
is filled.

fixes ArduPilot#25157
@tridge tridge force-pushed the pr-rally-rtl-fail-test branch from 41def28 to a95b2c4 Compare October 12, 2023 23:04
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.

LGTM

Tools/autotest/common.py Show resolved Hide resolved
@tridge tridge merged commit c980e04 into ArduPilot:master Oct 13, 2023
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 4.4.2 / 4.4.2-beta1
Status: 4.4.2-beta1
Development

Successfully merging this pull request may close these issues.

Plane: RTL with rally point does not track terrain
3 participants