-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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 attitude control base class #25224
Copter: use attitude control base class #25224
Conversation
I was able to get params working by moving to a var pointer param table with |
580a60b
to
6440cab
Compare
6440cab
to
b099c30
Compare
@@ -1,4 +1,5 @@ | |||
#include "AC_CustomControl_PID.h" | |||
#include "AC_AttitudeControl/AC_AttitudeControl_Multi.h" |
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 needed because the same default defines are used for PID gains.
This is saving a suspicious amount of flash on Durandal:
Much closer to what I would have expected on other the other builds, this is Pixhawk1-1M:
I will run elf diff and see where the saving is coming from. |
Elf diff here: https://drive.google.com/file/d/1ttP5etMZU84Gjc-8dE6Um4KbaFqQPz8i/view?usp=sharing All of the changes are in persisting symbols. So no functions are added or lost. I don't think we have lost any functionality. Its only a saving on 2M boards, so its probably related to the optimization level. I usually put such things down to "alignment". |
Heli elf-diff, look like the same thing: https://drive.google.com/file/d/1u0rjDFlPjxEqXVyrg1rTontytBn8WwmB/view?usp=sharing |
The base
AC_AttitudeControl
class implements all the methods fromAC_AttitudeControl_Heli
andAC_AttitudeControl_Multi
so there is no need for the extra level of indirection.This also changes over
AC_CustomControl
fromAC_AttitudeControl_Multi
toAC_AttitudeControl
.If we were to add any new methods to multi or heli attitude control this now requires that a virtual or pure virtual function be added in the base class and then overridden, but we have been following that pattern anyway.