From a46480a99bd60450ebf6cf9241c9fb3283eb630b Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Thu, 10 Jul 2014 06:01:28 +0200 Subject: [PATCH 01/10] OP-1063 Multi_config_Hexa_fixes : Added real HexaX, renamed HexaX > HexaH Added artwork in config and wizard svg. Cleanup on svg connection diagram (layers) DO NOT USE until mixers are fixed --- flight/libraries/sanitycheck.c | 1 + .../VtolPathFollower/vtolpathfollower.c | 2 +- .../configmultirotorwidget.cpp | 102 +- .../config/configvehicletypewidget.cpp | 1 + .../config/images/multirotor-shapes.svg | 12004 +--------------- .../plugins/setupwizard/connectiondiagram.cpp | 3 + .../plugins/setupwizard/pages/multipage.cpp | 11 +- .../pages/outputcalibrationpage.cpp | 8 +- .../resources/connection-diagrams.svg | 6972 +++++---- .../resources/multirotor-shapes.svg | 7217 +--------- .../src/plugins/setupwizard/setupwizard.cpp | 3 + .../vehicleconfigurationhelper.cpp | 59 +- .../setupwizard/vehicleconfigurationsource.h | 2 +- shared/uavobjectdefinition/systemsettings.xml | 2 +- 14 files changed, 4045 insertions(+), 22342 deletions(-) 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 - + -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/resources/connection-diagrams.svg b/ground/openpilotgcs/src/plugins/setupwizard/resources/connection-diagrams.svg index faca25b5d..f62e09121 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/resources/connection-diagrams.svg +++ b/ground/openpilotgcs/src/plugins/setupwizard/resources/connection-diagrams.svg @@ -29,13 +29,13 @@ inkscape:window-height="928" id="namedview4616" showgrid="false" - inkscape:zoom="2.6072106" - inkscape:cx="887.52671" - inkscape:cy="304.48878" + inkscape:zoom="0.64157228" + inkscape:cx="660.0971" + inkscape:cy="259.75717" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" - inkscape:current-layer="hexa" + inkscape:current-layer="layer2" fit-margin-top="15" fit-margin-left="15" fit-margin-right="15" @@ -2181,12 +2181,3709 @@ image/svg+xml - + + id="background" + transform="translate(-1.2734359,-1.2734359)"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2700,12 +6397,12 @@ id="rect10839" /> + id="rect3773" + rx="1.4983482" /> + id="rect4841" + rx="0.6731993" /> + id="rect13909" + rx="0.67319936" /> + id="rect4841-1" + rx="0.97076511" /> + id="rect14232" + rx="1.2931794" /> + d="M 203.083,1.012 H 19.572 c -7.224,0 -13.08,4.478 -13.08,10 V 201.05 c 0,5.522 5.855,10 13.08,10 h 183.512 c 7.223,0 13.079,-4.478 13.079,-10 V 11.012 c 0,-5.523 -5.857,-10 -13.08,-10 z M 19.523,204.315 c -3.92,0 -7.098,-3.178 -7.098,-7.097 c 0,-3.92 3.178,-7.097 7.098,-7.097 c 3.918,0 7.096,3.177 7.096,7.097 c 0,3.92 -3.178,7.097 -7.096,7.097 z M 19.522,21.924 c -3.919,0 -7.097,-3.178 -7.097,-7.097 c 0,-3.919 3.178,-7.097 7.097,-7.097 c 3.919,0 7.097,3.177 7.097,7.097 c 0,3.919 -3.178,7.097 -7.097,7.097 z m 182.942,182.064 c -3.92,0 -7.098,-3.178 -7.098,-7.098 c 0,-3.919 3.178,-7.096 7.098,-7.096 c 3.918,0 7.096,3.177 7.096,7.096 c 0,3.921 -3.178,7.098 -7.096,7.098 z m 0.194,-183.487 c -3.92,0 -7.098,-3.178 -7.098,-7.097 c 0,-3.919 3.178,-7.097 7.098,-7.097 c 3.918,0 7.096,3.177 7.096,7.097 c -0.001,3.92 -3.178,7.097 -7.096,7.097 z" /> + d="m 110.126,10.926 l 0.563,1.734 c 3.82,-1.425 2.62,-7.761 -2.074,-6.405 c 4.021,-0.446 4.084,4.377 1.511,4.671 z" /> + d="m 108.854,7.167 l -0.563,-1.734 c -3.82,1.425 -2.62,7.761 2.075,6.405 c -4.021,0.446 -4.084,-4.377 -1.512,-4.671 z" /> + d="m 98.619,13.405 h -1.59 L 95.548,10.35 H 95.39 v 2.083 H 93.94 V 5.672 c 0.381,-0.009 1.283,-0.148 1.711,-0.148 c 0.437,0 0.949,0.019 1.396,0.25 c 0.734,0.372 1.134,1.154 1.087,2.558 c -0.093,1.144 -0.502,1.692 -1.125,1.916 l 1.61,3.157 z m -1.936,-5.39 c 0,-0.576 -0.205,-1.199 -0.819,-1.199 c -0.158,0 -0.333,0.018 -0.474,0.046 v 2.38 c 0.892,0.336 1.293,-0.389 1.293,-1.227 z" /> + d="m 103.88,10.359 l 0.707,-4.687 h 1.553 l -1.404,6.761 h -1.85 l -1.414,-6.761 h 1.562 l 0.708,4.687 l 0.074,0.567 l 0.064,-0.567 z" /> + d="M 116.558,10.573 V 5.672 h 1.487 v 4.817 c 0.009,0.456 0.038,0.818 0.651,0.818 c 0.613,0 0.642,-0.362 0.651,-0.818 V 5.672 h 1.487 v 4.901 c 0,1.376 -0.763,1.99 -2.139,1.99 c -1.356,0 -2.137,-0.614 -2.137,-1.99 z" /> + d="m 121.022,6.946 l 0.102,-1.274 h 3.952 l 0.121,1.274 h -1.292 v 5.487 H 122.38 V 6.946 h -1.358 z" /> + d="m 127.177,9.029 c 0,-1.692 0.633,-3.542 2.604,-3.533 c 1.962,-0.009 2.595,1.841 2.586,3.533 c 0,1.711 -0.595,3.543 -2.586,3.534 c -1.999,0.009 -2.584,-1.823 -2.604,-3.534 z m 1.563,0.019 c 0,0.93 0.186,2.269 1.041,2.306 c 0.847,-0.038 1.032,-1.376 1.032,-2.306 c 0,-0.921 -0.186,-2.111 -1.032,-2.167 c -0.856,0.056 -1.041,1.246 -1.041,2.167 z" /> + d="m 35.028,179.497 c 0,1.104 -0.896,2 -2,2 H 6.084 c -1.104,0 -2,-0.896 -2,-2 l 2,-1.341 l -2,-2.125 v -31 l 2,-2.375 l -2,-1.288 c 0,-1.104 0.896,-2 2,-2 h 26.945 c 1.104,0 2,0.896 2,2 v 38.129 z" /> + points="186.194,11.031 181.129,13.319 186.083,4.74 191.036,13.319 " /> + points="36.194,11.031 31.129,13.319 36.083,4.74 41.036,13.319 " /> + id="rect8853-6" + rx="11.5" /> + id="rect8853-6-8" + rx="11.5" /> + id="rect8853-0" + rx="16.200001" /> @@ -8444,7 +12149,7 @@ @@ -8464,7 +12169,8 @@ height="386" ry="16.200001" style="color:#000000;fill:url(#linearGradient10174);fill-rule:nonzero;stroke:#000000;stroke-width:7.73999977;enable-background:accumulate" - id="rect8853" /> + id="rect8853" + rx="16.200001" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 0c0ae3641370f2d0db85ab231b0967f810ea5d3e Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sun, 13 Jul 2014 01:39:50 +0200 Subject: [PATCH 03/10] OP-1063 Multi_config_Hexa_fixes Svg file : Added HexX_reverse and fixed gradients SetupWizard : Updated Hexa, HexaC and HexaH default values, default Throttle curve at 90% max Fixed a previous bug sign in HexaH (and HexaX because previously copied) : Bug was in M4 Roll and M6 Yaw. --- .../configmultirotorwidget.cpp | 18 +- .../config/images/multirotor-shapes.svg | 523 +++++++++++++++++- .../vehicleconfigurationhelper.cpp | 128 +++-- 3 files changed, 578 insertions(+), 91 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp index de63d587f..c834cd128 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp @@ -158,23 +158,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(60); // Old Roll 50 - Pitch 33 - m_aircraft->mrPitchMixLevel->setValue(40); - 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(40); // Old: Roll 33 - Pitch 50 - m_aircraft->mrPitchMixLevel->setValue(60); - 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(40); - m_aircraft->mrPitchMixLevel->setValue(60); - setYawMixLevel(33); + 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")); diff --git a/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg b/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg index c1e4ea3aa..a17c4236b 100644 --- a/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg +++ b/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg @@ -29,8 +29,8 @@ inkscape:window-height="928" id="namedview6635" showgrid="false" - inkscape:zoom="4.2152105" - inkscape:cx="1120.7002" + inkscape:zoom="1.5262997" + inkscape:cx="1120.2257" inkscape:cy="2126.7661" inkscape:window-x="0" inkscape:window-y="27" @@ -38,7 +38,7 @@ inkscape:current-layer="svg4183" />image/svg+xml \ No newline at end of file + d="m 2127.654,1446.4693 c -2.3452,1.354 -3.5771,3.7142 -3.0009,6.0962 l 3.2748,-0.7498 c -0.2413,-1.05 0.1809,-2.1667 1.1811,-2.7442 1.0358,-0.598 2.2944,-0.476 3.0084,0.7607 0.8815,1.5268 -0.2486,2.7612 -1.5026,3.4852 -0.9094,0.525 -2.373,1.056 -3.4704,1.2531 l 4.5603,7.1867 7.892,-4.5565 -1.512,-2.6188 -5.1831,2.9925 -1.2838,-1.9736 c 0.4339,-0.1304 0.9815,-0.398 1.3634,-0.6185 2.5825,-1.491 3.8569,-4.0697 2.2929,-6.7786 -1.806,-3.1281 -5.0921,-3.1939 -7.6201,-1.7344" /> \ No newline at end of file diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index f51a708af..f2fcb1e7b 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -635,8 +635,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); } } @@ -832,49 +833,56 @@ void VehicleConfigurationHelper::setupHexaCopter() switch (m_configSource->getVehicleSubType()) { case VehicleConfigurationSource::MULTI_ROTOR_HEXA: { - frame = SystemSettings::AIRFRAMETYPE_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; @@ -943,48 +951,55 @@ void VehicleConfigurationHelper::setupHexaCopter() case VehicleConfigurationSource::MULTI_ROTOR_HEXA_H: { 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; @@ -998,48 +1013,55 @@ void VehicleConfigurationHelper::setupHexaCopter() 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 = -33; - channels[0].pitch = 50; - channels[0].yaw = -33; + 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 = -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 = -100; 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 = 100; 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 = 100; guiSettings.multi.VTOLMotorNE = 1; guiSettings.multi.VTOLMotorE = 2; From 64eb77ed8b83982ac5921f6e61da2b1f5ff80e51 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sun, 13 Jul 2014 01:39:50 +0200 Subject: [PATCH 04/10] OP-1063 Multi_config_Hexa_fixes Svg file : Added HexaX_reverse and fixed gradients SetupWizard : Updated Hexa, HexaX and HexaH default values, default Throttle curve at 90% max Fixed a previous bug sign in HexaH (and HexaX because previously copied) : Bug was in M4 Roll and M6 Yaw. --- .../configmultirotorwidget.cpp | 18 +- .../config/images/multirotor-shapes.svg | 523 +++++++++++++++++- .../vehicleconfigurationhelper.cpp | 128 +++-- 3 files changed, 578 insertions(+), 91 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp index de63d587f..c834cd128 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp @@ -158,23 +158,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(60); // Old Roll 50 - Pitch 33 - m_aircraft->mrPitchMixLevel->setValue(40); - 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(40); // Old: Roll 33 - Pitch 50 - m_aircraft->mrPitchMixLevel->setValue(60); - 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(40); - m_aircraft->mrPitchMixLevel->setValue(60); - setYawMixLevel(33); + 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")); diff --git a/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg b/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg index c1e4ea3aa..a17c4236b 100644 --- a/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg +++ b/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg @@ -29,8 +29,8 @@ inkscape:window-height="928" id="namedview6635" showgrid="false" - inkscape:zoom="4.2152105" - inkscape:cx="1120.7002" + inkscape:zoom="1.5262997" + inkscape:cx="1120.2257" inkscape:cy="2126.7661" inkscape:window-x="0" inkscape:window-y="27" @@ -38,7 +38,7 @@ inkscape:current-layer="svg4183" />image/svg+xml \ No newline at end of file + d="m 2127.654,1446.4693 c -2.3452,1.354 -3.5771,3.7142 -3.0009,6.0962 l 3.2748,-0.7498 c -0.2413,-1.05 0.1809,-2.1667 1.1811,-2.7442 1.0358,-0.598 2.2944,-0.476 3.0084,0.7607 0.8815,1.5268 -0.2486,2.7612 -1.5026,3.4852 -0.9094,0.525 -2.373,1.056 -3.4704,1.2531 l 4.5603,7.1867 7.892,-4.5565 -1.512,-2.6188 -5.1831,2.9925 -1.2838,-1.9736 c 0.4339,-0.1304 0.9815,-0.398 1.3634,-0.6185 2.5825,-1.491 3.8569,-4.0697 2.2929,-6.7786 -1.806,-3.1281 -5.0921,-3.1939 -7.6201,-1.7344" /> \ No newline at end of file diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index f51a708af..f2fcb1e7b 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -635,8 +635,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); } } @@ -832,49 +833,56 @@ void VehicleConfigurationHelper::setupHexaCopter() switch (m_configSource->getVehicleSubType()) { case VehicleConfigurationSource::MULTI_ROTOR_HEXA: { - frame = SystemSettings::AIRFRAMETYPE_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; @@ -943,48 +951,55 @@ void VehicleConfigurationHelper::setupHexaCopter() case VehicleConfigurationSource::MULTI_ROTOR_HEXA_H: { 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; @@ -998,48 +1013,55 @@ void VehicleConfigurationHelper::setupHexaCopter() 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 = -33; - channels[0].pitch = 50; - channels[0].yaw = -33; + 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 = -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 = -100; 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 = 100; 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 = 100; guiSettings.multi.VTOLMotorNE = 1; guiSettings.multi.VTOLMotorE = 2; From 711aa7f7d6a268224683a69943d3b286a81dbb61 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sun, 13 Jul 2014 11:01:06 +0200 Subject: [PATCH 05/10] OP-1063_Multi_config_Hexa_fixes Added OctoX Svg --- .../config/images/multirotor-shapes.svg | 1218 ++++++++++++++++- 1 file changed, 1213 insertions(+), 5 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg b/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg index a17c4236b..857c73507 100644 --- a/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg +++ b/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg @@ -29,9 +29,9 @@ inkscape:window-height="928" id="namedview6635" showgrid="false" - inkscape:zoom="1.5262997" - inkscape:cx="1120.2257" - inkscape:cy="2126.7661" + inkscape:zoom="0.17071524" + inkscape:cx="2032.6246" + inkscape:cy="2727.8341" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -5508,7 +5508,379 @@ fy="1520.8256" r="61.7985" gradientTransform="matrix(1.0533206,1.1417668,-1.2584469,1.160962,1865.4378,-1247.7457)" - gradientUnits="userSpaceOnUse" /> \ No newline at end of file + inkscape:connector-curvature="0" /> \ No newline at end of file From c26e33964ab8d64beabdc7d2610ed08f94690194 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sun, 13 Jul 2014 13:58:18 +0200 Subject: [PATCH 06/10] OP-1063 Multi_config_Hexa_fixes Added OctoX, define new mixer table for Octo(p) and OctoX. New motor definition for OctoX (NNE, ENE...) Fixes for svg frames. Defined default settings for OctoP/X in setupwizard (but disabled) --- flight/libraries/sanitycheck.c | 1 + .../VtolPathFollower/vtolpathfollower.c | 3 +- .../configmultirotorwidget.cpp | 149 +++++++++++++++--- .../config/cfg_vehicletypes/vehicleconfig.h | 9 ++ .../config/configvehicletypewidget.cpp | 9 +- .../config/images/multirotor-shapes.svg | 24 +-- .../vehicleconfigurationhelper.cpp | 133 +++++++++++++--- .../setupwizard/vehicleconfigurationsource.h | 4 +- shared/uavobjectdefinition/systemsettings.xml | 2 +- 9 files changed, 269 insertions(+), 65 deletions(-) diff --git a/flight/libraries/sanitycheck.c b/flight/libraries/sanitycheck.c index c2a2ea0cf..365e1af7b 100644 --- a/flight/libraries/sanitycheck.c +++ b/flight/libraries/sanitycheck.c @@ -265,6 +265,7 @@ 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: diff --git a/flight/modules/VtolPathFollower/vtolpathfollower.c b/flight/modules/VtolPathFollower/vtolpathfollower.c index a86f0fec2..bae101487 100644 --- a/flight/modules/VtolPathFollower/vtolpathfollower.c +++ b/flight/modules/VtolPathFollower/vtolpathfollower.c @@ -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_HEXAH)) { + && (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; diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp index c834cd128..e04cd986c 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp @@ -55,6 +55,32 @@ QStringList ConfigMultiRotorWidget::getChannelDescriptions() // get the gui config data 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"); @@ -111,7 +137,7 @@ ConfigMultiRotorWidget::ConfigMultiRotorWidget(QWidget *parent) : QStringList multiRotorTypes; multiRotorTypes << "Tricopter Y" << "Quad +" << "Quad X" << "Hexacopter" << "Hexacopter X" << "Hexacopter H" << "Hexacopter Y6" - << "Octocopter" << "Octocopter V" << "Octo Coax +" << "Octo Coax X"; + << "Octocopter" << "Octocopter X" << "Octocopter V" << "Octo Coax +" << "Octo Coax X"; m_aircraft->multirotorFrameType->addItems(multiRotorTypes); // Set default model to "Quad X" @@ -185,9 +211,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")); @@ -248,6 +280,8 @@ void ConfigMultiRotorWidget::setupEnabledControls(QString frameType) 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 +") { @@ -288,6 +322,14 @@ void ConfigMultiRotorWidget::resetActuators(GUIConfigDataUnion *configData) 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; } /** @@ -380,7 +422,7 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) m_aircraft->mrPitchMixLevel->setValue(qRound(value / 1.27)); //get motor 2 value for Yaw and Roll - channel += 1; + channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1; value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW); setYawMixLevel(-qRound(value / 1.27)); @@ -409,7 +451,7 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) m_aircraft->mrPitchMixLevel->setValue(qRound(value / 1.27)); //get motor 2 value for Yaw and Roll - channel += 1; + channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1; value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW); setYawMixLevel(-qRound(value / 1.27)); @@ -492,11 +534,11 @@ 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") { + } else if (frameType == "OctoV") { double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH); m_aircraft->mrPitchMixLevel->setValue(qRound(value / 1.27)); @@ -520,6 +562,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); @@ -657,16 +727,40 @@ QString ConfigMultiRotorWidget::updateConfigObjectsFromWidgets() << "VTOLMotorW" << "VTOLMotorNW"; setupMotors(motorList); // Motor 1 to 8: - // pitch roll yaw + // pitch roll yaw (OctoP) 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"); + } 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: + // pitch roll yaw (OctoX) + 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("Configuration OK"); @@ -828,6 +922,8 @@ void ConfigMultiRotorWidget::updateAirframe(QString frameType) 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 +") { @@ -899,6 +995,23 @@ void ConfigMultiRotorWidget::setupMotors(QList 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); diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/vehicleconfig.h b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/vehicleconfig.h index 26c468601..7ffae4cad 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/vehicleconfig.h +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/vehicleconfig.h @@ -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; diff --git a/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp b/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp index 0c881e231..5cb9e8547 100644 --- a/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp @@ -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,9 +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 == "HexaH" || frameType == "Hexacopter H" - || 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") { diff --git a/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg b/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg index 743fc7fa1..fae42213c 100644 --- a/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg +++ b/ground/openpilotgcs/src/plugins/config/images/multirotor-shapes.svg @@ -29,22 +29,16 @@ inkscape:window-height="928" id="namedview6635" showgrid="false" -<<<<<<< HEAD - inkscape:zoom="0.17071524" - inkscape:cx="2032.6246" - inkscape:cy="2727.8341" -======= - inkscape:zoom="1.5262997" - inkscape:cx="1120.2257" - inkscape:cy="2126.7661" ->>>>>>> 0c0ae3641370f2d0db85ab231b0967f810ea5d3e + inkscape:zoom="0.46421413" + inkscape:cx="3322.5456" + inkscape:cy="3589.5054" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" inkscape:current-layer="svg4183" />image/svg+xml>>>>>> 0c0ae3641370f2d0db85ab231b0967f810ea5d3e id="g4327" transform="matrix(1.25,0,0,1.25,-146.76331,-311.9055)" /> -======= - inkscape:connector-curvature="0" /> ->>>>>>> 0c0ae3641370f2d0db85ab231b0967f810ea5d3e + d="m 3062.2588,1271.4951 l 2.557,0 c 0.279,0 0.5,-0.107 0.695,-0.297 c 0.1,-0.088 0.176,-0.199 0.215,-0.314 c 0.051,-0.118 0.084,-0.246 0.084,-0.387 l 0,-0.914 c 0,-0.135 -0.033,-0.266 -0.084,-0.395 c -0.039,-0.107 -0.115,-0.209 -0.215,-0.298 c -0.195,-0.194 -0.416,-0.299 -0.695,-0.299 l -2.557,0 c -0.275,0 -0.504,0.105 -0.693,0.299 c -0.104,0.089 -0.174,0.191 -0.225,0.298 c -0.039,0.129 -0.078,0.26 -0.078,0.395 l 0,0.914 c 0,0.141 0.039,0.269 0.078,0.387 c 0.051,0.115 0.121,0.226 0.225,0.314 c 0.189,0.19 0.418,0.297 0.693,0.297 m -12.41,0 l 2.558,0 c 0.276,0 0.497,-0.107 0.688,-0.297 c 0.191,-0.187 0.309,-0.426 0.309,-0.701 l 0,-0.914 c 0,-0.277 -0.118,-0.526 -0.309,-0.693 c -0.184,-0.192 -0.41,-0.299 -0.676,-0.299 l -3.566,0 l 0,0.992 l 0,0.521 l 0,0.393 c 0,0.141 0.035,0.269 0.084,0.387 c 0.051,0.115 0.129,0.226 0.228,0.314 c 0.176,0.19 0.403,0.297 0.684,0.297 m -15.022,0 l 2.551,0 c 0.287,0 0.506,-0.107 0.701,-0.297 c 0.096,-0.088 0.166,-0.199 0.213,-0.314 c 0.053,-0.118 0.082,-0.246 0.082,-0.379 l -4.541,0 c 0,0.133 0.033,0.261 0.08,0.379 c 0.051,0.115 0.121,0.226 0.219,0.314 c 0.189,0.19 0.426,0.297 0.695,0.297 m -7.509,0 l 2.537,0 c 0.281,0 0.519,-0.107 0.715,-0.297 c 0.197,-0.187 0.281,-0.426 0.281,-0.701 l 0,-0.914 c 0,-0.277 -0.084,-0.526 -0.281,-0.693 c -0.196,-0.194 -0.434,-0.299 -0.715,-0.299 l -1.893,0 l -1.641,0 l 0,0.992 l 0,0.521 l 0,0.393 c 0,0.141 0.02,0.269 0.073,0.387 c 0.062,0.115 0.135,0.226 0.224,0.314 c 0.18,0.19 0.42,0.297 0.7,0.297 m -7.518,0 l 2.539,0 c 0.277,0 0.522,-0.107 0.709,-0.297 c 0.088,-0.088 0.158,-0.199 0.215,-0.314 c 0.051,-0.118 0.074,-0.246 0.074,-0.387 l 0,-0.914 c 0,-0.135 -0.023,-0.266 -0.074,-0.395 c -0.057,-0.107 -0.127,-0.209 -0.215,-0.298 c -0.187,-0.194 -0.432,-0.299 -0.709,-0.299 l -0.318,0 l -2.221,0 c -0.281,0 -0.514,0.105 -0.713,0.299 c -0.082,0.089 -0.158,0.191 -0.209,0.298 c -0.057,0.129 -0.074,0.26 -0.074,0.395 l 0,0.914 c 0,0.141 0.017,0.269 0.074,0.387 c 0.051,0.115 0.127,0.226 0.209,0.314 c 0.199,0.19 0.432,0.297 0.713,0.297 m 42.391,1.041 c -0.278,0 -0.543,-0.049 -0.795,-0.166 c -0.233,-0.088 -0.453,-0.242 -0.619,-0.42 c -0.194,-0.189 -0.34,-0.406 -0.457,-0.652 c -0.106,-0.254 -0.141,-0.52 -0.141,-0.793 l 0,-0.93 c 0,-0.281 0.035,-0.547 0.141,-0.795 c 0.117,-0.242 0.263,-0.455 0.457,-0.642 c 0.166,-0.178 0.386,-0.332 0.619,-0.426 c 0.252,-0.115 0.517,-0.16 0.795,-0.16 l 2.693,0 c 0.277,0 0.543,0.045 0.791,0.16 c 0.236,0.094 0.459,0.248 0.637,0.426 c 0.189,0.187 0.334,0.4 0.445,0.642 c 0.096,0.248 0.147,0.514 0.147,0.795 l 0,0.93 c 0,0.273 -0.051,0.539 -0.147,0.793 c -0.111,0.246 -0.256,0.463 -0.445,0.652 c -0.178,0.178 -0.401,0.332 -0.637,0.42 c -0.248,0.117 -0.514,0.166 -0.791,0.166 l -2.693,0 z m -27.428,0 c -0.274,0 -0.539,-0.049 -0.797,-0.166 c -0.236,-0.088 -0.451,-0.242 -0.625,-0.42 c -0.186,-0.189 -0.34,-0.406 -0.447,-0.652 c -0.108,-0.252 -0.156,-0.508 -0.156,-0.785 l 0,-0.93 c 0,-0.277 0.048,-0.541 0.156,-0.795 c 0.107,-0.244 0.261,-0.463 0.447,-0.65 c 0.174,-0.178 0.389,-0.332 0.625,-0.426 c 0.258,-0.115 0.523,-0.16 0.797,-0.16 l 4.111,0 l 0,1.039 l -4.047,0 c -0.269,0 -0.506,0.105 -0.695,0.299 c -0.074,0.078 -0.133,0.16 -0.18,0.257 c -0.058,0.096 -0.091,0.203 -0.107,0.303 l 5.627,0 l 0,1.063 c 0,0.277 -0.051,0.533 -0.145,0.785 c -0.117,0.246 -0.254,0.463 -0.449,0.652 c -0.182,0.178 -0.4,0.332 -0.644,0.42 c -0.233,0.117 -0.5,0.166 -0.791,0.166 l -2.68,0 z m -15.031,0 c -0.291,0 -0.555,-0.049 -0.793,-0.166 c -0.25,-0.088 -0.459,-0.242 -0.645,-0.42 c -0.183,-0.189 -0.336,-0.406 -0.445,-0.652 c -0.1,-0.254 -0.153,-0.52 -0.153,-0.793 l 0,-0.93 c 0,-0.281 0.053,-0.547 0.153,-0.795 c 0.109,-0.242 0.262,-0.455 0.445,-0.642 c 0.186,-0.178 0.395,-0.332 0.645,-0.426 c 0.238,-0.115 0.502,-0.16 0.793,-0.16 l 2.011,0 l 0.664,0 l 2.803,0 l 0,-1.989 l 1.111,0 l 0,1.989 l 0.928,0 l 0.36,0 l 2.324,0 c 0.283,0 0.543,0.045 0.783,0.16 c 0.252,0.094 0.463,0.248 0.654,0.426 c 0.192,0.187 0.334,0.4 0.436,0.642 c 0.099,0.248 0.158,0.514 0.158,0.795 l 0,0.93 c 0,0.273 -0.059,0.539 -0.158,0.793 c -0.102,0.246 -0.244,0.463 -0.436,0.652 c -0.191,0.178 -0.402,0.332 -0.654,0.42 c -0.24,0.117 -0.5,0.166 -0.783,0.166 l -2.684,0 c -0.281,0 -0.545,-0.049 -0.793,-0.166 c -0.244,-0.088 -0.455,-0.242 -0.642,-0.42 c -0.186,-0.189 -0.338,-0.406 -0.44,-0.652 c -0.107,-0.254 -0.164,-0.52 -0.164,-0.793 l 0,-1.914 l -1.017,0 c 0.027,0.062 0.068,0.127 0.087,0.189 c 0.112,0.248 0.165,0.514 0.165,0.795 l 0,0.93 c 0,0.273 -0.053,0.539 -0.165,0.793 c -0.091,0.246 -0.244,0.463 -0.423,0.652 c -0.192,0.178 -0.407,0.332 -0.653,0.42 c -0.252,0.117 -0.517,0.166 -0.797,0.166 l -2.675,0 z m 35.543,-4.984 l 1.105,0 l 0,5 l -1.105,0 l 0,-5 z m -13.004,5 c -0.274,0 -0.539,-0.059 -0.791,-0.182 c -0.229,-0.088 -0.446,-0.242 -0.625,-0.42 c -0.186,-0.189 -0.336,-0.406 -0.451,-0.652 c -0.096,-0.252 -0.139,-0.508 -0.139,-0.785 l 0,-2.961 l 1.086,0 l 0,2.953 c 0,0.273 0.113,0.513 0.301,0.707 c 0.08,0.09 0.197,0.158 0.302,0.213 c 0.121,0.052 0.244,0.074 0.381,0.074 l 2.569,0 c 0.132,0 0.263,-0.022 0.369,-0.074 c 0.121,-0.055 0.244,-0.123 0.314,-0.213 c 0.197,-0.194 0.301,-0.434 0.301,-0.707 l 0,-2.953 l 0.307,0 l 0.785,0 l 0.777,0 l 0,-1.989 l 1.096,0 l 0,1.989 l 0.927,0 l 2.299,0 l 0.407,0 c 0.265,0 0.531,0.045 0.783,0.16 c 0.23,0.094 0.451,0.248 0.631,0.426 c 0.183,0.187 0.338,0.4 0.445,0.642 c 0.103,0.248 0.139,0.514 0.139,0.795 l 0,0.93 c 0,0.273 -0.036,0.539 -0.139,0.793 c -0.107,0.246 -0.262,0.463 -0.445,0.652 c -0.18,0.178 -0.401,0.332 -0.631,0.42 c -0.252,0.117 -0.518,0.166 -0.783,0.166 l -2.706,0 c -0.279,0 -0.544,-0.049 -0.792,-0.166 c -0.225,-0.088 -0.438,-0.242 -0.625,-0.42 c -0.19,-0.189 -0.34,-0.406 -0.456,-0.652 c -0.099,-0.254 -0.15,-0.52 -0.15,-0.793 l 0,-1.914 l -0.777,0 l 0,1.914 l 0,0.01 c 0,0.277 -0.053,0.533 -0.139,0.785 c -0.119,0.246 -0.262,0.463 -0.451,0.652 c -0.184,0.178 -0.406,0.332 -0.643,0.42 c -0.23,0.123 -0.496,0.182 -0.777,0.182 l -2.699,0 z m 25.617,1.429 l 0,-1.22 l -0.49,0 l 0,-1.053 l 0.49,0 l 0,-2.133 c 0,-0.281 0.06,-0.547 0.154,-0.795 c 0.112,-0.242 0.252,-0.455 0.438,-0.642 c 0.195,-0.178 0.4,-0.332 0.652,-0.426 c 0.236,-0.115 0.502,-0.16 0.793,-0.16 l 0.791,0 l 0,1.039 l -0.777,0 c -0.27,0.025 -0.504,0.129 -0.664,0.32 c -0.096,0.078 -0.168,0.191 -0.213,0.307 c -0.049,0.105 -0.065,0.232 -0.065,0.365 l 0,2.125 l 1.719,0 l 0,0.223 l 0,0.83 l -1.719,0 l 0,1.22 l -1.109,0 z m -10.752,0.563 l 0,-4.961 c 0,-0.277 0.06,-0.541 0.162,-0.795 c 0.1,-0.244 0.24,-0.463 0.434,-0.639 c 0.197,-0.183 0.398,-0.332 0.66,-0.437 c 0.234,-0.115 0.49,-0.16 0.777,-0.16 l 0.221,0 l 0,1.035 l -0.201,0 c -0.262,0.025 -0.479,0.129 -0.664,0.32 c -0.088,0.078 -0.157,0.191 -0.198,0.307 c -0.064,0.105 -0.068,0.232 -0.068,0.365 l 0,4.961 l -1.123,0 z m -1.861,-1.096 l 1.105,0 l 0,1.096 l -1.105,0 l 0,-1.096 z" /> \ No newline at end of file diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index f2fcb1e7b..2ebcdedcd 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -206,6 +206,7 @@ void VehicleConfigurationHelper::applyVehicleConfiguration() 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: @@ -282,6 +283,7 @@ void VehicleConfigurationHelper::applyActuatorConfiguration() 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: @@ -1089,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; @@ -1157,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; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationsource.h b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationsource.h index df286a19c..797283656 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationsource.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationsource.h @@ -59,8 +59,8 @@ public: 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_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 }; + 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 }; diff --git a/shared/uavobjectdefinition/systemsettings.xml b/shared/uavobjectdefinition/systemsettings.xml index 472f474de..ae808f185 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 - +