mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
GCS-Yaw mixing level reverse button
Changed the slider values from -100/+100 to 0/100 and wrote the code for the invert checkbox. NOT TESTED
This commit is contained in:
parent
4e1081179b
commit
dc10917f70
@ -1092,7 +1092,7 @@ margin:1px;</string>
|
||||
Typical value is 50% for + or X configuration on quads.</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
|
@ -21,12 +21,12 @@
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>-1</number>
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="Autotune_tabs">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="Preautotune_tab">
|
||||
<attribute name="title">
|
||||
@ -80,17 +80,18 @@
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;">
|
||||
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:20pt; font-weight:600; color:#ff0000;">WARNING:</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">This is an experimental plugin for the GCS that is going to make your aircraft shake etc so test with lots of space and be <span style=" font-weight:600;">very very wary</span> for it creating bad tuning values. Basically there is no reason to think this will work at all.<br /><br />To use autotuning, here are the steps:</p>
|
||||
<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Go to the UAVOBrowser and under HwSettings.OptionalModules enable Autotune. Click send then save. Power cycle your board (disconnect battery AND usb).<br /></li>
|
||||
<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">In Input configuration set one of your flight modes to &quot;Autotune&quot;<br /></li>
|
||||
<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Take off, flip to autotune, keep it in the air while it's shaking<br /></li>
|
||||
<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Land and disarm. (note - you <span style=" font-weight:600;">MUST</span> stay in autotune mode through this point, leaving autotune before disarming aborts the process)<br /></li>
|
||||
<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">We'd recommend checking your stabilization settings before trying them out. <br /></li>
|
||||
<li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Test fly then new settings</li>
|
||||
<li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If you're ready to proceed, click the &quot;Enable Autotune Module&quot; checkbox below this text, and go to the next tab.</li></ul></body></html></string>
|
||||
</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;">
|
||||
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Lucida Grande'; font-size:20pt; font-weight:600; color:#ff0000;">WARNING:</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Lucida Grande'; font-size:13pt;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Lucida Grande'; font-size:13pt;"><br /></span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Lucida Grande'; font-size:13pt;">This is an experimental plugin for the GCS that is going to make your aircraft shake etc so test with lots of space and be </span><span style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:600;">very very wary</span><span style=" font-family:'Lucida Grande'; font-size:13pt;"> for it creating bad tuning values. Basically there is no reason to think this will work at all.<br /><br />To use autotuning, here are the steps:</span></p>
|
||||
<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" font-family:'Lucida Grande'; font-size:13pt;" style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Go to the UAVOBrowser and under HwSettings.OptionalModules enable Autotune. Click send then save. Power cycle your board (disconnect battery AND usb).<br /></li>
|
||||
<li style=" font-family:'Lucida Grande'; font-size:13pt;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">In Input configuration set one of your flight modes to &quot;Autotune&quot;<br /></li>
|
||||
<li style=" font-family:'Lucida Grande'; font-size:13pt;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Take off, flip to autotune, keep it in the air while it's shaking<br /></li>
|
||||
<li style=" font-family:'Lucida Grande'; font-size:13pt;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Land and disarm. (note - you <span style=" font-weight:600;">MUST</span> stay in autotune mode through this point, leaving autotune before disarming aborts the process)<br /></li>
|
||||
<li style=" font-family:'Lucida Grande'; font-size:13pt;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">We'd recommend checking your stabilization settings before trying them out. <br /></li>
|
||||
<li style=" font-family:'Lucida Grande'; font-size:13pt;" style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Test fly then new settings</li>
|
||||
<li style=" font-family:'Lucida Grande'; font-size:13pt;" style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If you're ready to proceed, click the &quot;Enable Autotune Module&quot; checkbox below this text, and go to the next tab.</li></ul></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -194,8 +195,8 @@ p, li { white-space: pre-wrap; }
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>709</width>
|
||||
<height>588</height>
|
||||
<width>717</width>
|
||||
<height>602</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -690,8 +691,6 @@ Useful if you have accidentally changed some settings.</string>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../coreplugin/core.qrc"/>
|
||||
</resources>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -94,7 +94,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
|
||||
m_aircraft->mrRollMixLevel->setValue(100);
|
||||
m_aircraft->mrPitchMixLevel->setValue(100);
|
||||
m_aircraft->mrYawMixLevel->setValue(50);
|
||||
setYawMixLevel(50);
|
||||
|
||||
m_aircraft->triYawChannelBox->setEnabled(true);
|
||||
}
|
||||
@ -108,7 +108,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
// init mixer levels
|
||||
m_aircraft->mrRollMixLevel->setValue(50);
|
||||
m_aircraft->mrPitchMixLevel->setValue(50);
|
||||
m_aircraft->mrYawMixLevel->setValue(50);
|
||||
setYawMixLevel(50);
|
||||
}
|
||||
else if (frameType == "QuadP" || frameType == "Quad +") {
|
||||
setComboCurrentIndex( m_aircraft->multirotorFrameType, m_aircraft->multirotorFrameType->findText("Quad +"));
|
||||
@ -119,7 +119,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
|
||||
m_aircraft->mrRollMixLevel->setValue(100);
|
||||
m_aircraft->mrPitchMixLevel->setValue(100);
|
||||
m_aircraft->mrYawMixLevel->setValue(50);
|
||||
setYawMixLevel(50);
|
||||
}
|
||||
else if (frameType == "Hexa" || frameType == "Hexacopter")
|
||||
{
|
||||
@ -131,7 +131,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
|
||||
m_aircraft->mrRollMixLevel->setValue(50);
|
||||
m_aircraft->mrPitchMixLevel->setValue(33);
|
||||
m_aircraft->mrYawMixLevel->setValue(33);
|
||||
setYawMixLevel(33);
|
||||
}
|
||||
else if (frameType == "HexaX" || frameType == "Hexacopter X" ) {
|
||||
setComboCurrentIndex( m_aircraft->multirotorFrameType, m_aircraft->multirotorFrameType->findText("Hexacopter X"));
|
||||
@ -142,7 +142,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
|
||||
m_aircraft->mrRollMixLevel->setValue(33);
|
||||
m_aircraft->mrPitchMixLevel->setValue(50);
|
||||
m_aircraft->mrYawMixLevel->setValue(33);
|
||||
setYawMixLevel(33);
|
||||
|
||||
}
|
||||
else if (frameType == "HexaCoax" || frameType == "Hexacopter Y6")
|
||||
@ -155,7 +155,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
|
||||
m_aircraft->mrRollMixLevel->setValue(100);
|
||||
m_aircraft->mrPitchMixLevel->setValue(50);
|
||||
m_aircraft->mrYawMixLevel->setValue(66);
|
||||
setYawMixLevel(66);
|
||||
|
||||
}
|
||||
else if (frameType == "Octo" || frameType == "Octocopter")
|
||||
@ -168,7 +168,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
|
||||
m_aircraft->mrRollMixLevel->setValue(33);
|
||||
m_aircraft->mrPitchMixLevel->setValue(33);
|
||||
m_aircraft->mrYawMixLevel->setValue(25);
|
||||
setYawMixLevel(25);
|
||||
}
|
||||
else if (frameType == "OctoV" || frameType == "Octocopter V")
|
||||
{
|
||||
@ -180,7 +180,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
|
||||
m_aircraft->mrRollMixLevel->setValue(25);
|
||||
m_aircraft->mrPitchMixLevel->setValue(25);
|
||||
m_aircraft->mrYawMixLevel->setValue(25);
|
||||
setYawMixLevel(25);
|
||||
|
||||
}
|
||||
else if (frameType == "OctoCoaxP" || frameType == "Octo Coax +")
|
||||
@ -193,7 +193,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
|
||||
m_aircraft->mrRollMixLevel->setValue(100);
|
||||
m_aircraft->mrPitchMixLevel->setValue(100);
|
||||
m_aircraft->mrYawMixLevel->setValue(50);
|
||||
setYawMixLevel(50);
|
||||
|
||||
}
|
||||
else if (frameType == "OctoCoaxX" || frameType == "Octo Coax X")
|
||||
@ -205,7 +205,7 @@ void ConfigMultiRotorWidget::setupUI(QString frameType)
|
||||
|
||||
m_aircraft->mrRollMixLevel->setValue(50);
|
||||
m_aircraft->mrPitchMixLevel->setValue(50);
|
||||
m_aircraft->mrYawMixLevel->setValue(50);
|
||||
setYawMixLevel(50);
|
||||
|
||||
}
|
||||
}
|
||||
@ -259,6 +259,21 @@ QStringList ConfigMultiRotorWidget::getChannelDescriptions()
|
||||
return channelDesc;
|
||||
}
|
||||
|
||||
void ConfigMultiRotorWidget::setYawMixLevel(int value)
|
||||
{
|
||||
if(value<0)
|
||||
{
|
||||
m_aircraft->mrYawMixLevel->setValue((-1)*value);
|
||||
m_aircraft->TricopterRevMixercheckBox->setChecked(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_aircraft->mrYawMixLevel->setValue(value);
|
||||
m_aircraft->TricopterRevMixercheckBox->setChecked(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -500,7 +515,7 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
m_aircraft->mrPitchMixLevel->setValue( value/1.27 );
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
|
||||
m_aircraft->mrYawMixLevel->setValue( 1-value/1.27 );
|
||||
setYawMixLevel( 1-value/1.27 );
|
||||
|
||||
channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1;
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL);
|
||||
@ -526,7 +541,7 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
m_aircraft->mrPitchMixLevel->setValue( value/1.27 );
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
|
||||
m_aircraft->mrYawMixLevel->setValue( 1-value/1.27 );
|
||||
setYawMixLevel( 1-value/1.27 );
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL);
|
||||
m_aircraft->mrRollMixLevel->setValue( value/1.27);
|
||||
@ -556,7 +571,7 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
m_aircraft->mrPitchMixLevel->setValue( floor(value/1.27) );
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
|
||||
m_aircraft->mrYawMixLevel->setValue( floor(-value/1.27) );
|
||||
setYawMixLevel( floor(-value/1.27) );
|
||||
|
||||
//change channels
|
||||
channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1;
|
||||
@ -589,7 +604,7 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
m_aircraft->mrPitchMixLevel->setValue( floor(value/1.27) );
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
|
||||
m_aircraft->mrYawMixLevel->setValue( floor(-value/1.27) );
|
||||
setYawMixLevel( floor(-value/1.27) );
|
||||
|
||||
channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1;
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL);
|
||||
@ -617,7 +632,7 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
m_aircraft->mrPitchMixLevel->setValue( value/1.27 );
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
|
||||
m_aircraft->mrYawMixLevel->setValue( value/1.27 );
|
||||
setYawMixLevel( value/1.27 );
|
||||
|
||||
channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1;
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL);
|
||||
@ -648,7 +663,7 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
m_aircraft->mrPitchMixLevel->setValue( floor(value/1.27) );
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
|
||||
m_aircraft->mrYawMixLevel->setValue( floor(-value/1.27) );
|
||||
setYawMixLevel( floor(-value/1.27) );
|
||||
|
||||
//change channels
|
||||
channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1;
|
||||
@ -660,7 +675,7 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
m_aircraft->mrPitchMixLevel->setValue( floor(value/1.27) );
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
|
||||
m_aircraft->mrYawMixLevel->setValue( floor(-value/1.27) );
|
||||
setYawMixLevel( floor(-value/1.27) );
|
||||
|
||||
//change channels
|
||||
channel = m_aircraft->multiMotorChannelBox2->currentIndex() - 1;
|
||||
@ -672,7 +687,7 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
m_aircraft->mrPitchMixLevel->setValue( floor(value/1.27) );
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
|
||||
m_aircraft->mrYawMixLevel->setValue( floor(-value/1.27) );
|
||||
setYawMixLevel( floor(-value/1.27) );
|
||||
|
||||
//change channels
|
||||
channel = m_aircraft->multiMotorChannelBox3->currentIndex() - 1;
|
||||
@ -705,7 +720,7 @@ void ConfigMultiRotorWidget::refreshWidgetsValues(QString frameType)
|
||||
m_aircraft->mrPitchMixLevel->setValue( floor(value/1.27) );
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW);
|
||||
m_aircraft->mrYawMixLevel->setValue( floor(-value/1.27) );
|
||||
setYawMixLevel( floor(-value/1.27) );
|
||||
|
||||
value = getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL);
|
||||
m_aircraft->mrRollMixLevel->setValue( floor(value/1.27) );
|
||||
@ -959,7 +974,8 @@ bool ConfigMultiRotorWidget::setupMultiRotorMixer(double mixerFactors[8][3])
|
||||
// and enable only the relevant channels:
|
||||
double pFactor = (double)m_aircraft->mrPitchMixLevel->value()/100;
|
||||
double rFactor = (double)m_aircraft->mrRollMixLevel->value()/100;
|
||||
double yFactor = (double)m_aircraft->mrYawMixLevel->value()/100;
|
||||
double invert=m_aircraft->TricopterRevMixercheckBox->isChecked() ? -1:1;
|
||||
double yFactor =invert * (double)m_aircraft->mrYawMixLevel->value()/100;
|
||||
for (int i=0 ; i<8; i++) {
|
||||
if(mmList.at(i)->isEnabled())
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ private:
|
||||
virtual void ResetActuators(GUIConfigDataUnion* configData);
|
||||
static QStringList getChannelDescriptions();
|
||||
static const QString CHANNELBOXNAME;
|
||||
|
||||
void setYawMixLevel(int);
|
||||
private slots:
|
||||
virtual void setupUI(QString airframeType);
|
||||
virtual void refreshWidgetsValues(QString frameType);
|
||||
|
Loading…
Reference in New Issue
Block a user