-
Notifications
You must be signed in to change notification settings - Fork 360
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
Make servoMixer work for types other than CUSTOM_PLANE #289
Conversation
* Added SERVO_MIXER feature to enable the servo mixer regardless of craft type * Reset servos before applying servo values due to SERVO_TILT feature or GIMBAL type * Servo mixer rules can override values set by SERVO_TILT feature and GIMBAL type * Only apply rates to servo values affected by servo mixer rules * Apply servo values to channels 1 and 2 when SERVO_MIXER feature is enabled * Fix bug where input values in servoMixer were reversed due to subtracting the RC value from the RC middle value * Center all servos by default
Can one of the admins verify this patch? |
@@ -463,6 +474,13 @@ void writeAllMotors(int16_t mc) | |||
writeMotors(); | |||
} | |||
|
|||
static void resetServos(void) { |
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.
style
// run the servo mixer if necessary | ||
if (core.useServo == 1) { | ||
servoMixer(); | ||
} |
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.
single line if does not need braces
@@ -588,20 +606,14 @@ void mixTable(void) | |||
} | |||
} | |||
|
|||
// run the servo mixer if necessary | |||
if (core.useServo == 1) |
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.
just if (core.useServo) is fine, rest of the code does this
Make servoMixer work for types other than CUSTOM_PLANE
Motivation
I wanted to use the servo mixer to assign a certain switch to control a servo on a certain ESC header on my quadcopter.
This change lets you enable the servo mixer for and create rules to do just that.
Usage: Control servos on a QUADX
The wiring is as follows:
Header 1: Servo 1
Header 2: Servo 2
Header 3: Motor 1
Header 4: Motor 2
Header 5: Motor 3
Header 6: Motor 4
Changes
When is servo mixer enabled?
Assuming you've set
feature SERVOMIXER
, the servo mixer is enabled as follows, based on your type:Servo mixer is enabled and works as it currently does, but only on the servos that are already used by this multitype
Servo mixer works for servos 1 and 2