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

Enhance Linear Descent RTH feature #8810

Merged
merged 3 commits into from Apr 23, 2023
Merged

Conversation

MrD-RC
Copy link
Collaborator

@MrD-RC MrD-RC commented Feb 19, 2023

Addresses an issue/request discussed on Discord

This PR takes the existing Linear Descent option for RTH and enhances it. Firstly, Linear Descent is now no longer an RTH type. If previously using AT_LEAST_LINEAR_DESCENT, you should now just use AT_LEAST as the RTH type. Linear Descent is now a separate option that can be used with any other RTH type. To do this, the target altitude of the descent is now the nav_rth_home_altitude. In some cases, if flying below the home position, this could even be a linear ascent.

An option has also been added to decide how far away the linear descent starts. This is via the nav_rth_linear_descent_start_distance parameter. Current behaviour can be maintained by setting this to 0 [default]. You can also specify a distance from home when the descent begins. This is in metres and be up to 10km. Of course, this value can be adjusted if required.

This has been tested in HITL using AT_LEAST and MAX RTH types. There have been tests with linear descent enabled or disabled, and with varying start distances. All test results as expected. I will create some test videos shortly with other RTH types and with RTH Home Altitude set to 0.

Configurator

This change require configurator PR iNavFlight/inav-configurator#1727

Options to set up Linear Descent have been added to the Configurator.
image

If Linear Descent is enabled, and the RTH Home Altitude is less than 10m. A warning is shown around the RTH Home Altitude input box. People can still enter whatever values they want, including 0. If the RTH Home Altitude is not set, Linear Descent is not used in flight.
image

Fixes #8739

This PR takes the existing Linear Descent option for RTH and enhances it. Firstly, Linear Descent is now no longer an RTH type. If previously using `AT_LEAST_LINEAR_DESCENT`, you should now just use `AT_LEAST` as the RTH type. Linear Descent is now a separate option that can be used with and other RTH type. To do this, the target altitude of the descent is now the `nav_rth_home_altitude`. In some cases, if flying below the home position, this could even be a linear ascent.

An option has also been added to decide how far away the linear descent starts. This is via the `nav_rth_linear_descent_start_distance` parameter. Current behaviour can be maintained by setting this to `0` [default]. You can also specify a distance from home when the descent begins. This is in metres and be up to 10km away. Of course, this value can be adjusted if required.
@MrD-RC MrD-RC added Testing Required Release Notes Add this when a PR needs to be mentioned in the release notes Requires Configurator labels Feb 19, 2023
@MrD-RC MrD-RC added this to the 6.1 milestone Feb 19, 2023
@Jetrell
Copy link

Jetrell commented Feb 20, 2023

@MrD-RC The tests of this feature went well with a quad.
There was a slight headwind (6kph),

Setting were -
nav_rth_alt_mode = EXTRA
nav_rth_altitude = 3000 (30m on top of RTH activation altitude)
nav_rth_home_altitude = 1500 (15m)
nav_rth_linear_descent_start_distance = 100 (Linear descent starts 100m from home)

Linear.descent.radius.mp4

@MrD-RC
Copy link
Collaborator Author

MrD-RC commented Feb 21, 2023

HITL Tests

Firstly, I have to say that with the video capture software running in the background. The flight gets jumpy and the OSD data is a bit laggy. But, the numbers ultimately get hit. Plus, without the capture software, the flight is much more realistic.

Linear Descent inactive tests

Test 1 - AT_LEAST : Linear Descent OFF

I only ran one test with Linear Descent OFF, because the functionality is independent on the RTH type. So ON/OFF is the same for all.

https://youtu.be/w8zDatgi4Ms

Test 2 - AT_LEAST : Linear Descent ON - No home altitude set

If home altitude is set to 0. Linear Descent should be ignored, even if turned on. Again, I only ran this test once, as it is independent of RTH type.

https://youtu.be/Bl2JhCrzdxo

Linear Descent active tests

In all these tests, Linear Descent is turned ON. A RTH Home Altitude of 75 metres is set. And a Linear Descent start distance of 1500m.

Test 3 - AT_LEAST

https://youtu.be/-WqhLdVTdjw

Test 4 - MAX

https://youtu.be/PLMYaqD56tA

Test 5 - FIXED

https://youtu.be/rTbCV8SYiQ0

Test 6 - EXTRA

There are two parts to this test. Part one is how a normal RTH would be. In part 2, I tried seeing what would happen starting at a negative altitude.

https://youtu.be/jUVhHkTK-pM

Test 7 - CURRENT

https://youtu.be/cg8FCClzQ3U

@DzikuVx DzikuVx changed the base branch from master to release_6.1.0 March 14, 2023 20:29
@MrD-RC MrD-RC modified the milestones: 6.1, 7.0 Mar 16, 2023
@MrD-RC
Copy link
Collaborator Author

MrD-RC commented Mar 17, 2023

This will need to be 7.0 as it breaks compatibility. I originally set to the 6.1 milestone as there was no 7.0, and I expected 6.1 to just be renamed 7.0. I guess 6.1 will just be a pretty small release.

@MrD-RC MrD-RC changed the base branch from release_6.1.0 to master March 17, 2023 22:07
@MrD-RC
Copy link
Collaborator Author

MrD-RC commented Apr 16, 2023

Tested in flight. Worked as expected.

@MrD-RC MrD-RC merged commit d2d93e6 into master Apr 23, 2023
15 checks passed
@MrD-RC MrD-RC deleted the MrD_Enhance-RTH-Linear-Descent branch April 23, 2023 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready to merge Release Notes Add this when a PR needs to be mentioned in the release notes Requires Configurator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linear Descent radius relative to the home point
2 participants