1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

Merge remote-tracking branch 'origin/laurent/OP-1063_Multi_config_Hexa_fixes' into rel-14.06

This commit is contained in:
Alessio Morale 2014-07-16 20:07:31 +02:00
commit 25c54ac16d
15 changed files with 18170 additions and 22390 deletions

View File

@ -265,7 +265,9 @@ FrameType_t GetCurrentFrameType()
case SYSTEMSETTINGS_AIRFRAMETYPE_QUADP:
case SYSTEMSETTINGS_AIRFRAMETYPE_HEXA:
case SYSTEMSETTINGS_AIRFRAMETYPE_OCTO:
case SYSTEMSETTINGS_AIRFRAMETYPE_OCTOX:
case SYSTEMSETTINGS_AIRFRAMETYPE_HEXAX:
case SYSTEMSETTINGS_AIRFRAMETYPE_HEXAH:
case SYSTEMSETTINGS_AIRFRAMETYPE_OCTOV:
case SYSTEMSETTINGS_AIRFRAMETYPE_OCTOCOAXP:
case SYSTEMSETTINGS_AIRFRAMETYPE_HEXACOAX:

View File

@ -190,7 +190,8 @@ static void vtolPathFollowerTask(__attribute__((unused)) void *parameters)
&& (systemSettings.AirframeType != SYSTEMSETTINGS_AIRFRAMETYPE_HEXA) && (systemSettings.AirframeType != SYSTEMSETTINGS_AIRFRAMETYPE_HEXAX)
&& (systemSettings.AirframeType != SYSTEMSETTINGS_AIRFRAMETYPE_HEXACOAX) && (systemSettings.AirframeType != SYSTEMSETTINGS_AIRFRAMETYPE_OCTO)
&& (systemSettings.AirframeType != SYSTEMSETTINGS_AIRFRAMETYPE_OCTOV) && (systemSettings.AirframeType != SYSTEMSETTINGS_AIRFRAMETYPE_OCTOCOAXP)
&& (systemSettings.AirframeType != SYSTEMSETTINGS_AIRFRAMETYPE_TRI)) {
&& (systemSettings.AirframeType != SYSTEMSETTINGS_AIRFRAMETYPE_TRI) && (systemSettings.AirframeType != SYSTEMSETTINGS_AIRFRAMETYPE_HEXAH)
&& (systemSettings.AirframeType != SYSTEMSETTINGS_AIRFRAMETYPE_OCTOX)) {
AlarmsSet(SYSTEMALARMS_ALARM_GUIDANCE, SYSTEMALARMS_ALARM_WARNING);
vTaskDelay(1000);
continue;

View File

@ -56,6 +56,33 @@ QStringList ConfigMultiRotorWidget::getChannelDescriptions()
GUIConfigDataUnion configData = getConfigData();
multiGUISettingsStruct multi = configData.multi;
// Octocopter X motor definition
if (multi.VTOLMotorNNE > 0 && multi.VTOLMotorNNE <= ConfigMultiRotorWidget::CHANNEL_NUMELEM) {
channelDesc[multi.VTOLMotorNNE - 1] = QString("VTOLMotorNNE");
}
if (multi.VTOLMotorENE > 0 && multi.VTOLMotorENE <= ConfigMultiRotorWidget::CHANNEL_NUMELEM) {
channelDesc[multi.VTOLMotorENE - 1] = QString("VTOLMotorENE");
}
if (multi.VTOLMotorESE > 0 && multi.VTOLMotorESE <= ConfigMultiRotorWidget::CHANNEL_NUMELEM) {
channelDesc[multi.VTOLMotorESE - 1] = QString("VTOLMotorESE");
}
if (multi.VTOLMotorSSE > 0 && multi.VTOLMotorSSE <= ConfigMultiRotorWidget::CHANNEL_NUMELEM) {
channelDesc[multi.VTOLMotorSSE - 1] = QString("VTOLMotorSSE");
}
if (multi.VTOLMotorSSW > 0 && multi.VTOLMotorSSW <= ConfigMultiRotorWidget::CHANNEL_NUMELEM) {
channelDesc[multi.VTOLMotorSSW - 1] = QString("VTOLMotorSSW");
}
if (multi.VTOLMotorWSW > 0 && multi.VTOLMotorWSW <= ConfigMultiRotorWidget::CHANNEL_NUMELEM) {
channelDesc[multi.VTOLMotorWSW - 1] = QString("VTOLMotorWSW");
}
if (multi.VTOLMotorWNW > 0 && multi.VTOLMotorWNW <= ConfigMultiRotorWidget::CHANNEL_NUMELEM) {
channelDesc[multi.VTOLMotorWNW - 1] = QString("VTOLMotorWNW");
}
if (multi.VTOLMotorNNW > 0 && multi.VTOLMotorNNW <= ConfigMultiRotorWidget::CHANNEL_NUMELEM) {
channelDesc[multi.VTOLMotorNNW - 1] = QString("VTOLMotorNNW");
}
// End OctocopterX
if (multi.VTOLMotorN > 0 && multi.VTOLMotorN <= ConfigMultiRotorWidget::CHANNEL_NUMELEM) {
channelDesc[multi.VTOLMotorN - 1] = QString("VTOLMotorN");
}
@ -110,8 +137,8 @@ ConfigMultiRotorWidget::ConfigMultiRotorWidget(QWidget *parent) :
m_aircraft->quadShape->setScene(scene);
QStringList multiRotorTypes;
multiRotorTypes << "Tricopter Y" << "Quad +" << "Quad X" << "Hexacopter" << "Hexacopter X" << "Hexacopter Y6"
<< "Octocopter" << "Octocopter V" << "Octo Coax +" << "Octo Coax X";
multiRotorTypes << "Tricopter Y" << "Quad +" << "Quad X" << "Hexacopter" << "Hexacopter X" << "Hexacopter H" << "Hexacopter Y6"
<< "Octocopter" << "Octocopter X" << "Octocopter V" << "Octo Coax +" << "Octo Coax X";
m_aircraft->multirotorFrameType->addItems(multiRotorTypes);
// Set default model to "Quad X"
@ -158,16 +185,23 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
} else if (frameType == "Hexa" || frameType == "Hexacopter") {
setComboCurrentIndex(m_aircraft->multirotorFrameType, m_aircraft->multirotorFrameType->findText("Hexacopter"));
m_aircraft->mrRollMixLevel->setValue(50);
m_aircraft->mrPitchMixLevel->setValue(33);
setYawMixLevel(33);
m_aircraft->mrRollMixLevel->setValue(100); // Old Roll 50 - Pitch 33 - Yaw 33
m_aircraft->mrPitchMixLevel->setValue(100); // Do not alter mixer matrix
setYawMixLevel(100);
} else if (frameType == "HexaX" || frameType == "Hexacopter X") {
setComboCurrentIndex(m_aircraft->multirotorFrameType,
m_aircraft->multirotorFrameType->findText("Hexacopter X"));
m_aircraft->mrRollMixLevel->setValue(33);
m_aircraft->mrPitchMixLevel->setValue(50);
setYawMixLevel(33);
m_aircraft->mrRollMixLevel->setValue(100); // Old: Roll 33 - Pitch 50 - Yaw 33
m_aircraft->mrPitchMixLevel->setValue(100); // Do not alter mixer matrix
setYawMixLevel(100);
} else if (frameType == "HexaH" || frameType == "Hexacopter H") {
setComboCurrentIndex(m_aircraft->multirotorFrameType,
m_aircraft->multirotorFrameType->findText("Hexacopter H"));
m_aircraft->mrRollMixLevel->setValue(100); // Do not alter mixer matrix
m_aircraft->mrPitchMixLevel->setValue(100); // All mixers RPY levels = 100%
setYawMixLevel(100);
} else if (frameType == "HexaCoax" || frameType == "Hexacopter Y6") {
setComboCurrentIndex(m_aircraft->multirotorFrameType,
m_aircraft->multirotorFrameType->findText("Hexacopter Y6"));
@ -178,9 +212,15 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
} else if (frameType == "Octo" || frameType == "Octocopter") {
setComboCurrentIndex(m_aircraft->multirotorFrameType, m_aircraft->multirotorFrameType->findText("Octocopter"));
m_aircraft->mrRollMixLevel->setValue(33);
m_aircraft->mrPitchMixLevel->setValue(33);
setYawMixLevel(25);
m_aircraft->mrRollMixLevel->setValue(100); // Do not alter mixer matrix
m_aircraft->mrPitchMixLevel->setValue(100); // All mixers RPY levels = 100%
setYawMixLevel(100);
} else if (frameType == "OctoX" || frameType == "Octocopter X") {
setComboCurrentIndex(m_aircraft->multirotorFrameType, m_aircraft->multirotorFrameType->findText("Octocopter X"));
m_aircraft->mrRollMixLevel->setValue(100); // Do not alter mixer matrix
m_aircraft->mrPitchMixLevel->setValue(100); // All mixers RPY levels = 100%
setYawMixLevel(100);
} else if (frameType == "OctoV" || frameType == "Octocopter V") {
setComboCurrentIndex(m_aircraft->multirotorFrameType,
m_aircraft->multirotorFrameType->findText("Octocopter V"));
@ -235,10 +275,14 @@ void ConfigMultiRotorWidget::setupEnabledControls(QString frameType)
enableComboBoxes(this, CHANNELBOXNAME, 6, true);
} else if (frameType == "HexaX" || frameType == "Hexacopter X") {
enableComboBoxes(this, CHANNELBOXNAME, 6, true);
} else if (frameType == "HexaH" || frameType == "Hexacopter H") {
enableComboBoxes(this, CHANNELBOXNAME, 6, true);
} else if (frameType == "HexaCoax" || frameType == "Hexacopter Y6") {
enableComboBoxes(this, CHANNELBOXNAME, 6, true);
} else if (frameType == "Octo" || frameType == "Octocopter") {
enableComboBoxes(this, CHANNELBOXNAME, 8, true);
} else if (frameType == "OctoX" || frameType == "Octocopter X") {
enableComboBoxes(this, CHANNELBOXNAME, 8, true);
} else if (frameType == "OctoV" || frameType == "Octocopter V") {
enableComboBoxes(this, CHANNELBOXNAME, 8, true);
} else if (frameType == "OctoCoaxP" || frameType == "Octo Coax +") {
@ -270,15 +314,23 @@ void ConfigMultiRotorWidget::registerWidgets(ConfigTaskWidget &parent)
void ConfigMultiRotorWidget::resetActuators(GUIConfigDataUnion *configData)
{
configData->multi.VTOLMotorN = 0;
configData->multi.VTOLMotorNE = 0;
configData->multi.VTOLMotorE = 0;
configData->multi.VTOLMotorSE = 0;
configData->multi.VTOLMotorS = 0;
configData->multi.VTOLMotorSW = 0;
configData->multi.VTOLMotorW = 0;
configData->multi.VTOLMotorNW = 0;
configData->multi.VTOLMotorN = 0;
configData->multi.VTOLMotorNE = 0;
configData->multi.VTOLMotorE = 0;
configData->multi.VTOLMotorSE = 0;
configData->multi.VTOLMotorS = 0;
configData->multi.VTOLMotorSW = 0;
configData->multi.VTOLMotorW = 0;
configData->multi.VTOLMotorNW = 0;
configData->multi.TRIYaw = 0;
configData->multi.VTOLMotorNNE = 0;
configData->multi.VTOLMotorENE = 0;
configData->multi.VTOLMotorESE = 0;
configData->multi.VTOLMotorSSE = 0;
configData->multi.VTOLMotorSSW = 0;
configData->multi.VTOLMotorWSW = 0;
configData->multi.VTOLMotorWNW = 0;
configData->multi.VTOLMotorNNW = 0;
}
/**
@ -366,10 +418,13 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
int channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
if (channel > -1) {
// get motor 1 value for Pitch
double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
m_aircraft->mrPitchMixLevel->setValue(qRound(value / 1.27));
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
// get motor 2 value for Yaw and Roll
channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1;
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
setYawMixLevel(-qRound(value / 1.27));
// change channels
@ -392,9 +447,12 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
int channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
if (channel > -1) {
// get motor 1 value for Pitch
double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
m_aircraft->mrPitchMixLevel->setValue(qRound(value / 1.27));
// get motor 2 value for Yaw and Roll
channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1;
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
setYawMixLevel(-qRound(value / 1.27));
@ -402,6 +460,34 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL);
m_aircraft->mrRollMixLevel->setValue(-qRound(value / 1.27));
}
} else if (frameType == "HexaH") {
// Motors 1/2/3 4/5/6 are: NE / E / SE / SW / W / NW
setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNE);
setComboCurrentIndex(m_aircraft->multiMotorChannelBox2, multi.VTOLMotorE);
setComboCurrentIndex(m_aircraft->multiMotorChannelBox3, multi.VTOLMotorSE);
setComboCurrentIndex(m_aircraft->multiMotorChannelBox4, multi.VTOLMotorSW);
setComboCurrentIndex(m_aircraft->multiMotorChannelBox5, multi.VTOLMotorW);
setComboCurrentIndex(m_aircraft->multiMotorChannelBox6, multi.VTOLMotorNW);
// Now, read the 1st mixer R/P/Y levels and initialize the mix sliders.
// This assumes that all vectors are identical - if not, the user should use the
// "custom" setting.
int channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
if (channel > -1) {
// get motor 1 value for Pitch
double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
m_aircraft->mrPitchMixLevel->setValue(qRound(value / 1.27));
// get motor 2 value for Yaw and Roll
channel += 1;
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
setYawMixLevel(-qRound(value / 1.27));
channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1;
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL);
m_aircraft->mrRollMixLevel->setValue(-qRound(value / 1.27));
}
} else if (frameType == "HexaCoax") {
// Motors 1/2/3 4/5/6 are: NW/W NE/E S/SE
setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNW);
@ -449,8 +535,8 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
setYawMixLevel(-qRound(value / 1.27));
// change channels
channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1;
// Get M3 Roll value
channel = m_aircraft->multiMotorChannelBox3->currentIndex() - 1;
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL);
m_aircraft->mrRollMixLevel->setValue(-qRound(value / 1.27));
} else if (frameType == "OctoV") {
@ -477,6 +563,34 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
m_aircraft->mrRollMixLevel->setValue(-qRound(value / 1.27));
}
}
} else if (frameType == "OctoX") {
// Motors 1 to 8 are NNE / ENE / ESE / etc
setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNNE);
setComboCurrentIndex(m_aircraft->multiMotorChannelBox2, multi.VTOLMotorENE);
setComboCurrentIndex(m_aircraft->multiMotorChannelBox3, multi.VTOLMotorESE);
setComboCurrentIndex(m_aircraft->multiMotorChannelBox4, multi.VTOLMotorSSE);
setComboCurrentIndex(m_aircraft->multiMotorChannelBox5, multi.VTOLMotorSSW);
setComboCurrentIndex(m_aircraft->multiMotorChannelBox6, multi.VTOLMotorWSW);
setComboCurrentIndex(m_aircraft->multiMotorChannelBox7, multi.VTOLMotorWNW);
setComboCurrentIndex(m_aircraft->multiMotorChannelBox8, multi.VTOLMotorNNW);
// Now, read the 1st mixer R/P/Y levels and initialize the mix sliders.
// This assumes that all vectors are identical - if not, the user should use the
// "custom" setting.
int channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1;
if (channel > -1) {
double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH);
m_aircraft->mrPitchMixLevel->setValue(qRound(value / 1.27));
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
setYawMixLevel(-qRound(value / 1.27));
// Get M2 Roll value
channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1;
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL);
m_aircraft->mrRollMixLevel->setValue(-qRound(value / 1.27));
}
} else if (frameType == "OctoCoaxX") {
// Motors 1 to 8 are N / NE / E / etc
setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNW);
@ -549,6 +663,37 @@ QString ConfigMultiRotorWidget::updateConfigObjectsFromWidgets()
} else if (m_aircraft->multirotorFrameType->currentText() == "Hexacopter X") {
airframeType = "HexaX";
setupHexa(false);
} else if (m_aircraft->multirotorFrameType->currentText() == "Hexacopter H") {
airframeType = "HexaH";
// Show any config errors in GUI
if (throwConfigError(6)) {
return airframeType;
}
motorList << "VTOLMotorNE" << "VTOLMotorE" << "VTOLMotorSE" << "VTOLMotorSW" << "VTOLMotorW" << "VTOLMotorNW";
setupMotors(motorList);
// Motor 1 to 6, H layout
// ---------------------------------------------
// Motor: 1 2 3 4 5 6
// ROLL {-0.50, -1.00, -0.50, 0.50, 1.00, 0.50}
// PITCH {1.00, 0.00, -1.00, -1.00, -0.00, 1.00}
// YAW {-0.50, 1.00, -0.50, 0.50, -1.00, 0.50}
// ---------------------------------------------
// http://wiki.paparazziuav.org/wiki/RotorcraftMixing
// pitch roll yaw
double hMixer[8][3] = {
{ 1, -0.5, -0.5 },
{ 0, -1, 1 },
{ -1, -0.5, -0.5 },
{ -1, 0.5, 0.5 },
{ 0, 1, -1 },
{ 1, 0.5, 0.5 },
{ 0, 0, 0 },
{ 0, 0, 0 }
};
setupMultiRotorMixer(hMixer);
m_aircraft->mrStatusLabel->setText(tr("Configuration OK"));
} else if (m_aircraft->multirotorFrameType->currentText() == "Hexacopter Y6") {
airframeType = "HexaCoax";
@ -572,7 +717,7 @@ QString ConfigMultiRotorWidget::updateConfigObjectsFromWidgets()
{ 0, 0, 0 }
};
setupMultiRotorMixer(mixerMatrix);
m_aircraft->mrStatusLabel->setText("Configuration OK");
m_aircraft->mrStatusLabel->setText(tr("Configuration OK"));
} else if (m_aircraft->multirotorFrameType->currentText() == "Octocopter") {
airframeType = "Octo";
@ -583,20 +728,58 @@ QString ConfigMultiRotorWidget::updateConfigObjectsFromWidgets()
motorList << "VTOLMotorN" << "VTOLMotorNE" << "VTOLMotorE" << "VTOLMotorSE" << "VTOLMotorS" << "VTOLMotorSW"
<< "VTOLMotorW" << "VTOLMotorNW";
setupMotors(motorList);
// Motor 1 to 8:
// Motor 1 to 8, OctoP
// -------------------------------------------------------
// Motor: 1 2 3 4 5 6 7 8
// ROLL {0.00, -0.71, -1.00, -0.71, 0.00, 0.71, 1.00, 0.71}
// PITCH {1.00, 0.71, -0.00, -0.71,-1.00,-0.71,-0.00, 0.71}
// YAW {-1.00, 1.00, -1.00, 1.00, -1.00, 1.00,-1.00, 1.00}
// -------------------------------------------------------
// http://wiki.paparazziuav.org/wiki/RotorcraftMixing
// pitch roll yaw
double mixerMatrix[8][3] = {
{ 1, 0, -1 },
{ 1, -1, 1 },
{ 0, -1, -1 },
{ -1, -1, 1 },
{ -1, 0, -1 },
{ -1, 1, 1 },
{ 0, 1, -1 },
{ 1, 1, 1 }
{ 1, 0, -1 },
{ 0.71, -0.71, 1 },
{ 0, -1, -1 },
{ -0.71, -0.71, 1 },
{ -1, 0, -1 },
{ -0.71, 0.71, 1 },
{ 0, 1, -1 },
{ 0.71, 0.71, 1 }
};
setupMultiRotorMixer(mixerMatrix);
m_aircraft->mrStatusLabel->setText("Configuration OK");
m_aircraft->mrStatusLabel->setText(tr("Configuration OK"));
} else if (m_aircraft->multirotorFrameType->currentText() == "Octocopter X") {
airframeType = "OctoX";
// Show any config errors in GUI
if (throwConfigError(8)) {
return airframeType;
}
motorList << "VTOLMotorNNE" << "VTOLMotorENE" << "VTOLMotorESE" << "VTOLMotorSSE" << "VTOLMotorSSW" << "VTOLMotorWSW"
<< "VTOLMotorWNW" << "VTOLMotorNNW";
setupMotors(motorList);
// Motor 1 to 8, OctoX
// --------------------------------------------------------
// Motor: 1 2 3 4 5 6 7 8
// ROLL {-0.41, -1.00, -1.00, -0.41, 0.41, 1.00, 1.00, 0.41}
// PITCH {1.00, 0.41, -0.41, -1.00, -1.00, -0.41, 0.41, 1.00}
// YAW {-1.00, 1.00, -1.00, 1.00, -1.00, 1.00, -1.00, 1.00}
// --------------------------------------------------------
// http://wiki.paparazziuav.org/wiki/RotorcraftMixing
// pitch roll yaw
double mixerMatrix[8][3] = {
{ 1, -0.41, -1 },
{ 0.41, -1, 1 },
{ -0.41, -1, -1 },
{ -1, -0.41, 1 },
{ -1, 0.41, -1 },
{ -0.41, 1, 1 },
{ 0.41, 1, -1 },
{ 1, 0.41, 1 }
};
setupMultiRotorMixer(mixerMatrix);
m_aircraft->mrStatusLabel->setText(tr("Configuration OK"));
} else if (m_aircraft->multirotorFrameType->currentText() == "Octocopter V") {
airframeType = "OctoV";
@ -621,7 +804,7 @@ QString ConfigMultiRotorWidget::updateConfigObjectsFromWidgets()
{ 0.33, 1, 1 }
};
setupMultiRotorMixer(mixerMatrix);
m_aircraft->mrStatusLabel->setText("Configuration OK");
m_aircraft->mrStatusLabel->setText(tr("Configuration OK"));
} else if (m_aircraft->multirotorFrameType->currentText() == "Octo Coax +") {
airframeType = "OctoCoaxP";
@ -645,7 +828,7 @@ QString ConfigMultiRotorWidget::updateConfigObjectsFromWidgets()
{ 0, 1, 1 }
};
setupMultiRotorMixer(mixerMatrix);
m_aircraft->mrStatusLabel->setText("Configuration OK");
m_aircraft->mrStatusLabel->setText(tr("Configuration OK"));
} else if (m_aircraft->multirotorFrameType->currentText() == "Octo Coax X") {
airframeType = "OctoCoaxX";
@ -669,7 +852,7 @@ QString ConfigMultiRotorWidget::updateConfigObjectsFromWidgets()
{ -1, 1, 1 }
};
setupMultiRotorMixer(mixerMatrix);
m_aircraft->mrStatusLabel->setText("Configuration OK");
m_aircraft->mrStatusLabel->setText(tr("Configuration OK"));
} else if (m_aircraft->multirotorFrameType->currentText() == "Tricopter Y") {
airframeType = "Tri";
@ -678,7 +861,7 @@ QString ConfigMultiRotorWidget::updateConfigObjectsFromWidgets()
return airframeType;
}
if (m_aircraft->triYawChannelBox->currentText() == "None") {
m_aircraft->mrStatusLabel->setText("<font color='red'>Error: Assign a Yaw channel</font>");
m_aircraft->mrStatusLabel->setText(tr("<font color='red'>ERROR: Assign a Yaw channel</font>"));
return airframeType;
}
motorList << "VTOLMotorNW" << "VTOLMotorNE" << "VTOLMotorS";
@ -688,7 +871,7 @@ QString ConfigMultiRotorWidget::updateConfigObjectsFromWidgets()
config.multi.TRIYaw = m_aircraft->triYawChannelBox->currentIndex();
setConfigData(config);
// Motor 1 to 6, Y6 Layout:
// Motor 1 to 3, Tricopter Y Layout:
// pitch roll yaw
double mixerMatrix[8][3] = {
{ 0.5, 1, 0 },
@ -748,11 +931,15 @@ void ConfigMultiRotorWidget::updateAirframe(QString frameType)
} else if (frameType == "Hexa" || frameType == "Hexacopter") {
elementId = "quad-hexa";
} else if (frameType == "HexaX" || frameType == "Hexacopter X") {
elementId = "quad-hexa-X";
} else if (frameType == "HexaH" || frameType == "Hexacopter H") {
elementId = "quad-hexa-H";
} else if (frameType == "HexaCoax" || frameType == "Hexacopter Y6") {
elementId = "hexa-coax";
} else if (frameType == "Octo" || frameType == "Octocopter") {
elementId = "quad-octo";
} else if (frameType == "OctoX" || frameType == "Octocopter X") {
elementId = "quad-octo-X";
} else if (frameType == "OctoV" || frameType == "Octocopter V") {
elementId = "quad-octo-v";
} else if (frameType == "OctoCoaxP" || frameType == "Octo Coax +") {
@ -824,6 +1011,23 @@ void ConfigMultiRotorWidget::setupMotors(QList<QString> motorList)
configData.multi.VTOLMotorW = index;
} else if (motor == QString("VTOLMotorNW")) {
configData.multi.VTOLMotorNW = index;
// OctoX
} else if (motor == QString("VTOLMotorNNE")) {
configData.multi.VTOLMotorNNE = index;
} else if (motor == QString("VTOLMotorENE")) {
configData.multi.VTOLMotorENE = index;
} else if (motor == QString("VTOLMotorESE")) {
configData.multi.VTOLMotorESE = index;
} else if (motor == QString("VTOLMotorSSE")) {
configData.multi.VTOLMotorSSE = index;
} else if (motor == QString("VTOLMotorSSW")) {
configData.multi.VTOLMotorSSW = index;
} else if (motor == QString("VTOLMotorWSW")) {
configData.multi.VTOLMotorWSW = index;
} else if (motor == QString("VTOLMotorWNW")) {
configData.multi.VTOLMotorWNW = index;
} else if (motor == QString("VTOLMotorNNW")) {
configData.multi.VTOLMotorNNW = index;
}
}
setConfigData(configData);
@ -914,41 +1118,44 @@ bool ConfigMultiRotorWidget::setupHexa(bool pLayout)
// and set only the relevant channels:
// Motor 1 to 6, P Layout:
// Motor 1 to 6, HexaP Layout
// ---------------------------------------------
// Motor: 1 2 3 4 5 6
// ROLL {0.00, -1.00, -1.00, 0.00, 1.00, 1.00}
// PITCH {1.00, 0.50, -0.50, -1.00, -0.50, 0.50}
// YAW {-1.00, 1.00, -1.00, 1.00, -1.00, 1.00}
// ---------------------------------------------
// http://wiki.paparazziuav.org/wiki/RotorcraftMixing
// pitch roll yaw
// 1 { 0.3 , 0 ,-0.3 // N CW
// 2 { 0.3 ,-0.5 , 0.3 // NE CCW
// 3 {-0.3 ,-0.5 ,-0.3 // SE CW
// 4 {-0.3 , 0 , 0.3 // S CCW
// 5 {-0.3 , 0.5 ,-0.3 // SW CW
// 6 { 0.3 , 0.5 , 0.3 // NW CCW
double pMixer[8][3] = {
{ 1, 0, -1 },
{ 1, -1, 1 },
{ -1, -1, -1 },
{ -1, 0, 1 },
{ -1, 1, -1 },
{ 1, 1, 1 },
{ 0, 0, 0 },
{ 0, 0, 0 }
{ 1, 0, -1 },
{ 0.5, -1, 1 },
{ -0.5, -1, -1 },
{ -1, 0, 1 },
{ -0.5, 1, -1 },
{ 0.5, 1, 1 },
{ 0, 0, 0 },
{ 0, 0, 0 }
};
// Motor 1 to 6, X Layout:
// 1 [ 0.5, -0.3, -0.3 ] NE
// 2 [ 0 , -0.3, 0.3 ] E
// 3 [ -0.5, -0.3, -0.3 ] SE
// 4 [ -0.5, 0.3, 0.3 ] SW
// 5 [ 0 , 0.3, -0.3 ] W
// 6 [ 0.5, 0.3, 0.3 ] NW
// Motor 1 to 6, HexaX Layout
// ---------------------------------------------
// Motor: 1 2 3 4 5 6
// ROLL {-0.50, -1.00, -0.50, 0.50, 1.00, 0.50}
// PITCH {1.00, 0.00, -1.00, -1.00, -0.00, 1.00}
// YAW {-1.00, 1.00, -1.00, 1.00, -1.00, 1.00}
// ---------------------------------------------
// http://wiki.paparazziuav.org/wiki/RotorcraftMixing
// pitch roll yaw
double xMixer[8][3] = {
{ 1, -1, -1 },
{ 0, -1, 1 },
{ -1, -1, -1 },
{ -1, 1, 1 },
{ 0, 1, -1 },
{ 1, 1, 1 },
{ 0, 0, 0 },
{ 0, 0, 0 }
{ 1, -0.5, -1 },
{ 0, -1, 1 },
{ -1, -0.5, -1 },
{ -1, 0.5, 1 },
{ 0, 1, -1 },
{ 1, 0.5, 1 },
{ 0, 0, 0 },
{ 0, 0, 0 }
};
if (pLayout) {
@ -956,7 +1163,7 @@ bool ConfigMultiRotorWidget::setupHexa(bool pLayout)
} else {
setupMultiRotorMixer(xMixer);
}
m_aircraft->mrStatusLabel->setText("Configuration OK");
m_aircraft->mrStatusLabel->setText(tr("Configuration OK"));
return true;
}
@ -1021,7 +1228,7 @@ bool ConfigMultiRotorWidget::throwConfigError(int numMotors)
if (error) {
m_aircraft->mrStatusLabel->setText(
QString("<font color='red'>ERROR: Assign all %1 motor channels</font>").arg(numMotors));
QString(tr("<font color='red'>ERROR: Assign all %1 motor channels</font>")).arg(numMotors));
}
return error;
}

View File

@ -42,6 +42,15 @@ typedef struct {
uint VTOLMotorNE : 4;
uint VTOLMotorSW : 4;
uint VTOLMotorSE : 4; // 32 bits
// OctoX
uint VTOLMotorNNE : 4;
uint VTOLMotorENE : 4;
uint VTOLMotorESE : 4;
uint VTOLMotorSSE : 4;
uint VTOLMotorSSW : 4;
uint VTOLMotorWSW : 4;
uint VTOLMotorWNW : 4;
uint VTOLMotorNNW : 4; // 32 bits
uint TRIYaw : 4;
quint32 padding : 28; // 64 bits
quint32 padding1;

View File

@ -85,6 +85,7 @@ QStringList ConfigVehicleTypeWidget::getChannelDescriptions()
case SystemSettings::AIRFRAMETYPE_OCTOCOAXX:
case SystemSettings::AIRFRAMETYPE_OCTOCOAXP:
case SystemSettings::AIRFRAMETYPE_OCTO:
case SystemSettings::AIRFRAMETYPE_OCTOX:
case SystemSettings::AIRFRAMETYPE_HEXAX:
case SystemSettings::AIRFRAMETYPE_HEXACOAX:
case SystemSettings::AIRFRAMETYPE_HEXA:
@ -263,8 +264,11 @@ int ConfigVehicleTypeWidget::frameCategory(QString frameType)
} else if (frameType == "Tri" || frameType == "Tricopter Y" || frameType == "QuadX" || frameType == "Quad X"
|| frameType == "QuadP" || frameType == "Quad +" || frameType == "Hexa" || frameType == "Hexacopter"
|| frameType == "HexaX" || frameType == "Hexacopter X" || frameType == "HexaCoax"
|| frameType == "Hexacopter Y6" || frameType == "Octo" || frameType == "Octocopter" || frameType == "OctoV"
|| frameType == "Octocopter V" || frameType == "OctoCoaxP" || frameType == "Octo Coax +"
|| frameType == "HexaH" || frameType == "Hexacopter H" || frameType == "Hexacopter Y6"
|| frameType == "Octo" || frameType == "Octocopter"
|| frameType == "OctoX" || frameType == "Octocopter X"
|| frameType == "OctoV" || frameType == "Octocopter V"
|| frameType == "OctoCoaxP" || frameType == "Octo Coax +"
|| frameType == "OctoCoaxX" || frameType == "Octo Coax X") {
return ConfigVehicleTypeWidget::MULTIROTOR;
} else if (frameType == "HeliCP") {

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 758 KiB

After

Width:  |  Height:  |  Size: 898 KiB

View File

@ -107,6 +107,9 @@ void ConnectionDiagram::setupGraphicsScene()
case VehicleConfigurationSource::MULTI_ROTOR_HEXA:
elementsToShow << "hexa";
break;
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_X:
elementsToShow << "hexa-x";
break;
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_COAX_Y:
elementsToShow << "hexa-y";
break;

View File

@ -101,11 +101,15 @@ void MultiPage::setupMultiTypesCombo()
ui->typeCombo->addItem(tr("Hexacopter"), SetupWizard::MULTI_ROTOR_HEXA);
m_descriptions << tr("Hexacopter");
ui->typeCombo->addItem(tr("Hexacopter X"), SetupWizard::MULTI_ROTOR_HEXA_X);
m_descriptions << tr("Hexacopter X");
ui->typeCombo->addItem(tr("Hexacopter H"), SetupWizard::MULTI_ROTOR_HEXA_H);
m_descriptions << tr("Hexacopter H");
ui->typeCombo->addItem(tr("Hexacopter Coax (Y6)"), SetupWizard::MULTI_ROTOR_HEXA_COAX_Y);
m_descriptions << tr("Hexacopter Coax (Y6)");
ui->typeCombo->addItem(tr("Hexacopter X"), SetupWizard::MULTI_ROTOR_HEXA_H);
m_descriptions << tr("Hexacopter H");
// Fredrik Arvidsson(m_thread) 2012-08-26 Disable Octos until further notice
/*
@ -159,6 +163,9 @@ void MultiPage::updateImageAndDescription()
case SetupWizard::MULTI_ROTOR_HEXA_H:
elementId = "quad-hexa-H";
break;
case SetupWizard::MULTI_ROTOR_HEXA_X:
elementId = "quad-hexa-X";
break;
case SetupWizard::MULTI_ROTOR_OCTO:
elementId = "quad-octo";
break;

View File

@ -104,6 +104,12 @@ void OutputCalibrationPage::setupVehicle()
m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 3 << 4 << 5 << 6;
m_channelIndex << 0 << 0 << 1 << 2 << 3 << 4 << 5;
break;
case SetupWizard::MULTI_ROTOR_HEXA_X:
m_wizardIndexes << 0 << 1 << 1 << 1 << 1 << 1 << 1;
m_vehicleElementIds << "hexa-x" << "hexa-x-frame" << "hexa-x-m1" << "hexa-x-m2" << "hexa-x-m3" << "hexa-x-m4" << "hexa-x-m5" << "hexa-x-m6";
m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 3 << 4 << 5 << 6;
m_channelIndex << 0 << 0 << 1 << 2 << 3 << 4 << 5;
break;
default:
break;
}

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 483 KiB

After

Width:  |  Height:  |  Size: 524 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 431 KiB

After

Width:  |  Height:  |  Size: 432 KiB

View File

@ -204,6 +204,9 @@ QString SetupWizard::getSummaryText()
summary.append(tr("Hexacopter Coax (Y6)"));
break;
case SetupWizard::MULTI_ROTOR_HEXA_H:
summary.append(tr("Hexacopter H"));
break;
case SetupWizard::MULTI_ROTOR_HEXA_X:
summary.append(tr("Hexacopter X"));
break;
case SetupWizard::MULTI_ROTOR_OCTO:

View File

@ -202,9 +202,11 @@ void VehicleConfigurationHelper::applyVehicleConfiguration()
case VehicleConfigurationSource::MULTI_ROTOR_HEXA:
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_COAX_Y:
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_H:
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_X:
setupHexaCopter();
break;
case VehicleConfigurationSource::MULTI_ROTOR_OCTO:
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_X:
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_X:
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_PLUS:
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_V:
@ -279,7 +281,9 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
case VehicleConfigurationSource::MULTI_ROTOR_HEXA:
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_COAX_Y:
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_H:
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_X:
case VehicleConfigurationSource::MULTI_ROTOR_OCTO:
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_X:
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_X:
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_PLUS:
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_V:
@ -633,8 +637,9 @@ void VehicleConfigurationHelper::resetVehicleConfig()
for (int i = 1; i <= 2; i++) {
UAVObjectField *field = mSettings->getField(throttlePattern.arg(i));
Q_ASSERT(field);
// Wizard support only Multirotors - Set default curve with 90% max
for (quint32 i = 0; i < field->getNumElements(); i++) {
field->setValue(i * (1.0f / (field->getNumElements() - 1)), i);
field->setValue(i * (0.9f / (field->getNumElements() - 1)), i);
}
}
@ -831,48 +836,55 @@ void VehicleConfigurationHelper::setupHexaCopter()
case VehicleConfigurationSource::MULTI_ROTOR_HEXA:
{
frame = SystemSettings::AIRFRAMETYPE_HEXA;
// HexaPlus according to new mixer table and pitch-roll-yaw mixing at 100%
// Pitch Roll Yaw
// M1 { 1 , 0 , -1 },
// M2 { 0.5, -1, 1 },
// M3 { -0.5, -1, -1 },
// M4 { -1 , 0 , 1 },
// M5 { -0.5, 1 , -1 },
// M6 { 0.5, 1 , 1 },
channels[0].type = MIXER_TYPE_MOTOR;
channels[0].throttle1 = 100;
channels[0].throttle2 = 0;
channels[0].roll = 0;
channels[0].pitch = 33;
channels[0].yaw = -33;
channels[0].pitch = 100;
channels[0].yaw = -100;
channels[1].type = MIXER_TYPE_MOTOR;
channels[1].throttle1 = 100;
channels[1].throttle2 = 0;
channels[1].roll = -50;
channels[1].pitch = 33;
channels[1].yaw = 33;
channels[1].roll = -100;
channels[1].pitch = 50;
channels[1].yaw = 100;
channels[2].type = MIXER_TYPE_MOTOR;
channels[2].throttle1 = 100;
channels[2].throttle2 = 0;
channels[2].roll = -50;
channels[2].pitch = -33;
channels[2].yaw = -33;
channels[2].roll = -100;
channels[2].pitch = -50;
channels[2].yaw = -100;
channels[3].type = MIXER_TYPE_MOTOR;
channels[3].throttle1 = 100;
channels[3].throttle2 = 0;
channels[3].roll = 0;
channels[3].pitch = -33;
channels[3].yaw = 33;
channels[3].pitch = -100;
channels[3].yaw = 100;
channels[4].type = MIXER_TYPE_MOTOR;
channels[4].throttle1 = 100;
channels[4].throttle2 = 0;
channels[4].roll = 50;
channels[4].pitch = -33;
channels[4].yaw = -33;
channels[4].roll = 100;
channels[4].pitch = -50;
channels[4].yaw = -100;
channels[5].type = MIXER_TYPE_MOTOR;
channels[5].throttle1 = 100;
channels[5].throttle2 = 0;
channels[5].roll = 50;
channels[5].pitch = 33;
channels[5].yaw = 33;
channels[5].roll = 100;
channels[5].pitch = 50;
channels[5].yaw = 100;
guiSettings.multi.VTOLMotorN = 1;
guiSettings.multi.VTOLMotorNE = 2;
@ -940,49 +952,118 @@ void VehicleConfigurationHelper::setupHexaCopter()
}
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_H:
{
frame = SystemSettings::AIRFRAMETYPE_HEXAX;
frame = SystemSettings::AIRFRAMETYPE_HEXAH;
// HexaH according to new mixer table and pitch-roll-yaw mixing at 100%
// Pitch Roll Yaw
// M1 { 1 , -0.5, -0.5 },
// M2 { 0 , -1 , 1 },
// M3 { -1 , -0.5, -0.5 },
// M4 { -1 , 0.5, 0.5 },
// M5 { 0 , 1 , -1 },
// M6 { 1 , 0.5, 0.5 },
channels[0].type = MIXER_TYPE_MOTOR;
channels[0].throttle1 = 100;
channels[0].throttle2 = 0;
channels[0].roll = -33;
channels[0].pitch = 50;
channels[0].yaw = -33;
channels[0].roll = -50;
channels[0].pitch = 100;
channels[0].yaw = -50;
channels[1].type = MIXER_TYPE_MOTOR;
channels[1].throttle1 = 100;
channels[1].throttle2 = 0;
channels[1].roll = -33;
channels[1].roll = -100;
channels[1].pitch = 0;
channels[1].yaw = 33;
channels[1].yaw = 100;
channels[2].type = MIXER_TYPE_MOTOR;
channels[2].throttle1 = 100;
channels[2].throttle2 = 0;
channels[2].roll = -33;
channels[2].pitch = -50;
channels[2].yaw = -33;
channels[2].roll = -50;
channels[2].pitch = -100;
channels[2].yaw = -50;
channels[3].type = MIXER_TYPE_MOTOR;
channels[3].throttle1 = 100;
channels[3].throttle2 = 0;
channels[3].roll = -33;
channels[3].pitch = -50;
channels[3].yaw = 33;
channels[3].roll = 50;
channels[3].pitch = -100;
channels[3].yaw = 50;
channels[4].type = MIXER_TYPE_MOTOR;
channels[4].throttle1 = 100;
channels[4].throttle2 = 0;
channels[4].roll = 33;
channels[4].roll = 100;
channels[4].pitch = 0;
channels[4].yaw = -33;
channels[4].yaw = -100;
channels[5].type = MIXER_TYPE_MOTOR;
channels[5].throttle1 = 100;
channels[5].throttle2 = 0;
channels[5].roll = 33;
channels[5].pitch = 50;
channels[5].yaw = -33;
channels[5].roll = 50;
channels[5].pitch = 100;
channels[5].yaw = 50;
guiSettings.multi.VTOLMotorNE = 1;
guiSettings.multi.VTOLMotorE = 2;
guiSettings.multi.VTOLMotorSE = 3;
guiSettings.multi.VTOLMotorSW = 4;
guiSettings.multi.VTOLMotorW = 5;
guiSettings.multi.VTOLMotorNW = 6;
break;
}
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_X:
{
frame = SystemSettings::AIRFRAMETYPE_HEXAH;
// HexaX according to new mixer table and pitch-roll-yaw mixing at 100%
// Pitch Roll Yaw
// M1 { 1, -0.5, -1 },
// M2 { 0, -1 , 1 },
// M3 { -1, -0.5, -1 },
// M4 { -1, 0.5, 1 },
// M5 { 0, 1 , -1 },
// M6 { 1, 0.5, 1 },
channels[0].type = MIXER_TYPE_MOTOR;
channels[0].throttle1 = 100;
channels[0].throttle2 = 0;
channels[0].roll = -50;
channels[0].pitch = 100;
channels[0].yaw = -100;
channels[1].type = MIXER_TYPE_MOTOR;
channels[1].throttle1 = 100;
channels[1].throttle2 = 0;
channels[1].roll = -100;
channels[1].pitch = 0;
channels[1].yaw = 100;
channels[2].type = MIXER_TYPE_MOTOR;
channels[2].throttle1 = 100;
channels[2].throttle2 = 0;
channels[2].roll = -50;
channels[2].pitch = -100;
channels[2].yaw = -100;
channels[3].type = MIXER_TYPE_MOTOR;
channels[3].throttle1 = 100;
channels[3].throttle2 = 0;
channels[3].roll = 50;
channels[3].pitch = -100;
channels[3].yaw = 100;
channels[4].type = MIXER_TYPE_MOTOR;
channels[4].throttle1 = 100;
channels[4].throttle2 = 0;
channels[4].roll = 100;
channels[4].pitch = 0;
channels[4].yaw = -100;
channels[5].type = MIXER_TYPE_MOTOR;
channels[5].throttle1 = 100;
channels[5].throttle2 = 0;
channels[5].roll = 50;
channels[5].pitch = 100;
channels[5].yaw = 100;
guiSettings.multi.VTOLMotorNE = 1;
guiSettings.multi.VTOLMotorE = 2;
@ -1010,62 +1091,71 @@ void VehicleConfigurationHelper::setupOctoCopter()
case VehicleConfigurationSource::MULTI_ROTOR_OCTO:
{
frame = SystemSettings::AIRFRAMETYPE_OCTO;
// OctoP according to new mixer table and pitch-roll-yaw mixing at 100%
// Pitch Roll Yaw
// M1{ 1 , 0 , -1 },
// M2{ 0.71,-0.71, 1 },
// M3{ 0 ,-1 , -1 },
// M4{ -0.71,-0.71, 1 },
// M5{ -1 , 0 , -1 },
// M6{ -0.71, 0.71, 1 },
// M7{ 0 , 1 , -1 },
// M8{ 0.71, 0.71, 1 }
channels[0].type = MIXER_TYPE_MOTOR;
channels[0].throttle1 = 100;
channels[0].throttle2 = 0;
channels[0].roll = 0;
channels[0].pitch = 33;
channels[0].yaw = -25;
channels[0].pitch = 100;
channels[0].yaw = -100;
channels[1].type = MIXER_TYPE_MOTOR;
channels[1].throttle1 = 100;
channels[1].throttle2 = 0;
channels[1].roll = -33;
channels[1].pitch = 33;
channels[1].yaw = 25;
channels[1].roll = -71;
channels[1].pitch = 71;
channels[1].yaw = 100;
channels[2].type = MIXER_TYPE_MOTOR;
channels[2].throttle1 = 100;
channels[2].throttle2 = 0;
channels[2].roll = -33;
channels[2].roll = -71;
channels[2].pitch = 0;
channels[2].yaw = -25;
channels[2].yaw = -100;
channels[3].type = MIXER_TYPE_MOTOR;
channels[3].throttle1 = 100;
channels[3].throttle2 = 0;
channels[3].roll = -33;
channels[3].pitch = -33;
channels[3].yaw = 25;
channels[3].roll = -71;
channels[3].pitch = -71;
channels[3].yaw = 100;
channels[4].type = MIXER_TYPE_MOTOR;
channels[4].throttle1 = 100;
channels[4].throttle2 = 0;
channels[4].roll = 0;
channels[4].pitch = -33;
channels[4].yaw = -25;
channels[4].pitch = -100;
channels[4].yaw = -100;
channels[5].type = MIXER_TYPE_MOTOR;
channels[5].throttle1 = 100;
channels[5].throttle2 = 0;
channels[5].roll = 33;
channels[5].pitch = -33;
channels[5].yaw = 25;
channels[5].roll = 71;
channels[5].pitch = -71;
channels[5].yaw = 100;
channels[6].type = MIXER_TYPE_MOTOR;
channels[6].throttle1 = 100;
channels[6].throttle2 = 0;
channels[6].roll = 33;
channels[6].roll = 100;
channels[6].pitch = 0;
channels[6].yaw = -25;
channels[6].yaw = -100;
channels[7].type = MIXER_TYPE_MOTOR;
channels[7].throttle1 = 100;
channels[7].throttle2 = 0;
channels[7].roll = 33;
channels[7].pitch = 33;
channels[7].yaw = 25;
channels[7].roll = 71;
channels[7].pitch = 71;
channels[7].yaw = 100;
guiSettings.multi.VTOLMotorN = 1;
guiSettings.multi.VTOLMotorNE = 2;
@ -1078,6 +1168,86 @@ void VehicleConfigurationHelper::setupOctoCopter()
break;
}
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_X:
{
frame = SystemSettings::AIRFRAMETYPE_OCTOX;
// OctoX according to new mixer table and pitch-roll-yaw mixing at 100%
// Pitch Roll Yaw
// M1{ 1 ,-0.41, -1 },
// M2{ 0.41, -1 , 1 },
// M3{ -0.41, -1 , -1 },
// M4{ -1 ,-0.41, 1 },
// M5{ -1 , 0.41, -1 },
// M6{ -0.41, 1 , 1 },
// M7{ 0.41, 1 , -1 },
// M8{ 1 , 0.41, 1 }
channels[0].type = MIXER_TYPE_MOTOR;
channels[0].throttle1 = 100;
channels[0].throttle2 = 0;
channels[0].roll = -41;
channels[0].pitch = 100;
channels[0].yaw = -100;
channels[1].type = MIXER_TYPE_MOTOR;
channels[1].throttle1 = 100;
channels[1].throttle2 = 0;
channels[1].roll = -100;
channels[1].pitch = 41;
channels[1].yaw = 100;
channels[2].type = MIXER_TYPE_MOTOR;
channels[2].throttle1 = 100;
channels[2].throttle2 = 0;
channels[2].roll = -100;
channels[2].pitch = -41;
channels[2].yaw = -100;
channels[3].type = MIXER_TYPE_MOTOR;
channels[3].throttle1 = 100;
channels[3].throttle2 = 0;
channels[3].roll = -41;
channels[3].pitch = -100;
channels[3].yaw = 100;
channels[4].type = MIXER_TYPE_MOTOR;
channels[4].throttle1 = 100;
channels[4].throttle2 = 0;
channels[4].roll = 41;
channels[4].pitch = -100;
channels[4].yaw = -100;
channels[5].type = MIXER_TYPE_MOTOR;
channels[5].throttle1 = 100;
channels[5].throttle2 = 0;
channels[5].roll = 100;
channels[5].pitch = -41;
channels[5].yaw = 100;
channels[6].type = MIXER_TYPE_MOTOR;
channels[6].throttle1 = 100;
channels[6].throttle2 = 0;
channels[6].roll = 100;
channels[6].pitch = 41;
channels[6].yaw = -100;
channels[7].type = MIXER_TYPE_MOTOR;
channels[7].throttle1 = 100;
channels[7].throttle2 = 0;
channels[7].roll = 41;
channels[7].pitch = 100;
channels[7].yaw = 100;
guiSettings.multi.VTOLMotorNNE = 1;
guiSettings.multi.VTOLMotorENE = 2;
guiSettings.multi.VTOLMotorESE = 3;
guiSettings.multi.VTOLMotorSSE = 4;
guiSettings.multi.VTOLMotorSSW = 5;
guiSettings.multi.VTOLMotorWSW = 6;
guiSettings.multi.VTOLMotorWNW = 7;
guiSettings.multi.VTOLMotorNNW = 8;
break;
}
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_X:
{
frame = SystemSettings::AIRFRAMETYPE_OCTOCOAXX;

View File

@ -58,9 +58,9 @@ public:
enum CONTROLLER_TYPE { CONTROLLER_UNKNOWN, CONTROLLER_CC, CONTROLLER_CC3D, CONTROLLER_REVO, CONTROLLER_OPLINK };
enum VEHICLE_TYPE { VEHICLE_UNKNOWN, VEHICLE_MULTI, VEHICLE_FIXEDWING, VEHICLE_HELI, VEHICLE_SURFACE };
enum VEHICLE_SUB_TYPE { MULTI_ROTOR_UNKNOWN, MULTI_ROTOR_TRI_Y, MULTI_ROTOR_QUAD_X, MULTI_ROTOR_QUAD_PLUS,
MULTI_ROTOR_HEXA, MULTI_ROTOR_HEXA_H, MULTI_ROTOR_HEXA_COAX_Y, MULTI_ROTOR_OCTO,
MULTI_ROTOR_OCTO_V, MULTI_ROTOR_OCTO_COAX_X, MULTI_ROTOR_OCTO_COAX_PLUS, FIXED_WING_AILERON,
FIXED_WING_VTAIL, HELI_CCPM };
MULTI_ROTOR_HEXA, MULTI_ROTOR_HEXA_H, MULTI_ROTOR_HEXA_X, MULTI_ROTOR_HEXA_COAX_Y, MULTI_ROTOR_OCTO,
MULTI_ROTOR_OCTO_X, MULTI_ROTOR_OCTO_V, MULTI_ROTOR_OCTO_COAX_X, MULTI_ROTOR_OCTO_COAX_PLUS,
FIXED_WING_AILERON, FIXED_WING_VTAIL, HELI_CCPM };
enum ESC_TYPE { ESC_RAPID, ESC_LEGACY, ESC_UNKNOWN };
enum INPUT_TYPE { INPUT_PWM, INPUT_PPM, INPUT_SBUS, INPUT_DSMX10, INPUT_DSMX11, INPUT_DSM2, INPUT_UNKNOWN };

View File

@ -1,7 +1,7 @@
<xml>
<object name="SystemSettings" singleinstance="true" settings="true" category="System">
<description>Select airframe type. Currently used by @ref ActuatorModule to choose mixing from @ref ActuatorDesired to @ref ActuatorCommand</description>
<field name="AirframeType" units="" type="enum" elements="1" options="FixedWing,FixedWingElevon,FixedWingVtail,VTOL,HeliCP,QuadX,QuadP,Hexa,Octo,Custom,HexaX,OctoV,OctoCoaxP,OctoCoaxX,HexaCoax,Tri,GroundVehicleCar,GroundVehicleDifferential,GroundVehicleMotorcycle" defaultvalue="QuadX"/>
<field name="AirframeType" units="" type="enum" elements="1" options="FixedWing,FixedWingElevon,FixedWingVtail,VTOL,HeliCP,QuadX,QuadP,Hexa,Octo,Custom,HexaX,HexaH,OctoV,OctoCoaxP,OctoCoaxX,OctoX,HexaCoax,Tri,GroundVehicleCar,GroundVehicleDifferential,GroundVehicleMotorcycle" defaultvalue="QuadX"/>
<field name="ThrustControl" units="" type="enum" elements="1" options="Throttle,Collective,None" defaultvalue="Throttle" />
<!-- Which way the vehicle controls its thrust. Can be through
"Throttle" (quadcopter, simple brushless planes,