-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
ArduPlane: parameterize lookahead climb ratio #28891
base: master
Are you sure you want to change the base?
Conversation
Hi George - could you take a look? Any suggestions? |
07829f9
to
b2bc7c5
Compare
b2bc7c5
to
4da32dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Tim!
I've tried to read and internalize the lookahead code, but it's quite opaque; in the way I understand it, it's plainly wrong.
So I probably understand it wrong.
But that means that I shouldn't just expect your intervention to have no side effects.
Instead, do you have any test results (logs), where before the plane wouldn't manage a climb and now it does?
@@ -605,7 +605,7 @@ float Plane::lookahead_adjustment(void) | |||
// we need to know the climb ratio. We use 50% of the maximum | |||
// climb rate so we are not constantly at 100% throttle and to | |||
// give a bit more margin on terrain | |||
float climb_ratio = 0.5f * TECS_controller.get_max_climbrate() / groundspeed; | |||
float climb_ratio = g2.pitch_lookahead_climb_ratio * TECS_controller.get_max_climbrate() / groundspeed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, this will replace 0.5 with 50. That's not what we want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds like a bug - thanks.
No you have it right. I had to rewrite terrain lookahead in my terrain avoidance Lua script #28625 because of that. In fact the only thing I really want out of it is the parameter value :-), so that my Lua based lookahead can use the same ratio. |
Plane altitude terrain lookahead currently uses a fairly arbitrary but safe 50% factor when calculating the maximum pitch to assume when calculating the if the plane can safely fly over the approaching terrain.
Some users want to be more aggressive than the default. so this makes the 50% factor into a parameter. The default is no-change to current behavior, but by changing PTCH_LKAHD_CLMB users can now chose a more (or less) aggressive factor for the percentage of maximum climb factor to use when calculating terrain lookahead.