From 0c0ae3641370f2d0db85ab231b0967f810ea5d3e Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sun, 13 Jul 2014 01:39:50 +0200 Subject: [PATCH] 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;