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

Copter: Use RTL_CLIMB_MIN in cone slope. #25660

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

lthall
Copy link
Contributor

@lthall lthall commented Nov 28, 2023

This PR replaces the hard coded height increase in the cone slope calculation with the parameter RTL_CLIMB_MIN.

The current behaviour determines the RTL altitude based on the minimum of:

  • The parameter RTL_ALT (default 10m)
  • The hash define RTL_ALT_MIN (2m)
  • The current altitude + RTL_CLIMB_MIN

If we are in the cone slope we can reduce the altitude to a minimum of:

  • rtl_return_dist_cm * RTL_CONE_SLOPE
  • The current altitude + RTL_ABS_MIN_CLIMB (2.5m)

This means that even if you are right above the RTL location the aircraft will increase in altitude by 2.5m before descending.

This PR changes the minimum altitude in the cone to:

  • rtl_return_dist_cm * RTL_CONE_SLOPE
  • MAX(RTL_ALT_MIN, The current altitude + RTL_CLIMB_MIN)

This means that when you are right over the landing point the aircraft will only increase in altitude by RTL_CLIMB_MIN or to a minimum of 2m.

@lthall lthall force-pushed the 20231128_RTL_MinRTL_CLIMB_MIN branch from ad9cf4f to f3caf78 Compare November 28, 2023 22:57
@rmackay9
Copy link
Contributor

RTL_CLIMB_MIN defaults to zero so this will change the behaviour for most users. Maybe you can write a couple of lines explaining what the difference will be from a user's point of view?

@lthall lthall force-pushed the 20231128_RTL_MinRTL_CLIMB_MIN branch 2 times, most recently from b8653e1 to 250ba36 Compare December 1, 2023 00:15
ArduCopter/mode_rtl.cpp Outdated Show resolved Hide resolved
@lthall lthall force-pushed the 20231128_RTL_MinRTL_CLIMB_MIN branch from 250ba36 to 66bd97c Compare December 6, 2023 00:07
@lthall lthall requested review from IamPete1 and removed request for peterbarker December 6, 2023 00:35
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.

Looks good.

@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label Dec 12, 2023
@tridge tridge merged commit e48b7ce into ArduPilot:master Dec 12, 2023
68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement WikiNeeded needs wiki update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants