mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-18 08:54:15 +01:00
Merge remote-tracking branch 'origin/laurent/OP-1491_HQuad_mixing_values' into laurent/OP-1222_FW_Wizard
Conflicts: ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.cpp ground/openpilotgcs/src/plugins/setupwizard/resources/connection-diagrams.svg Conflicts resolved in artwork, same style as FW branch
This commit is contained in:
commit
bc9e6b24f9
@ -262,6 +262,7 @@ FrameType_t GetCurrentFrameType()
|
||||
switch ((SystemSettingsAirframeTypeOptions)airframe_type) {
|
||||
case SYSTEMSETTINGS_AIRFRAMETYPE_QUADX:
|
||||
case SYSTEMSETTINGS_AIRFRAMETYPE_QUADP:
|
||||
case SYSTEMSETTINGS_AIRFRAMETYPE_QUADH:
|
||||
case SYSTEMSETTINGS_AIRFRAMETYPE_HEXA:
|
||||
case SYSTEMSETTINGS_AIRFRAMETYPE_OCTO:
|
||||
case SYSTEMSETTINGS_AIRFRAMETYPE_OCTOX:
|
||||
|
@ -137,8 +137,8 @@ ConfigMultiRotorWidget::ConfigMultiRotorWidget(QWidget *parent) :
|
||||
m_aircraft->quadShape->setScene(scene);
|
||||
|
||||
QStringList multiRotorTypes;
|
||||
multiRotorTypes << "Tricopter Y" << "Quad +" << "Quad X" << "Hexacopter" << "Hexacopter X" << "Hexacopter H" << "Hexacopter Y6"
|
||||
<< "Octocopter" << "Octocopter X" << "Octocopter V" << "Octo Coax +" << "Octo Coax X";
|
||||
multiRotorTypes << "Tricopter Y" << "Quad +" << "Quad X" << "Quad H" << "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"
|
||||
@ -176,6 +176,12 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
m_aircraft->mrRollMixLevel->setValue(50);
|
||||
m_aircraft->mrPitchMixLevel->setValue(50);
|
||||
setYawMixLevel(50);
|
||||
} else if (frameType == "QuadH" || frameType == "Quad H") {
|
||||
setComboCurrentIndex(m_aircraft->multirotorFrameType, m_aircraft->multirotorFrameType->findText("Quad H"));
|
||||
|
||||
m_aircraft->mrRollMixLevel->setValue(50);
|
||||
m_aircraft->mrPitchMixLevel->setValue(70);
|
||||
setYawMixLevel(50);
|
||||
} else if (frameType == "QuadP" || frameType == "Quad +") {
|
||||
setComboCurrentIndex(m_aircraft->multirotorFrameType, m_aircraft->multirotorFrameType->findText("Quad +"));
|
||||
|
||||
@ -271,6 +277,8 @@ void ConfigMultiRotorWidget::setupEnabledControls(QString frameType)
|
||||
enableComboBoxes(this, CHANNELBOXNAME, 4, true);
|
||||
} else if (frameType == "QuadP" || frameType == "Quad +") {
|
||||
enableComboBoxes(this, CHANNELBOXNAME, 4, true);
|
||||
} else if (frameType == "QuadH" || frameType == "Quad H") {
|
||||
enableComboBoxes(this, CHANNELBOXNAME, 4, true);
|
||||
} else if (frameType == "Hexa" || frameType == "Hexacopter") {
|
||||
enableComboBoxes(this, CHANNELBOXNAME, 6, true);
|
||||
} else if (frameType == "HexaX" || frameType == "Hexacopter X") {
|
||||
@ -372,6 +380,12 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox2, multi.VTOLMotorNE);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox3, multi.VTOLMotorSE);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox4, multi.VTOLMotorSW);
|
||||
} else if (frameType == "QuadH") {
|
||||
// Motors 1/2/3/4 are: NW / NE / SE / SW
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNW);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox2, multi.VTOLMotorNE);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox3, multi.VTOLMotorSE);
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox4, multi.VTOLMotorSW);
|
||||
} else if (frameType == "Hexa") {
|
||||
// Motors 1/2/3 4/5/6 are: N / NE / SE / S / SW / NW
|
||||
setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorN);
|
||||
@ -490,6 +504,9 @@ QString ConfigMultiRotorWidget::updateConfigObjectsFromWidgets()
|
||||
} else if (m_aircraft->multirotorFrameType->currentText() == "Quad X") {
|
||||
airframeType = "QuadX";
|
||||
setupQuad(false);
|
||||
} else if (m_aircraft->multirotorFrameType->currentText() == "Quad H") {
|
||||
airframeType = "QuadH";
|
||||
setupQuad(false);
|
||||
} else if (m_aircraft->multirotorFrameType->currentText() == "Hexacopter") {
|
||||
airframeType = "Hexa";
|
||||
setupHexa(true);
|
||||
@ -763,6 +780,8 @@ void ConfigMultiRotorWidget::updateAirframe(QString frameType)
|
||||
elementId = "quad-x";
|
||||
} else if (frameType == "QuadP" || frameType == "Quad +") {
|
||||
elementId = "quad-plus";
|
||||
} else if (frameType == "QuadH" || frameType == "Quad H") {
|
||||
elementId = "quad-h";
|
||||
} else if (frameType == "Hexa" || frameType == "Hexacopter") {
|
||||
elementId = "quad-hexa";
|
||||
} else if (frameType == "HexaX" || frameType == "Hexacopter X") {
|
||||
@ -894,7 +913,7 @@ bool ConfigMultiRotorWidget::setupQuad(bool pLayout)
|
||||
setupMotors(motorList);
|
||||
|
||||
// Now, setup the mixer:
|
||||
// Motor 1 to 4, X Layout:
|
||||
// Motor 1 to 4, X Layout and Hlayout
|
||||
// pitch roll yaw
|
||||
// {0.5 ,0.5 ,-0.5 //Front left motor (CW)
|
||||
// {0.5 ,-0.5 ,0.5 //Front right motor(CCW)
|
||||
|
@ -84,6 +84,7 @@ QStringList ConfigVehicleTypeWidget::getChannelDescriptions()
|
||||
case SystemSettings::AIRFRAMETYPE_TRI:
|
||||
case SystemSettings::AIRFRAMETYPE_QUADX:
|
||||
case SystemSettings::AIRFRAMETYPE_QUADP:
|
||||
case SystemSettings::AIRFRAMETYPE_QUADH:
|
||||
case SystemSettings::AIRFRAMETYPE_OCTOV:
|
||||
case SystemSettings::AIRFRAMETYPE_OCTOCOAXX:
|
||||
case SystemSettings::AIRFRAMETYPE_OCTOCOAXP:
|
||||
@ -264,7 +265,8 @@ int ConfigVehicleTypeWidget::frameCategory(QString frameType)
|
||||
|| frameType == "Elevon" || frameType == "FixedWingVtail" || frameType == "Vtail") {
|
||||
return ConfigVehicleTypeWidget::FIXED_WING;
|
||||
} else if (frameType == "Tri" || frameType == "Tricopter Y" || frameType == "QuadX" || frameType == "Quad X"
|
||||
|| frameType == "QuadP" || frameType == "Quad +" || frameType == "Hexa" || frameType == "Hexacopter"
|
||||
|| frameType == "QuadP" || frameType == "Quad +" || frameType == "Quad H" || frameType == "QuadH"
|
||||
|| frameType == "Hexa" || frameType == "Hexacopter"
|
||||
|| frameType == "HexaX" || frameType == "Hexacopter X" || frameType == "HexaCoax"
|
||||
|| frameType == "HexaH" || frameType == "Hexacopter H" || frameType == "Hexacopter Y6"
|
||||
|| frameType == "Octo" || frameType == "Octocopter"
|
||||
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 898 KiB After Width: | Height: | Size: 1.1 MiB |
@ -107,6 +107,9 @@ void ConnectionDiagram::setupGraphicsScene()
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS:
|
||||
elementsToShow << "quad-p";
|
||||
break;
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_H:
|
||||
elementsToShow << "quad-h";
|
||||
break;
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_HEXA:
|
||||
elementsToShow << "hexa";
|
||||
break;
|
||||
|
@ -76,6 +76,11 @@ void MultiPage::setupSelection(Selection *selection)
|
||||
"quad-plus",
|
||||
SetupWizard::MULTI_ROTOR_QUAD_PLUS);
|
||||
|
||||
selection->addItem(tr("Quadcopter H"),
|
||||
tr("Quadcopter H, Blackout miniH"),
|
||||
"quad-h",
|
||||
SetupWizard::MULTI_ROTOR_QUAD_H);
|
||||
|
||||
selection->addItem(tr("Hexacopter"),
|
||||
tr("A multirotor with six motors, one motor in front."),
|
||||
"quad-hexa",
|
||||
|
@ -131,6 +131,12 @@ void OutputCalibrationPage::setupVehicle()
|
||||
m_channelIndex << 0 << 0 << 1 << 2 << 3;
|
||||
setupActuatorMinMaxAndNeutral(0, 3, 4);
|
||||
break;
|
||||
case SetupWizard::MULTI_ROTOR_QUAD_H:
|
||||
m_wizardIndexes << 0 << 1 << 1 << 1 << 1;
|
||||
m_vehicleElementIds << "quad-h" << "quad-h-frame" << "quad-h-m1" << "quad-h-m2" << "quad-h-m3" << "quad-h-m4";
|
||||
m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 3 << 4;
|
||||
m_channelIndex << 0 << 0 << 1 << 2 << 3;
|
||||
break;
|
||||
case SetupWizard::MULTI_ROTOR_QUAD_PLUS:
|
||||
loadSVGFile(MULTI_SVG_FILE);
|
||||
m_wizardIndexes << 0 << 1 << 1 << 1 << 1;
|
||||
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 2.2 MiB |
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 432 KiB After Width: | Height: | Size: 591 KiB |
@ -253,6 +253,9 @@ QString SetupWizard::getSummaryText()
|
||||
case SetupWizard::MULTI_ROTOR_QUAD_PLUS:
|
||||
summary.append(tr("Quadcopter +"));
|
||||
break;
|
||||
case SetupWizard::MULTI_ROTOR_QUAD_H:
|
||||
summary.append(tr("Quadcopter H"));
|
||||
break;
|
||||
case SetupWizard::MULTI_ROTOR_HEXA:
|
||||
summary.append(tr("Hexacopter"));
|
||||
break;
|
||||
|
@ -282,6 +282,7 @@ void VehicleConfigurationHelper::applyVehicleConfiguration()
|
||||
break;
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X:
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS:
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_H:
|
||||
setupQuadCopter();
|
||||
break;
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_HEXA:
|
||||
@ -396,6 +397,7 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
||||
}
|
||||
break;
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X:
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_H:
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS:
|
||||
data.ChannelUpdateFreq[0] = escFrequence;
|
||||
data.ChannelUpdateFreq[1] = escFrequence;
|
||||
@ -647,6 +649,11 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch
|
||||
mixSettings->setMixerValuePitch(100);
|
||||
mixSettings->setMixerValueYaw(50);
|
||||
break;
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_H:
|
||||
mixSettings->setMixerValueRoll(50);
|
||||
mixSettings->setMixerValuePitch(70);
|
||||
mixSettings->setMixerValueYaw(50);
|
||||
break;
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_HEXA_COAX_Y:
|
||||
mixSettings->setMixerValueRoll(100);
|
||||
mixSettings->setMixerValuePitch(50);
|
||||
@ -1050,6 +1057,44 @@ void VehicleConfigurationHelper::setupQuadCopter()
|
||||
|
||||
break;
|
||||
}
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_H:
|
||||
{
|
||||
frame = SystemSettings::AIRFRAMETYPE_QUADH;
|
||||
channels[0].type = MIXER_TYPE_MOTOR;
|
||||
channels[0].throttle1 = 100;
|
||||
channels[0].throttle2 = 0;
|
||||
channels[0].roll = 50;
|
||||
channels[0].pitch = 70;
|
||||
channels[0].yaw = -50;
|
||||
|
||||
channels[1].type = MIXER_TYPE_MOTOR;
|
||||
channels[1].throttle1 = 100;
|
||||
channels[1].throttle2 = 0;
|
||||
channels[1].roll = -50;
|
||||
channels[1].pitch = 70;
|
||||
channels[1].yaw = 50;
|
||||
|
||||
channels[2].type = MIXER_TYPE_MOTOR;
|
||||
channels[2].throttle1 = 100;
|
||||
channels[2].throttle2 = 0;
|
||||
channels[2].roll = -50;
|
||||
channels[2].pitch = -70;
|
||||
channels[2].yaw = -50;
|
||||
|
||||
channels[3].type = MIXER_TYPE_MOTOR;
|
||||
channels[3].throttle1 = 100;
|
||||
channels[3].throttle2 = 0;
|
||||
channels[3].roll = 50;
|
||||
channels[3].pitch = -70;
|
||||
channels[3].yaw = 50;
|
||||
|
||||
guiSettings.multi.VTOLMotorNW = 1;
|
||||
guiSettings.multi.VTOLMotorNE = 2;
|
||||
guiSettings.multi.VTOLMotorSE = 3;
|
||||
guiSettings.multi.VTOLMotorSW = 4;
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
|
||||
enum CONTROLLER_TYPE { CONTROLLER_UNKNOWN, CONTROLLER_CC, CONTROLLER_CC3D, CONTROLLER_REVO, CONTROLLER_NANO, 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,
|
||||
enum VEHICLE_SUB_TYPE { MULTI_ROTOR_UNKNOWN, MULTI_ROTOR_TRI_Y, MULTI_ROTOR_QUAD_X, MULTI_ROTOR_QUAD_PLUS, MULTI_ROTOR_QUAD_H,
|
||||
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_DUAL_AILERON, FIXED_WING_AILERON, FIXED_WING_ELEVON, HELI_CCPM };
|
||||
|
@ -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,HexaH,OctoV,OctoCoaxP,OctoCoaxX,OctoX,HexaCoax,Tri,GroundVehicleCar,GroundVehicleDifferential,GroundVehicleMotorcycle" defaultvalue="QuadX"/>
|
||||
<field name="AirframeType" units="" type="enum" elements="1" options="FixedWing,FixedWingElevon,FixedWingVtail,VTOL,HeliCP,QuadX,QuadP,QuadH,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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user