From 458120cce275c2b88daacf5c997106dd857303b3 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Tue, 26 Aug 2014 14:17:24 +0200 Subject: [PATCH 1/7] OP-1422 Tricopter_mixers_settings : Do the same calc as Gcs and round values so Wizard set same values as Gcs defaults. Little fix for HexaX wizard that set HexaH frame ! --- .../src/plugins/setupwizard/vehicleconfigurationhelper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index 119d58120..19a5d4099 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -440,8 +440,8 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch Q_ASSERT(field); field->setValue((channels[i].throttle1 * 127) / 100, 0); field->setValue((channels[i].throttle2 * 127) / 100, 1); - field->setValue((channels[i].roll * 127) / 100, 2); - field->setValue((channels[i].pitch * 127) / 100, 3); + field->setValue(qRound(((double)channels[i].roll * 127) / 100), 2); + field->setValue(qRound(((double)channels[i].pitch * 127) / 100), 3); field->setValue((channels[i].yaw * 127) / 100, 4); } @@ -1014,7 +1014,7 @@ void VehicleConfigurationHelper::setupHexaCopter() } case VehicleConfigurationSource::MULTI_ROTOR_HEXA_X: { - frame = SystemSettings::AIRFRAMETYPE_HEXAH; + frame = SystemSettings::AIRFRAMETYPE_HEXAX; // HexaX according to new mixer table and pitch-roll-yaw mixing at 100% // Pitch Roll Yaw // M1 { 1, -0.5, -1 }, From aea2adf2df9711149a68cea28217c3d655b1fe99 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Tue, 26 Aug 2014 17:07:00 +0200 Subject: [PATCH 2/7] OP-1422 Tricopter_mixers_settings Normalize mixer values saved from Wizard and Config tab. Fix bad values saved previously like -63/64. --- .../configmultirotorwidget.cpp | 25 ++++++++++++++++--- .../vehicleconfigurationhelper.cpp | 22 +++++++++++++--- .../setupwizard/vehicleconfigurationhelper.h | 1 + 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp index 8216ca7d3..055cfe55f 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp @@ -968,14 +968,33 @@ void ConfigMultiRotorWidget::setupQuadMotor(int channel, double pitch, double ro UAVDataObject *mixer = dynamic_cast(getObjectManager()->getObject(QString("MixerSettings"))); Q_ASSERT(mixer); + + //Normalize mixer values, allow a well balanced mixer saved + if(pitch < 0) { + pitch = qFloor(pitch * 127); + } else { + pitch = qCeil(pitch * 127); + } + + if(roll < 0) { + roll = qFloor(roll * 127); + } else { + roll = qCeil(roll * 127); + } + + if(yaw < 0) { + yaw = qFloor(yaw * 127); + } else { + yaw = qCeil(yaw * 127); + } setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_MOTOR); setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_THROTTLECURVE1, 127); setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_THROTTLECURVE2, 0); - setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL, roll * 127); - setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH, pitch * 127); - setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW, yaw * 127); + setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL, roll); + setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH, pitch); + setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW, yaw); } /** diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index 19a5d4099..b0858bcbb 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -440,9 +440,25 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch Q_ASSERT(field); field->setValue((channels[i].throttle1 * 127) / 100, 0); field->setValue((channels[i].throttle2 * 127) / 100, 1); - field->setValue(qRound(((double)channels[i].roll * 127) / 100), 2); - field->setValue(qRound(((double)channels[i].pitch * 127) / 100), 3); - field->setValue((channels[i].yaw * 127) / 100, 4); + + //Normalize mixer values, allow a well balanced mixer saved + if(channels[i].roll < 0) { + field->setValue(qFloor((double)(channels[i].roll * 127) / 100), 2); + } else { + field->setValue(qCeil((double)(channels[i].roll * 127) / 100), 2); + } + + if(channels[i].pitch < 0) { + field->setValue(qFloor((double)(channels[i].pitch * 127) / 100), 3); + } else { + field->setValue(qCeil((double)(channels[i].pitch * 127) / 100), 3); + } + + if(channels[i].yaw < 0) { + field->setValue(qFloor((double)(channels[i].yaw * 127) / 100), 4); + } else { + field->setValue(qCeil((double)(channels[i].yaw * 127) / 100), 4); + } } // Apply updates diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h index 1ed1aa576..17b493fb7 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h @@ -30,6 +30,7 @@ #include #include +#include #include "vehicleconfigurationsource.h" #include "uavobjectmanager.h" #include "systemsettings.h" From 94809de9c4bd65021be621367593a5a4dc3b18b3 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Tue, 26 Aug 2014 19:27:05 +0200 Subject: [PATCH 3/7] OP-1422_Tricopter_mixers_settings Ternary operator and include qmath.h in cpp --- .../configmultirotorwidget.cpp | 20 +++---------------- .../vehicleconfigurationhelper.cpp | 1 + .../setupwizard/vehicleconfigurationhelper.h | 1 - 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp index 055cfe55f..b76efb9f2 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp @@ -970,23 +970,9 @@ void ConfigMultiRotorWidget::setupQuadMotor(int channel, double pitch, double ro Q_ASSERT(mixer); //Normalize mixer values, allow a well balanced mixer saved - if(pitch < 0) { - pitch = qFloor(pitch * 127); - } else { - pitch = qCeil(pitch * 127); - } - - if(roll < 0) { - roll = qFloor(roll * 127); - } else { - roll = qCeil(roll * 127); - } - - if(yaw < 0) { - yaw = qFloor(yaw * 127); - } else { - yaw = qCeil(yaw * 127); - } + pitch = (pitch < 0) ? qFloor(pitch * 127) : qCeil(pitch * 127); + roll = (roll < 0) ? qFloor(roll * 127) : qCeil(roll * 127); + yaw = (yaw < 0) ? qFloor(yaw * 127) : qCeil(yaw * 127); setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_MOTOR); diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index b0858bcbb..1688742d4 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -37,6 +37,7 @@ #include "stabilizationsettings.h" #include "revocalibration.h" #include "accelgyrosettings.h" +#include const qint16 VehicleConfigurationHelper::LEGACY_ESC_FREQUENCE = 50; const qint16 VehicleConfigurationHelper::RAPID_ESC_FREQUENCE = 400; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h index 17b493fb7..1ed1aa576 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h @@ -30,7 +30,6 @@ #include #include -#include #include "vehicleconfigurationsource.h" #include "uavobjectmanager.h" #include "systemsettings.h" From 0edf70d0aa45e3eddf9e359aa993e616822f4920 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Tue, 26 Aug 2014 19:31:08 +0200 Subject: [PATCH 4/7] OP-1422_Tricopter_mixers_settings : Uncrustify --- .../configmultirotorwidget.cpp | 14 ++++++------- .../vehicleconfigurationhelper.cpp | 20 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp index b76efb9f2..3c0be4f77 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp @@ -481,11 +481,11 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) // get motor 2 value for Yaw and Roll channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1; - value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW); + 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); + channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1; + value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL); m_aircraft->mrRollMixLevel->setValue(-qRound(value / 1.27)); } } else if (frameType == "HexaCoax") { @@ -968,11 +968,11 @@ void ConfigMultiRotorWidget::setupQuadMotor(int channel, double pitch, double ro UAVDataObject *mixer = dynamic_cast(getObjectManager()->getObject(QString("MixerSettings"))); Q_ASSERT(mixer); - - //Normalize mixer values, allow a well balanced mixer saved + + // Normalize mixer values, allow a well balanced mixer saved pitch = (pitch < 0) ? qFloor(pitch * 127) : qCeil(pitch * 127); - roll = (roll < 0) ? qFloor(roll * 127) : qCeil(roll * 127); - yaw = (yaw < 0) ? qFloor(yaw * 127) : qCeil(yaw * 127); + roll = (roll < 0) ? qFloor(roll * 127) : qCeil(roll * 127); + yaw = (yaw < 0) ? qFloor(yaw * 127) : qCeil(yaw * 127); setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_MOTOR); diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index 1688742d4..b698164a3 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -442,23 +442,23 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch field->setValue((channels[i].throttle1 * 127) / 100, 0); field->setValue((channels[i].throttle2 * 127) / 100, 1); - //Normalize mixer values, allow a well balanced mixer saved - if(channels[i].roll < 0) { - field->setValue(qFloor((double)(channels[i].roll * 127) / 100), 2); + // Normalize mixer values, allow a well balanced mixer saved + if (channels[i].roll < 0) { + field->setValue(qFloor((double)(channels[i].roll * 127) / 100), 2); } else { - field->setValue(qCeil((double)(channels[i].roll * 127) / 100), 2); + field->setValue(qCeil((double)(channels[i].roll * 127) / 100), 2); } - if(channels[i].pitch < 0) { - field->setValue(qFloor((double)(channels[i].pitch * 127) / 100), 3); + if (channels[i].pitch < 0) { + field->setValue(qFloor((double)(channels[i].pitch * 127) / 100), 3); } else { - field->setValue(qCeil((double)(channels[i].pitch * 127) / 100), 3); + field->setValue(qCeil((double)(channels[i].pitch * 127) / 100), 3); } - if(channels[i].yaw < 0) { - field->setValue(qFloor((double)(channels[i].yaw * 127) / 100), 4); + if (channels[i].yaw < 0) { + field->setValue(qFloor((double)(channels[i].yaw * 127) / 100), 4); } else { - field->setValue(qCeil((double)(channels[i].yaw * 127) / 100), 4); + field->setValue(qCeil((double)(channels[i].yaw * 127) / 100), 4); } } From 4099507bf67043af794611818311e6a9d26a049c Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Wed, 27 Aug 2014 02:24:14 +0200 Subject: [PATCH 5/7] OP-1422_Tricopter_mixers_settings Wizard : Wrong mixer type for servo (was ReversedMotor). M3/M4 bugfix --- .../plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp | 1 - .../src/plugins/setupwizard/vehicleconfigurationhelper.h | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp index 3c0be4f77..0cacb2996 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp @@ -621,7 +621,6 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNW); setComboCurrentIndex(m_aircraft->multiMotorChannelBox2, multi.VTOLMotorNE); setComboCurrentIndex(m_aircraft->multiMotorChannelBox3, multi.VTOLMotorS); - setComboCurrentIndex(m_aircraft->multiMotorChannelBox4, multi.VTOLMotorS); setComboCurrentIndex(m_aircraft->triYawChannelBox, multi.TRIYaw); int channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h index 1ed1aa576..307dd917a 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h @@ -66,7 +66,8 @@ signals: private: static const int MIXER_TYPE_DISABLED = 0; static const int MIXER_TYPE_MOTOR = 1; - static const int MIXER_TYPE_SERVO = 2; + static const int MIXER_TYPE_REVERSABLEMOTOR = 2; + static const int MIXER_TYPE_SERVO = 3; static const float DEFAULT_ENABLED_ACCEL_TAU = 0.1; VehicleConfigurationSource *m_configSource; From f313bef2e582309ba76ccbc6bdcc48b64224f0e3 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Wed, 27 Aug 2014 20:33:11 +0200 Subject: [PATCH 6/7] OP-1422 Tricopter_mixers_settings Store mixing / sliders values on board - Wizard/Config tab. Tricopter Yaw mixing now applies to servo, 100% default. --- .../configmultirotorwidget.cpp | 197 ++---------------- .../vehicleconfigurationhelper.cpp | 54 +++++ shared/uavobjectdefinition/mixersettings.xml | 3 + 3 files changed, 70 insertions(+), 184 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp index 0cacb2996..a066810d5 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp @@ -168,7 +168,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType) m_aircraft->mrRollMixLevel->setValue(100); m_aircraft->mrPitchMixLevel->setValue(100); - setYawMixLevel(50); + setYawMixLevel(100); } else if (frameType == "QuadX" || frameType == "Quad X") { setComboCurrentIndex(m_aircraft->multirotorFrameType, m_aircraft->multirotorFrameType->findText("Quad X")); @@ -367,21 +367,6 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) setComboCurrentIndex(m_aircraft->multiMotorChannelBox3, multi.VTOLMotorS); setComboCurrentIndex(m_aircraft->multiMotorChannelBox4, multi.VTOLMotorW); - // 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)); - - channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1; - value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL); - m_aircraft->mrRollMixLevel->setValue(-qRound(value / 1.27)); - } } else if (frameType == "QuadX") { // Motors 1/2/3/4 are: NW / NE / SE / SW setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNW); @@ -389,20 +374,6 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) setComboCurrentIndex(m_aircraft->multiMotorChannelBox3, multi.VTOLMotorSE); setComboCurrentIndex(m_aircraft->multiMotorChannelBox4, multi.VTOLMotorSW); - // 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)); - - value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL); - m_aircraft->mrRollMixLevel->setValue(qRound(value / 1.27)); - } } else if (frameType == "Hexa") { // Motors 1/2/3 4/5/6 are: N / NE / SE / S / SW / NW setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorN); @@ -412,26 +383,6 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) setComboCurrentIndex(m_aircraft->multiMotorChannelBox5, multi.VTOLMotorSW); setComboCurrentIndex(m_aircraft->multiMotorChannelBox6, multi.VTOLMotorNW); - // Now, read the 1st mixer R/P/Y levels and initialize the mix sliders. - // This assumes that all vectors are identical - if not, the user should use the - // "custom" setting. - - int channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1; - if (channel > -1) { - // get motor 1 value for Pitch - double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH); - m_aircraft->mrPitchMixLevel->setValue(qRound(value / 1.27)); - - // get motor 2 value for Yaw and Roll - channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1; - value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW); - setYawMixLevel(qRound(value / 1.27)); - - // change channels - channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1; - value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL); - m_aircraft->mrRollMixLevel->setValue(-qRound(value / 1.27)); - } } else if (frameType == "HexaX") { // Motors 1/2/3 4/5/6 are: NE / E / SE / SW / W / NW setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNE); @@ -441,25 +392,6 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) setComboCurrentIndex(m_aircraft->multiMotorChannelBox5, multi.VTOLMotorW); setComboCurrentIndex(m_aircraft->multiMotorChannelBox6, multi.VTOLMotorNW); - // Now, read the 1st mixer R/P/Y levels and initialize the mix sliders. - // This assumes that all vectors are identical - if not, the user should use the - // "custom" setting. - - int channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1; - if (channel > -1) { - // get motor 1 value for Pitch - double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH); - m_aircraft->mrPitchMixLevel->setValue(qRound(value / 1.27)); - - // get motor 2 value for Yaw and Roll - channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1; - value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW); - setYawMixLevel(qRound(value / 1.27)); - - channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1; - value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL); - m_aircraft->mrRollMixLevel->setValue(-qRound(value / 1.27)); - } } else if (frameType == "HexaH") { // Motors 1/2/3 4/5/6 are: NE / E / SE / SW / W / NW setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNE); @@ -469,25 +401,6 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) setComboCurrentIndex(m_aircraft->multiMotorChannelBox5, multi.VTOLMotorW); setComboCurrentIndex(m_aircraft->multiMotorChannelBox6, multi.VTOLMotorNW); - // Now, read the 1st mixer R/P/Y levels and initialize the mix sliders. - // This assumes that all vectors are identical - if not, the user should use the - // "custom" setting. - - int channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1; - if (channel > -1) { - // get motor 1 value for Pitch - double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH); - m_aircraft->mrPitchMixLevel->setValue(qRound(value / 1.27)); - - // get motor 2 value for Yaw and Roll - channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1; - value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW); - setYawMixLevel(qRound(value / 1.27)); - - channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1; - value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL); - m_aircraft->mrRollMixLevel->setValue(-qRound(value / 1.27)); - } } else if (frameType == "HexaCoax") { // Motors 1/2/3 4/5/6 are: NW/W NE/E S/SE setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNW); @@ -497,21 +410,6 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) setComboCurrentIndex(m_aircraft->multiMotorChannelBox5, multi.VTOLMotorS); setComboCurrentIndex(m_aircraft->multiMotorChannelBox6, multi.VTOLMotorSE); - // 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(2 * value / 1.27)); - - channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1; - value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW); - setYawMixLevel(qRound(value / 1.27)); - - value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL); - m_aircraft->mrRollMixLevel->setValue(qRound(value / 1.27)); - } } else if (frameType == "Octo" || frameType == "OctoV" || frameType == "OctoCoaxP") { // Motors 1 to 8 are N / NE / E / etc setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorN); @@ -523,46 +421,6 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) setComboCurrentIndex(m_aircraft->multiMotorChannelBox7, multi.VTOLMotorW); setComboCurrentIndex(m_aircraft->multiMotorChannelBox8, 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) { - if (frameType == "Octo") { - 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 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") { - 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)); - - // change channels - channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1; - value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL); - m_aircraft->mrRollMixLevel->setValue(-qRound(value / 1.27)); - } else if (frameType == "OctoCoaxP") { - 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)); - - // change channels - channel = m_aircraft->multiMotorChannelBox3->currentIndex() - 1; - value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL); - 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); @@ -574,23 +432,6 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) 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); @@ -602,36 +443,18 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) setComboCurrentIndex(m_aircraft->multiMotorChannelBox7, multi.VTOLMotorSW); setComboCurrentIndex(m_aircraft->multiMotorChannelBox8, multi.VTOLMotorW); - // 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)); - - value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL); - m_aircraft->mrRollMixLevel->setValue(qRound(value / 1.27)); - } } else if (frameType == "Tri") { // Motors 1 to 8 are N / NE / E / etc setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNW); setComboCurrentIndex(m_aircraft->multiMotorChannelBox2, multi.VTOLMotorNE); setComboCurrentIndex(m_aircraft->multiMotorChannelBox3, multi.VTOLMotorS); setComboCurrentIndex(m_aircraft->triYawChannelBox, multi.TRIYaw); - - int channel = m_aircraft->multiMotorChannelBox1->currentIndex() - 1; - if (channel > -1) { - double value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH); - m_aircraft->mrPitchMixLevel->setValue(qRound(2 * value / 1.27)); - - value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL); - m_aircraft->mrRollMixLevel->setValue(qRound(value / 1.27)); - } } + + // Now, read mixing values stored on board and applies values on sliders. + m_aircraft->mrPitchMixLevel->setValue(getMixerValue(mixer, "MixerValuePitch")); + m_aircraft->mrRollMixLevel->setValue(getMixerValue(mixer, "MixerValueRoll")); + m_aircraft->mrYawMixLevel->setValue(getMixerValue(mixer, "MixerValueYaw")); updateAirframe(frameType); } @@ -889,7 +712,9 @@ QString ConfigMultiRotorWidget::updateConfigObjectsFromWidgets() int channel = m_aircraft->triYawChannelBox->currentIndex() - 1; if (channel > -1) { setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_SERVO); - setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW, 127); + + // Tricopter : Yaw mix slider value applies to servo (was fixed) + setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW, getMixerValue(mixer, "MixerValueYaw") * 1.27); } m_aircraft->mrStatusLabel->setText(tr("Configuration OK")); @@ -1188,6 +1013,10 @@ bool ConfigMultiRotorWidget::setupMultiRotorMixer(double mixerFactors[8][3]) invertMotors = m_aircraft->MultirotorRevMixerCheckBox->isChecked(); double yFactor = (invertMotors ? -1.0 : 1.0) * (double)m_aircraft->mrYawMixLevel->value() / 100.0; + setMixerValue(mixer, "MixerValueRoll", m_aircraft->mrRollMixLevel->value()); + setMixerValue(mixer, "MixerValuePitch", m_aircraft->mrPitchMixLevel->value()); + setMixerValue(mixer, "MixerValueYaw", m_aircraft->mrYawMixLevel->value()); + QList mmList; mmList << m_aircraft->multiMotorChannelBox1 << m_aircraft->multiMotorChannelBox2 << m_aircraft->multiMotorChannelBox3 << m_aircraft->multiMotorChannelBox4 diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index b698164a3..2e4734831 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -462,6 +462,60 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch } } + MixerSettings *mixSettings = MixerSettings::GetInstance(m_uavoManager); + + // Save mixer values for sliders + switch (m_configSource->getVehicleType()) { + case VehicleConfigurationSource::VEHICLE_MULTI: + { + switch (m_configSource->getVehicleSubType()) { + case VehicleConfigurationSource::MULTI_ROTOR_TRI_Y: + case VehicleConfigurationSource::MULTI_ROTOR_HEXA: + case VehicleConfigurationSource::MULTI_ROTOR_HEXA_H: + case VehicleConfigurationSource::MULTI_ROTOR_HEXA_X: + mixSettings->setMixerValueRoll(100); + mixSettings->setMixerValuePitch(100); + mixSettings->setMixerValueYaw(100); + break; + case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X: + mixSettings->setMixerValueRoll(50); + mixSettings->setMixerValuePitch(50); + mixSettings->setMixerValueYaw(50); + break; + case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS: + mixSettings->setMixerValueRoll(100); + mixSettings->setMixerValuePitch(100); + mixSettings->setMixerValueYaw(50); + break; + case VehicleConfigurationSource::MULTI_ROTOR_HEXA_COAX_Y: + mixSettings->setMixerValueRoll(100); + mixSettings->setMixerValuePitch(50); + mixSettings->setMixerValueYaw(66); + break; + case VehicleConfigurationSource::MULTI_ROTOR_OCTO: + case VehicleConfigurationSource::MULTI_ROTOR_OCTO_X: + mixSettings->setMixerValueRoll(100); + mixSettings->setMixerValuePitch(100); + mixSettings->setMixerValueYaw(100); + break; + case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_X: + case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_PLUS: + case VehicleConfigurationSource::MULTI_ROTOR_OCTO_V: + break; + default: + break; + } + break; + } + case VehicleConfigurationSource::VEHICLE_FIXEDWING: + case VehicleConfigurationSource::VEHICLE_HELI: + case VehicleConfigurationSource::VEHICLE_SURFACE: + // TODO: Implement mixer / sliders settings for other vehicle types? + break; + default: + break; + } + // Apply updates mSettings->setData(mSettings->getData()); addModifiedObject(mSettings, tr("Writing mixer settings")); diff --git a/shared/uavobjectdefinition/mixersettings.xml b/shared/uavobjectdefinition/mixersettings.xml index 16143bf2d..5bfff7e12 100644 --- a/shared/uavobjectdefinition/mixersettings.xml +++ b/shared/uavobjectdefinition/mixersettings.xml @@ -2,6 +2,9 @@ Settings for the @ref ActuatorModule that controls the channel assignments for the mixer based on AircraftType + + + From 9857ef56dd52d5560e2d298c4ada86bcdbebb2f5 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Wed, 27 Aug 2014 20:38:04 +0200 Subject: [PATCH 7/7] OP-1422 Tricopter_mixers_settings : Uncrustify ! --- .../configmultirotorwidget.cpp | 11 +-- .../vehicleconfigurationhelper.cpp | 78 +++++++++---------- 2 files changed, 40 insertions(+), 49 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp index a066810d5..e1189d79d 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configmultirotorwidget.cpp @@ -366,14 +366,12 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) setComboCurrentIndex(m_aircraft->multiMotorChannelBox2, multi.VTOLMotorE); setComboCurrentIndex(m_aircraft->multiMotorChannelBox3, multi.VTOLMotorS); setComboCurrentIndex(m_aircraft->multiMotorChannelBox4, multi.VTOLMotorW); - } else if (frameType == "QuadX") { // Motors 1/2/3/4 are: NW / NE / SE / SW setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNW); setComboCurrentIndex(m_aircraft->multiMotorChannelBox2, multi.VTOLMotorNE); setComboCurrentIndex(m_aircraft->multiMotorChannelBox3, multi.VTOLMotorSE); setComboCurrentIndex(m_aircraft->multiMotorChannelBox4, multi.VTOLMotorSW); - } else if (frameType == "Hexa") { // Motors 1/2/3 4/5/6 are: N / NE / SE / S / SW / NW setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorN); @@ -382,7 +380,6 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) setComboCurrentIndex(m_aircraft->multiMotorChannelBox4, multi.VTOLMotorS); setComboCurrentIndex(m_aircraft->multiMotorChannelBox5, multi.VTOLMotorSW); setComboCurrentIndex(m_aircraft->multiMotorChannelBox6, multi.VTOLMotorNW); - } else if (frameType == "HexaX") { // Motors 1/2/3 4/5/6 are: NE / E / SE / SW / W / NW setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNE); @@ -391,7 +388,6 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) setComboCurrentIndex(m_aircraft->multiMotorChannelBox4, multi.VTOLMotorSW); setComboCurrentIndex(m_aircraft->multiMotorChannelBox5, multi.VTOLMotorW); setComboCurrentIndex(m_aircraft->multiMotorChannelBox6, multi.VTOLMotorNW); - } else if (frameType == "HexaH") { // Motors 1/2/3 4/5/6 are: NE / E / SE / SW / W / NW setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNE); @@ -400,7 +396,6 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) setComboCurrentIndex(m_aircraft->multiMotorChannelBox4, multi.VTOLMotorSW); setComboCurrentIndex(m_aircraft->multiMotorChannelBox5, multi.VTOLMotorW); setComboCurrentIndex(m_aircraft->multiMotorChannelBox6, multi.VTOLMotorNW); - } else if (frameType == "HexaCoax") { // Motors 1/2/3 4/5/6 are: NW/W NE/E S/SE setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNW); @@ -409,7 +404,6 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) setComboCurrentIndex(m_aircraft->multiMotorChannelBox4, multi.VTOLMotorE); setComboCurrentIndex(m_aircraft->multiMotorChannelBox5, multi.VTOLMotorS); setComboCurrentIndex(m_aircraft->multiMotorChannelBox6, multi.VTOLMotorSE); - } else if (frameType == "Octo" || frameType == "OctoV" || frameType == "OctoCoaxP") { // Motors 1 to 8 are N / NE / E / etc setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorN); @@ -420,7 +414,6 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) setComboCurrentIndex(m_aircraft->multiMotorChannelBox6, multi.VTOLMotorSW); setComboCurrentIndex(m_aircraft->multiMotorChannelBox7, multi.VTOLMotorW); setComboCurrentIndex(m_aircraft->multiMotorChannelBox8, multi.VTOLMotorNW); - } else if (frameType == "OctoX") { // Motors 1 to 8 are NNE / ENE / ESE / etc setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNNE); @@ -431,7 +424,6 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) setComboCurrentIndex(m_aircraft->multiMotorChannelBox6, multi.VTOLMotorWSW); setComboCurrentIndex(m_aircraft->multiMotorChannelBox7, multi.VTOLMotorWNW); setComboCurrentIndex(m_aircraft->multiMotorChannelBox8, multi.VTOLMotorNNW); - } else if (frameType == "OctoCoaxX") { // Motors 1 to 8 are N / NE / E / etc setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNW); @@ -442,7 +434,6 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) setComboCurrentIndex(m_aircraft->multiMotorChannelBox6, multi.VTOLMotorS); setComboCurrentIndex(m_aircraft->multiMotorChannelBox7, multi.VTOLMotorSW); setComboCurrentIndex(m_aircraft->multiMotorChannelBox8, multi.VTOLMotorW); - } else if (frameType == "Tri") { // Motors 1 to 8 are N / NE / E / etc setComboCurrentIndex(m_aircraft->multiMotorChannelBox1, multi.VTOLMotorNW); @@ -450,7 +441,7 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType) setComboCurrentIndex(m_aircraft->multiMotorChannelBox3, multi.VTOLMotorS); setComboCurrentIndex(m_aircraft->triYawChannelBox, multi.TRIYaw); } - + // Now, read mixing values stored on board and applies values on sliders. m_aircraft->mrPitchMixLevel->setValue(getMixerValue(mixer, "MixerValuePitch")); m_aircraft->mrRollMixLevel->setValue(getMixerValue(mixer, "MixerValueRoll")); diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index 2e4734831..4fd26406e 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -466,45 +466,45 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch // Save mixer values for sliders switch (m_configSource->getVehicleType()) { - case VehicleConfigurationSource::VEHICLE_MULTI: - { - switch (m_configSource->getVehicleSubType()) { - case VehicleConfigurationSource::MULTI_ROTOR_TRI_Y: - case VehicleConfigurationSource::MULTI_ROTOR_HEXA: - case VehicleConfigurationSource::MULTI_ROTOR_HEXA_H: - case VehicleConfigurationSource::MULTI_ROTOR_HEXA_X: - mixSettings->setMixerValueRoll(100); - mixSettings->setMixerValuePitch(100); - mixSettings->setMixerValueYaw(100); - break; - case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X: - mixSettings->setMixerValueRoll(50); - mixSettings->setMixerValuePitch(50); - mixSettings->setMixerValueYaw(50); - break; - case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS: - mixSettings->setMixerValueRoll(100); - mixSettings->setMixerValuePitch(100); - mixSettings->setMixerValueYaw(50); - break; - case VehicleConfigurationSource::MULTI_ROTOR_HEXA_COAX_Y: - mixSettings->setMixerValueRoll(100); - mixSettings->setMixerValuePitch(50); - mixSettings->setMixerValueYaw(66); - break; - case VehicleConfigurationSource::MULTI_ROTOR_OCTO: - case VehicleConfigurationSource::MULTI_ROTOR_OCTO_X: - mixSettings->setMixerValueRoll(100); - mixSettings->setMixerValuePitch(100); - mixSettings->setMixerValueYaw(100); - break; - case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_X: - case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_PLUS: - case VehicleConfigurationSource::MULTI_ROTOR_OCTO_V: - break; - default: - break; - } + case VehicleConfigurationSource::VEHICLE_MULTI: + { + switch (m_configSource->getVehicleSubType()) { + case VehicleConfigurationSource::MULTI_ROTOR_TRI_Y: + case VehicleConfigurationSource::MULTI_ROTOR_HEXA: + case VehicleConfigurationSource::MULTI_ROTOR_HEXA_H: + case VehicleConfigurationSource::MULTI_ROTOR_HEXA_X: + mixSettings->setMixerValueRoll(100); + mixSettings->setMixerValuePitch(100); + mixSettings->setMixerValueYaw(100); + break; + case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X: + mixSettings->setMixerValueRoll(50); + mixSettings->setMixerValuePitch(50); + mixSettings->setMixerValueYaw(50); + break; + case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS: + mixSettings->setMixerValueRoll(100); + mixSettings->setMixerValuePitch(100); + mixSettings->setMixerValueYaw(50); + break; + case VehicleConfigurationSource::MULTI_ROTOR_HEXA_COAX_Y: + mixSettings->setMixerValueRoll(100); + mixSettings->setMixerValuePitch(50); + mixSettings->setMixerValueYaw(66); + break; + case VehicleConfigurationSource::MULTI_ROTOR_OCTO: + case VehicleConfigurationSource::MULTI_ROTOR_OCTO_X: + mixSettings->setMixerValueRoll(100); + mixSettings->setMixerValuePitch(100); + mixSettings->setMixerValueYaw(100); + break; + case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_X: + case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_PLUS: + case VehicleConfigurationSource::MULTI_ROTOR_OCTO_V: + break; + default: + break; + } break; } case VehicleConfigurationSource::VEHICLE_FIXEDWING: