diff --git a/flight/libraries/sanitycheck.c b/flight/libraries/sanitycheck.c index 83e498447..c2a2ea0cf 100644 --- a/flight/libraries/sanitycheck.c +++ b/flight/libraries/sanitycheck.c @@ -266,6 +266,7 @@ FrameType_t GetCurrentFrameType() case SYSTEMSETTINGS_AIRFRAMETYPE_HEXA: case SYSTEMSETTINGS_AIRFRAMETYPE_OCTO: case SYSTEMSETTINGS_AIRFRAMETYPE_HEXAX: + case SYSTEMSETTINGS_AIRFRAMETYPE_HEXAH: case SYSTEMSETTINGS_AIRFRAMETYPE_OCTOV: case SYSTEMSETTINGS_AIRFRAMETYPE_OCTOCOAXP: case SYSTEMSETTINGS_AIRFRAMETYPE_HEXACOAX: diff --git a/flight/modules/VtolPathFollower/vtolpathfollower.c b/flight/modules/VtolPathFollower/vtolpathfollower.c index cc09e0b6b..a86f0fec2 100644 --- a/flight/modules/VtolPathFollower/vtolpathfollower.c +++ b/flight/modules/VtolPathFollower/vtolpathfollower.c @@ -190,7 +190,7 @@ 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)) { AlarmsSet(SYSTEMALARMS_ALARM_GUIDANCE, SYSTEMALARMS_ALARM_WARNING); vTaskDelay(1000); continue; diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp index 2d28ebf49..afceba3a2 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp @@ -110,7 +110,7 @@ ConfigMultiRotorWidget::ConfigMultiRotorWidget(QWidget *parent) : m_aircraft->quadShape->setScene(scene); QStringList multiRotorTypes; - multiRotorTypes << "Tricopter Y" << "Quad +" << "Quad X" << "Hexacopter" << "Hexacopter X" << "Hexacopter Y6" + multiRotorTypes << "Tricopter Y" << "Quad +" << "Quad X" << "Hexacopter" << "Hexacopter X" << "Hexacopter H" << "Hexacopter Y6" << "Octocopter" << "Octocopter V" << "Octo Coax +" << "Octo Coax X"; m_aircraft->multirotorFrameType->addItems(multiRotorTypes); @@ -165,6 +165,13 @@ void ConfigMultiRotorWidget::setupUI(QString frameType) setComboCurrentIndex(m_aircraft->multirotorFrameType, m_aircraft->multirotorFrameType->findText("Hexacopter X")); + m_aircraft->mrRollMixLevel->setValue(33); + m_aircraft->mrPitchMixLevel->setValue(50); + setYawMixLevel(33); + } else if (frameType == "HexaH" || frameType == "Hexacopter H") { + setComboCurrentIndex(m_aircraft->multirotorFrameType, + m_aircraft->multirotorFrameType->findText("Hexacopter H")); + m_aircraft->mrRollMixLevel->setValue(33); m_aircraft->mrPitchMixLevel->setValue(50); setYawMixLevel(33); @@ -235,6 +242,8 @@ 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") { @@ -390,6 +399,31 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) // 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)); + + channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1; + 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) { double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH); @@ -549,6 +583,36 @@ 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 (old hexaX) + // 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 + // pitch roll yaw + double hMixer[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 } + }; + setupMultiRotorMixer(hMixer); + m_aircraft->mrStatusLabel->setText("Configuration OK"); } else if (m_aircraft->multirotorFrameType->currentText() == "Hexacopter Y6") { airframeType = "HexaCoax"; @@ -748,6 +812,8 @@ 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"; @@ -923,17 +989,17 @@ bool ConfigMultiRotorWidget::setupHexa(bool pLayout) // 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, -0.87, 1 }, + { -0.5, -0.87, -1 }, + { -1 , 0 , 1 }, + { -0.5, 0.87, -1 }, + { 0.5, 0.87, 1 }, + { 0, 0, 0 }, + { 0, 0, 0 } }; - // Motor 1 to 6, X Layout: + // Motor 1 to 6, X Layout (Real 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 @@ -941,14 +1007,14 @@ bool ConfigMultiRotorWidget::setupHexa(bool pLayout) // 5 [ 0 , 0.3, -0.3 ] W // 6 [ 0.5, 0.3, 0.3 ] NW 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 } + { 0.87, -0.5, -1 }, + { 0 , -1 , 1 }, + { -0.87, -0.5, -1 }, + { -0.87, 0.5, 1 }, + { 0 , 1 , -1 }, + { 0.87, 0.5, 1 }, + { 0, 0, 0 }, + { 0, 0, 0 } }; if (pLayout) { diff --git a/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp b/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp index 749aba293..0c881e231 100644 --- a/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp @@ -263,6 +263,7 @@ 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 == "HexaH" || frameType == "Hexacopter H" || frameType == "Hexacopter Y6" || frameType == "Octo" || frameType == "Octocopter" || frameType == "OctoV" || frameType == "Octocopter V" || frameType == "OctoCoaxP" || frameType == "Octo Coax +" || frameType == "OctoCoaxX" || frameType == "Octo Coax X") { diff --git a/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg b/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg index 92ec0177e..a8b71006d 100644 --- a/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg +++ b/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg @@ -1,12006 +1,4 @@ -image/svg+xml \ No newline at end of file +image/svg+xml \ No newline at end of file diff --git a/ground/openpilotgcs/src/plugins/setupwizard/connectiondiagram.cpp b/ground/openpilotgcs/src/plugins/setupwizard/connectiondiagram.cpp index 248ec3a97..22b85bdd3 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/connectiondiagram.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/connectiondiagram.cpp @@ -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; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.cpp index 1c47894cc..da3a73beb 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/multipage.cpp @@ -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; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp index c1eebfa1d..437a8d823 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp @@ -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; } @@ -131,7 +137,7 @@ void OutputCalibrationPage::setupVehicleItems() m_vehicleScene->addItem(m_vehicleBoundsItem); QRectF parentBounds = m_vehicleRenderer->boundsOnElement(m_vehicleElementIds[0]); - + qDebug() << "parentBounds " << parentBounds; for (int i = 1; i < m_vehicleElementIds.size(); i++) { QGraphicsSvgItem *item = new QGraphicsSvgItem(); item->setSharedRenderer(m_vehicleRenderer); diff --git a/ground/openpilotgcs/src/plugins/setupwizard/resources/connection-diagrams.svg b/ground/openpilotgcs/src/plugins/setupwizard/resources/connection-diagrams.svg index 3819b6fe3..faca25b5d 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/resources/connection-diagrams.svg +++ b/ground/openpilotgcs/src/plugins/setupwizard/resources/connection-diagrams.svg @@ -25,17 +25,17 @@ guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:window-width="1920" - inkscape:window-height="1017" + inkscape:window-width="1280" + inkscape:window-height="928" id="namedview4616" showgrid="false" - inkscape:zoom="2.5980069" - inkscape:cx="553.6599" - inkscape:cy="315.97469" - inkscape:window-x="-8" - inkscape:window-y="-8" + inkscape:zoom="2.6072106" + inkscape:cx="887.52671" + inkscape:cy="304.48878" + inkscape:window-x="0" + inkscape:window-y="27" inkscape:window-maximized="1" - inkscape:current-layer="background" + inkscape:current-layer="hexa" fit-margin-top="15" fit-margin-left="15" fit-margin-right="15" @@ -1515,7 +1515,7 @@ xlink:href="#radialGradient10189" id="radialGradient10076" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-72.756073,-72.756073,72.756088,-72.756073,1713.7197,1362.6172)" + gradientTransform="matrix(-72.756073,-72.756073,72.756088,-72.756073,1713.7197,1365.3939)" cx="0" cy="0" r="1" /> @@ -1533,7 +1533,7 @@ xlink:href="#radialGradient10189" id="radialGradient10080" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-72.756073,-72.756073,72.756088,-72.756073,1443.876,1362.7373)" + gradientTransform="matrix(-72.756073,-72.756073,72.756088,-72.756073,1443.876,1365.514)" cx="0" cy="0" r="1" /> @@ -1578,13 +1578,13 @@ xlink:href="#linearGradient20253" id="linearGradient10090" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0,-32.263962,-32.263962,0,2317.124,1429.937)" /> + gradientTransform="matrix(0,-32.263962,-32.263962,0,2321.124,1429.937)" /> @@ -1593,7 +1593,7 @@ xlink:href="#radialGradient10189" id="radialGradient10094" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-72.756073,-72.756073,72.756088,-72.756073,2405.9297,1434.1245)" + gradientTransform="matrix(-72.756073,-72.756073,72.756088,-72.756073,2405.9297,1442.1245)" cx="0" cy="0" r="1" /> @@ -1602,7 +1602,7 @@ xlink:href="#radialGradient10189" id="radialGradient10096" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-78.47522,-78.47522,78.475235,-78.47522,2343.916,1194.3828)" + gradientTransform="matrix(-78.47522,-78.47522,78.475235,-78.47522,2343.916,1198.3828)" cx="0" cy="0" r="1" /> @@ -1611,7 +1611,7 @@ xlink:href="#radialGradient10189" id="radialGradient10098" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-72.754059,-72.754059,72.754059,-72.754059,2245.9404,1152.9512)" + gradientTransform="matrix(-72.754059,-72.754059,72.754059,-72.754059,2245.9404,1156.9512)" cx="0" cy="0" r="1" /> @@ -1620,7 +1620,7 @@ xlink:href="#radialGradient10189" id="radialGradient10100" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(78.480576,-78.480576,-78.480576,-78.480576,2406.0371,1289.6309)" + gradientTransform="matrix(78.480576,-78.480576,-78.480576,-78.480576,2410.0371,1289.6309)" cx="0" cy="0" r="1" /> @@ -1629,7 +1629,7 @@ xlink:href="#radialGradient10189" id="radialGradient10102" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(72.756317,-72.756302,-72.756302,-72.756302,2504.0176,1248.1934)" + gradientTransform="matrix(72.756317,-72.756302,-72.756302,-72.756302,2508.0176,1248.1934)" cx="0" cy="0" r="1" /> @@ -1638,7 +1638,7 @@ xlink:href="#radialGradient10189" id="radialGradient10104" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(78.475525,-78.475525,-78.475525,-78.475525,2246.4951,1567.9712)" + gradientTransform="matrix(78.475525,-78.475525,-78.475525,-78.475525,2250.4951,1567.9712)" cx="0" cy="0" r="1" /> @@ -1647,7 +1647,7 @@ xlink:href="#radialGradient10189" id="radialGradient10106" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(72.75531,-72.755295,-72.755295,-72.755295,2344.4688,1526.5386)" + gradientTransform="matrix(72.75531,-72.755295,-72.755295,-72.755295,2348.4688,1526.5386)" cx="0" cy="0" r="1" /> @@ -1656,7 +1656,7 @@ xlink:href="#radialGradient10189" id="radialGradient10108" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(78.476685,-78.476669,-78.476669,-78.476669,2082.2842,1287.832)" + gradientTransform="matrix(78.476685,-78.476669,-78.476669,-78.476669,2078.2842,1287.832)" cx="0" cy="0" r="1" /> @@ -1665,7 +1665,7 @@ xlink:href="#radialGradient10189" id="radialGradient10110" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(72.752823,-72.752823,-72.752823,-72.752823,2180.2598,1243.3984)" + gradientTransform="matrix(72.752823,-72.752823,-72.752823,-72.752823,2176.2598,1247.3984)" cx="0" cy="0" r="1" /> @@ -1683,7 +1683,7 @@ xlink:href="#radialGradient10189" id="radialGradient10114" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-72.755829,-72.755829,72.755844,-72.755829,2084.8311,1431.5464)" + gradientTransform="matrix(-72.755829,-72.755829,72.755844,-72.755829,2084.8311,1435.5464)" cx="0" cy="0" r="1" /> @@ -1806,7 +1806,11 @@ xlink:href="#linearGradient25737" id="linearGradient10142" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0,-31.392593,-31.392593,0,2298.002,841.34277)" /> + gradientTransform="matrix(0,-31.392593,-31.392593,0,2298.002,833.34277)" + x2="0.90225679" + y2="-0.073307425" + x1="-0.048871614" + y1="-0.048871614" /> @@ -1875,7 +1879,7 @@ xlink:href="#radialGradient10189" id="radialGradient10158" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(72.756317,-72.756302,-72.756302,-72.756302,2166.8047,756.91602)" + gradientTransform="matrix(72.756317,-72.756302,-72.756302,-72.756302,2162.8047,756.91602)" cx="0" cy="0" r="1" /> @@ -1884,7 +1888,7 @@ xlink:href="#radialGradient10189" id="radialGradient10160" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-78.478134,-78.478134,78.478134,-78.478134,2166.7432,616.33301)" + gradientTransform="matrix(-78.478134,-78.478134,78.478134,-78.478134,2170.7432,616.33301)" cx="0" cy="0" r="1" /> @@ -1902,7 +1906,7 @@ xlink:href="#radialGradient10189" id="radialGradient10164" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-78.475525,-78.475525,78.475525,-78.475525,2165.7393,978.26172)" + gradientTransform="matrix(-78.475525,-78.475525,78.475525,-78.475525,2161.7393,978.26172)" cx="0" cy="0" r="1" /> @@ -1911,7 +1915,7 @@ xlink:href="#radialGradient10189" id="radialGradient10166" gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-72.756073,-72.756073,72.756088,-72.756073,2067.7637,936.8291)" + gradientTransform="matrix(-72.756073,-72.756073,72.756088,-72.756073,2063.7637,936.8291)" cx="0" cy="0" r="1" /> @@ -2030,6 +2034,144 @@ style="stop-color:#BE9513" id="stop8650-4" /> + + + + + + + + + + + + + @@ -2045,533 +2187,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -8606,2547 +8221,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -11433,7 +8507,7 @@ Throttle + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ground/openpilotgcs/src/plugins/setupwizard/resources/multirotor-shapes.svg b/ground/openpilotgcs/src/plugins/setupwizard/resources/multirotor-shapes.svg index a3077cbfd..320d41bc1 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/resources/multirotor-shapes.svg +++ b/ground/openpilotgcs/src/plugins/setupwizard/resources/multirotor-shapes.svg @@ -1,7219 +1,4 @@ -image/svg+xml \ No newline at end of file +image/svg+xml \ No newline at end of file diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp index de3b20063..1657ca526 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp @@ -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: diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index bdb18b3b2..f51a708af 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -202,6 +202,7 @@ 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: @@ -279,6 +280,7 @@ 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_COAX_X: case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_PLUS: @@ -940,7 +942,62 @@ void VehicleConfigurationHelper::setupHexaCopter() } case VehicleConfigurationSource::MULTI_ROTOR_HEXA_H: { - frame = SystemSettings::AIRFRAMETYPE_HEXAX; + frame = SystemSettings::AIRFRAMETYPE_HEXAH; + + 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[1].type = MIXER_TYPE_MOTOR; + channels[1].throttle1 = 100; + channels[1].throttle2 = 0; + channels[1].roll = -33; + channels[1].pitch = 0; + channels[1].yaw = 33; + + 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[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[4].type = MIXER_TYPE_MOTOR; + channels[4].throttle1 = 100; + channels[4].throttle2 = 0; + channels[4].roll = 33; + channels[4].pitch = 0; + channels[4].yaw = -33; + + 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; + + 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; channels[0].type = MIXER_TYPE_MOTOR; channels[0].throttle1 = 100; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationsource.h b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationsource.h index 98f06a991..df286a19c 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationsource.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationsource.h @@ -58,7 +58,7 @@ 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_HEXA, MULTI_ROTOR_HEXA_H, MULTI_ROTOR_HEXA_X, 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 }; enum ESC_TYPE { ESC_RAPID, ESC_LEGACY, ESC_UNKNOWN }; diff --git a/shared/uavobjectdefinition/systemsettings.xml b/shared/uavobjectdefinition/systemsettings.xml index 778b42e8d..472f474de 100644 --- a/shared/uavobjectdefinition/systemsettings.xml +++ b/shared/uavobjectdefinition/systemsettings.xml @@ -1,7 +1,7 @@ Select airframe type. Currently used by @ref ActuatorModule to choose mixing from @ref ActuatorDesired to @ref ActuatorCommand - +