Skip to content

Nav RTH climb first fix #10908

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

breadoven
Copy link
Collaborator

Fixes an issue with the RTH climb first option when set to OFF which doesn't actually seem to work as expected, It should do a linear proportional climb back to the home point when nav_rth_climb_first is set OFF but instead it always performs a max auto climb rate climb instead.

@b14ckyy
Copy link
Collaborator

b14ckyy commented Jun 14, 2025

I am confused by your description.

When this is turned on, it just means it will climb in whatever direction the UAV faces (in case of fixed wing) until it reaches the desired altitude as fast as possible and then turn around.

When its off, its just turning around first and then climb to its desired altitude at the maximum climb rate to reach RTH-Alt.

I think you mix up the linear proportional climb with RTH Linear descent? If the UAV is below nav_rth_altitude it has to reach it as fast as possible to clear obstacles.

@breadoven
Copy link
Collaborator Author

I am confused by your description.

When this is turned on, it just means it will climb in whatever direction the UAV faces (in case of fixed wing) until it reaches the desired altitude as fast as possible and then turn around.

When its off, its just turning around first and then climb to its desired altitude at the maximum climb rate to reach RTH-Alt.

I think you mix up the linear proportional climb with RTH Linear descent? If the UAV is below nav_rth_altitude it has to reach it as fast as possible to clear obstacles.

Surely if you want to avoid obstacles you wouldn't set nav_rth_climb_first = OFF. The reason I thought this OFF option existed was to allow a gradual more efficient climb back to the home altitude (same idea as the linear climb between waypoints) turning toward home on the way. As it is now the only difference between OFF and ON is for a fixed wing where it either turns toward home as it climbs when OFF or when ON it flies off in some random direction, climbing at the same rate as OFF on the way. Unless you have a badly set up fixed wing that can't turn and climb at the same time, the ON setting is fairly pointless given there's no more guarantee of not hitting things turning to home immediately vs flying off in some random direction. Doesn't make a lot of sense.

@MrD-RC
Copy link
Collaborator

MrD-RC commented Jun 14, 2025

nav_rth_climb_first = on means the aircraft will continue flying in the current direction and climb to the RTH altitude or first stage climb altitude. Then turn to home. It will continue to climb to the RTH altitude if 2 stage climb first is used.

nav_rth_climb_first = off means that the aircraft will turn towards home. Then climb to the RTH altitude.

https://github.com/iNavFlight/inav/wiki/Navigation-Mode:-Return-to-Home#climb-first

It has nothing to do with rate of climb. Though that could be a good option. I would have that in a similar vein to 2 stage climb first though. So a full rate climb is performed to a safe altitude (above tree height for example. This should be a parameter). Then perform a slower climb above that altitude.

@b14ckyy
Copy link
Collaborator

b14ckyy commented Jun 14, 2025

As it is now the only difference between OFF and ON is for a fixed wing where it either turns toward home as it climbs when OFF or when ON it flies off in some random direction, climbing at the same rate as OFF on the way.

That's exactly what this option is meant to do.
The climb first option was implemented to serve people who fly in valleys or canyons. If you fly down a narrow canyon, its more likely that there is no obstacle in front of you and clear the altitude before turning, while turning first could lead into turning into a wall, hill, trees whatever.

so its just either do the turn first or do the climb first. It should not alter the way it climbs with each option.

@Jetrell
Copy link

Jetrell commented Jun 14, 2025

@breadoven It all depend on the location you fly. If you fly sub 250 wings at low altitude in parks. Well below tree level. It can be very beneficial for the plane to turn and climb fast at nav_fw_auto_climb_rate.

I agree it can be a bit of guess work in knowing whether its better to turn and climb. Or just climb then turn..
But in any case, I feel its the safer method to climb as fast as it can. Because we don't know the circumstances people fly. And RTH is often a bailout mode.

@breadoven
Copy link
Collaborator Author

breadoven commented Jun 14, 2025

OK well if that's the understanding of how this is expected to work then this PR isn't needed.

Personally the only use I can see for nav_rth_climb_first = off is for situations where you're flying in flat areas without obstacles where you use RTH as a lazy way of getting back home in which case using a proportional climb would be preferred. As @MrD-RC says though, climb rate could be another option ... but then the RTH options are confusing enough as it is so maybe not a great idea.

Edit:
Actually, there is a bug for fixed wing that this fixes which relates to the fact it doesn't arrive at the home altitude at the loiter radius from home which is what it should do. So I'll remove resetting the initial altitude to the current altitude at the start of the RTH and leave the rest as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants