-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
AP_Motors: Heli_Dual: refactor swash plate mixing #25405
Conversation
6f07834
to
d337096
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.
This reads a lot better IMHO, way easier to follow.
I have left a few minor comments which you can take or leave.
} | ||
|
||
// look away now, more dodgy param access. | ||
AP_Int8 *dual_mode = (AP_Int8*)motors + AP_MotorsHeli_Dual::var_info[1].offset; |
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.
How much work would it be to add a proper param accessor in AP_Motors_test? Just thinking to make it easier to add other configs in the future?
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.
There are two ways,
1: instantiate AP_Param fully and add a base param table so we can get at the params by name.
2: add setters and getters to motors.
1 is slightly better because its contained in the example whereas 2 would need changes in motors that are only used by this example.
We could do it in the future, it should not be a huge job.
libraries/AP_Motors/examples/AP_Motors_test/run_heli_comparison.py
Outdated
Show resolved
Hide resolved
d337096
to
62cbf67
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.
@IamPete1 Thanks for cleaning this up. I am not super picky about this type of stuff and I appreciate you and @Gone4Dirt spending the time cleaning up the code.
I will add that one feature that will need to be added in the future for Tandem heli's is the ability to set a trim longitudinal cyclic input. That way the cyclic pitch can be used to overcome drag and maintain speed without having high trim pitch attitudes. I've had some partners asking about that. But that requires more than just changing the motors class
This re-factors the dual heli swash plate mixing. The motors example was updated to allow setting of the
H_DUAL_MODE
in the heli test. This allowed a full sweep comparison or each dual heli type.Results: