-
Notifications
You must be signed in to change notification settings - Fork 364
Fied wing updates #304
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
base: master
Are you sure you want to change the base?
Fied wing updates #304
Changes from all commits
ce866ac
39a986b
f2066ac
e5b6ad3
57a4b9d
e9f73c0
a8b4ff1
912220a
c80cc71
a75f59f
f90a1d1
e912073
5991dc9
9905832
4b3564a
0bbef09
44b2f32
c32a76e
9d83e01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,7 +134,7 @@ static const motorMixer_t mixerDualcopter[] = { | |
{ 1.0f, 0.0f, 0.0f, 1.0f }, // RIGHT | ||
}; | ||
|
||
static const motorMixer_t mixerTrustVector[] = { | ||
static const motorMixer_t mixerVectorThrust[] = { | ||
{ 1.0f, 0.0f, 0.0f, -0.5f }, // LEFT | ||
{ 1.0f, 0.0f, 0.0f, 0.5f }, // RIGHT | ||
}; | ||
|
@@ -150,13 +150,13 @@ const mixer_t mixers[] = { | |
{ 0, 1, NULL }, // * MULTITYPE_GIMBAL | ||
{ 6, 0, mixerY6 }, // MULTITYPE_Y6 | ||
{ 6, 0, mixerHex6P }, // MULTITYPE_HEX6 | ||
{ 2, 1, mixerTrustVector }, // * MULTITYPE_FLYING_WING | ||
{ 2, 1, mixerVectorThrust }, // * MULTITYPE_FLYING_WING | ||
{ 4, 0, mixerY4 }, // MULTITYPE_Y4 | ||
{ 6, 0, mixerHex6X }, // MULTITYPE_HEX6X | ||
{ 8, 0, mixerOctoX8 }, // MULTITYPE_OCTOX8 | ||
{ 8, 0, mixerOctoFlatP }, // MULTITYPE_OCTOFLATP | ||
{ 8, 0, mixerOctoFlatX }, // MULTITYPE_OCTOFLATX | ||
{ 1, 1, NULL }, // * MULTITYPE_AIRPLANE | ||
{ 2, 1, mixerVectorThrust }, // * MULTITYPE_AIRPLANE | ||
{ 0, 1, NULL }, // * MULTITYPE_HELI_120_CCPM | ||
{ 0, 1, NULL }, // * MULTITYPE_HELI_90_DEG | ||
{ 4, 0, mixerVtail4 }, // MULTITYPE_VTAIL4 | ||
|
@@ -166,7 +166,7 @@ const mixer_t mixers[] = { | |
{ 1, 1, NULL }, // MULTITYPE_SINGLECOPTER | ||
{ 4, 0, mixerAtail4 }, // MULTITYPE_ATAIL4 | ||
{ 0, 0, NULL }, // MULTITYPE_CUSTOM | ||
{ 1, 1, NULL }, // MULTITYPE_CUSTOM_PLANE | ||
{ 2, 1, mixerVectorThrust }, // MULTITYPE_CUSTOM_PLANE | ||
}; | ||
|
||
// mixer rule format servo, input, rate, speed, min, max, box | ||
|
@@ -545,15 +545,18 @@ void mixTable(void) | |
} | ||
|
||
// motors for non-servo mixes | ||
if (numberMotor > 1) | ||
for (i = 0; i < numberMotor; i++) | ||
if (numberMotor > 1) { | ||
for (i = 0; i < numberMotor; i++) { | ||
motor[i] = rcCommand[THROTTLE] * currentMixer[i].throttle + axisPID[PITCH] * currentMixer[i].pitch + axisPID[ROLL] * currentMixer[i].roll + -cfg.yaw_direction * axisPID[YAW] * currentMixer[i].yaw; | ||
|
||
if (f.FIXED_WING) { | ||
if (!f.ARMED) | ||
motor[0] = mcfg.mincommand; // Kill throttle when disarmed | ||
else | ||
motor[0] = constrain(rcCommand[THROTTLE], mcfg.minthrottle, mcfg.maxthrottle); | ||
if (f.FIXED_WING) { // vector_thrust handeling | ||
if (cfg.fw_vector_thrust) { | ||
if (f.PASSTHRU_MODE) | ||
motor[i] = rcCommand[THROTTLE] - rcCommand[YAW] * (i - 0.5f); | ||
} else { // Override mixerVectorThrust | ||
motor[i] = rcCommand[THROTTLE]; | ||
} | ||
} | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm, I'm actually not understanding why this is necessary?
Is this correct?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess it's vector THRUST. if cfg.fw_vector_trust = false The for loop is used to write motor[i] = |
||
|
||
// airplane / servo mixes | ||
|
@@ -639,6 +642,7 @@ void mixTable(void) | |
} | ||
if (!f.ARMED) { | ||
motor[i] = motor_disarmed[i]; | ||
f.MOTORS_STOPPED = 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.
There has to be a better way to write the above, I don't understand what current version does so surely there's a simpler way.