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: fix bug in RTL_AUTOLAND with rally points #23458

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

robertlong13
Copy link
Collaborator

After loading the rally point, ModeRTL:navigate checks if rally altitude has been reached before altitude_error_cm gets updated:

What this means is that with RTL_AUTOLAND = 1, if RTL is entered near a rally point, it will skip straight to the landing sequence instead of climbing to the rally point's altitude first.

Instead of the fix in this PR, is there a reason we don't update this variable inside of Plane::set_target_altitude_location? That would seem to be the better place to do it, but I wasn't 100% sure. There are multiple places where we set the altitude error variable immediately after this function:

plane.set_target_altitude_location(temp);
plane.altitude_error_cm = plane.calc_altitude_error_cm();

plane.set_target_altitude_location(loc);
plane.altitude_error_cm = plane.calc_altitude_error_cm();

@tridge
Copy link
Contributor

tridge commented Jul 3, 2023

@robertlong13 can you provide a SITL log showing this issue? I'd like to see exactly how you have your params setup

@robertlong13
Copy link
Collaborator Author

robertlong13 commented Jul 3, 2023

00000007.zip

To reproduce:

  1. Be within RTL radius of the rally point
  2. Have achieved your target altitude for the currently executing waypoint and/or mode
  3. Trigger the RTL manually from the GCS

@tridge tridge force-pushed the plane_rally_rtl_bug branch from 46d44af to 383dcf5 Compare October 2, 2023 20:58
After loading the rally point, ModeRTL:navigate checks if rally altitude
has been reached before altitude_error_cm gets updated
@robertlong13
Copy link
Collaborator Author

Tested again today. This bug is still present, and this fix still works.
logs.zip

Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

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

This looks OK to me. It will happen anyway at 10Hz in update_target_altitude so I don't think this will introduce any bugs, although it may make a existing one more likely.

@tridge tridge merged commit f8d7be5 into ArduPilot:master Dec 11, 2023
56 of 57 checks passed
@robertlong13 robertlong13 deleted the plane_rally_rtl_bug branch December 12, 2023 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants