-
Notifications
You must be signed in to change notification settings - Fork 17.2k
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
Legibility changes #27124
Legibility changes #27124
Conversation
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.
The K_thr2STE maths is not equivalent, just remove that bit now. The other changes look OK
@@ -749,7 +749,7 @@ void AP_TECS::_update_throttle_with_airspeed(void) | |||
// drag increase during turns. | |||
const float cosPhi = sqrtf((rotMat.a.y*rotMat.a.y) + (rotMat.b.y*rotMat.b.y)); | |||
STEdot_dem = STEdot_dem + _rollComp * (1.0f/constrain_float(cosPhi * cosPhi, 0.1f, 1.0f) - 1.0f); | |||
const float ff_throttle = nomThr + STEdot_dem / (_STEdot_max - _STEdot_min) * (_THRmaxf - _THRminf); |
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.
this is not equivalent. The const var is doing / and this one is doing *.
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.
I did the math on my mind, with pencil and paper and here too:
nomThr + STEdot_dem / (_STEdot_max - _STEdot_min) * (_THRmaxf - _THRminf) =
nomThr + STEdot_dem * (_THRmaxf - _THRminf) / (_STEdot_max - _STEdot_min) =
nomThr + STEdot_dem * ( (_THRmaxf - _THRminf) / (_STEdot_max - _STEdot_min) ) =
nomThr + STEdot_dem / ( (_STEdot_max - _STEdot_min) / (_THRmaxf - _THRminf) ) =
nomThr + STEdot_dem / K_thr2STE
Perhaps you can give it another look?
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.
Not sure why it fails the CI, though.
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.
I think this is correct, should be checked again
@magicrub note the lack of () in the original, makes it on the numerator
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.
Ping @magicrub
9752697
to
b08a305
Compare
b08a305
to
2ae8d23
Compare
I tested this PR with this patch on top:
... and there were not aborts. Merging as agreed on DevCall last night. |
This PR is two small legibility improvements in TECS.cpp
It also adds small typo fixes I did while reading TECS.cpp.