From 65201ec81cdac34b968cb47d4063d8b7f24ec07a Mon Sep 17 00:00:00 2001 From: elafargue Date: Mon, 16 May 2011 20:03:41 +0200 Subject: [PATCH 1/5] Improve Uploader gadget widget behaviour when clicking on halt & boot (prevent double clicking) --- ground/openpilotgcs/src/plugins/uploader/op_dfu.cpp | 2 +- .../src/plugins/uploader/uploadergadgetwidget.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/uploader/op_dfu.cpp b/ground/openpilotgcs/src/plugins/uploader/op_dfu.cpp index efd7aa87d..a3fe178c6 100644 --- a/ground/openpilotgcs/src/plugins/uploader/op_dfu.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/op_dfu.cpp @@ -100,7 +100,7 @@ DFUObject::DFUObject(bool _debug,bool _use_serial,QString portname): if (devices.length()==1) { hidHandle.open(1,devices.first().vendorID,devices.first().productID,0,0); } else { - qDebug() << "More than one device, don't know what to do!"; + qDebug() << devices.length() << " device(s) detected, don't know what to do!"; mready = false; } diff --git a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp index 8163d3968..52f91066e 100755 --- a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp @@ -161,6 +161,7 @@ void UploaderGadgetWidget::goToBootloader(UAVObject* callerObj, bool success) switch (currentStep) { case IAP_STATE_READY: + m_config->haltButton->setEnabled(false); getSerialPorts(); // Useful in case a new serial port appeared since the initial list, // otherwise we won't find it when we stop the board. // The board is running, send the 1st IAP Reset order: @@ -179,6 +180,7 @@ void UploaderGadgetWidget::goToBootloader(UAVObject* callerObj, bool success) log("Reset did NOT happen"); currentStep = IAP_STATE_READY; disconnect(fwIAP, SIGNAL(transactionCompleted(UAVObject*,bool)),this,SLOT(goToBootloader(UAVObject*, bool))); + m_config->haltButton->setEnabled(true); break; } delay::msleep(600); @@ -193,6 +195,7 @@ void UploaderGadgetWidget::goToBootloader(UAVObject* callerObj, bool success) log("Reset did NOT happen"); currentStep = IAP_STATE_READY; disconnect(fwIAP, SIGNAL(transactionCompleted(UAVObject*,bool)),this,SLOT(goToBootloader(UAVObject*, bool))); + m_config->haltButton->setEnabled(true); break; } delay::msleep(600); @@ -208,6 +211,7 @@ void UploaderGadgetWidget::goToBootloader(UAVObject* callerObj, bool success) log("Oops, failure step 3"); log("Reset did NOT happen"); disconnect(fwIAP, SIGNAL(transactionCompleted(UAVObject*,bool)),this,SLOT(goToBootloader(UAVObject*, bool))); + m_config->haltButton->setEnabled(true); break; } @@ -247,6 +251,7 @@ void UploaderGadgetWidget::goToBootloader(UAVObject* callerObj, bool success) cm->resumePolling(); currentStep = IAP_STATE_READY; m_config->boardStatus->setText("Bootloader?"); + m_config->haltButton->setEnabled(true); return; } dfu->AbortOperation(); @@ -353,7 +358,6 @@ void UploaderGadgetWidget::systemBoot() log("Could not enter DFU mode."); delete dfu; dfu = NULL; - m_config->bootButton->setEnabled(true); return; } log("Booting system..."); From 3129c10d057c10f99ee22a72ce221574d493df29 Mon Sep 17 00:00:00 2001 From: elafargue Date: Mon, 16 May 2011 20:09:51 +0200 Subject: [PATCH 2/5] Bugfix (uploader gadget) --- .../openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp index 52f91066e..d9823a36c 100755 --- a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp @@ -358,13 +358,13 @@ void UploaderGadgetWidget::systemBoot() log("Could not enter DFU mode."); delete dfu; dfu = NULL; + m_config->bootButton->setEnabled(true); return; } log("Booting system..."); dfu->JumpToApp(); // Restart the polling thread cm->resumePolling(); - m_config->bootButton->setEnabled(true); m_config->rescueButton->setEnabled(true); m_config->telemetryLink->setEnabled(true); m_config->boardStatus->setText("Running"); From 5f328037635709e0d34d9e06512dddf9fa01dd23 Mon Sep 17 00:00:00 2001 From: dankers Date: Tue, 17 May 2011 04:15:28 +1000 Subject: [PATCH 3/5] Changed accelKp = 1; in 3C filter when calibrating bias when arming. Increase default yaw by 0.005 --- flight/Modules/Attitude/attitude.c | 1 + shared/uavobjectdefinition/stabilizationsettings.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/flight/Modules/Attitude/attitude.c b/flight/Modules/Attitude/attitude.c index f4c892466..d05ae1152 100644 --- a/flight/Modules/Attitude/attitude.c +++ b/flight/Modules/Attitude/attitude.c @@ -152,6 +152,7 @@ static void AttitudeTask(void *parameters) init = 0; } else if (zero_during_arming && (flightStatus.Armed == FLIGHTSTATUS_ARMED_ARMING)) { + accelKp = 1; accelKi = 0.9; yawBiasRate = 0.23; init = 0; diff --git a/shared/uavobjectdefinition/stabilizationsettings.xml b/shared/uavobjectdefinition/stabilizationsettings.xml index 80c2968f8..991673d14 100644 --- a/shared/uavobjectdefinition/stabilizationsettings.xml +++ b/shared/uavobjectdefinition/stabilizationsettings.xml @@ -9,7 +9,7 @@ - + From 98f286a682b6cf649fbaf1ab2a3057d13c41757f Mon Sep 17 00:00:00 2001 From: elafargue Date: Mon, 16 May 2011 22:05:33 +0200 Subject: [PATCH 4/5] Uploader gadget improvements --- ground/openpilotgcs/src/plugins/uploader/devicewidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ground/openpilotgcs/src/plugins/uploader/devicewidget.cpp b/ground/openpilotgcs/src/plugins/uploader/devicewidget.cpp index 771bb5241..d892c6f7a 100644 --- a/ground/openpilotgcs/src/plugins/uploader/devicewidget.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/devicewidget.cpp @@ -268,6 +268,10 @@ void deviceWidget::uploadFirmware() if (firmwareBoard != board) { status("Error: firmware does not match board", STATUSICON_FAIL); return; + } else { + // Not a structured description: warn user + myDevice->buildDate->setText("Warning: development firmware"); + myDevice->commitTag->setText(""); } // Check the firmware embedded in the file: From b2587a5b9f241bc30e3ea3c18bbcf939d2657d8e Mon Sep 17 00:00:00 2001 From: elafargue Date: Tue, 17 May 2011 00:34:25 +0200 Subject: [PATCH 5/5] Improvement & bugfix: now the output config tab in the config gadget only shows the channel assignments as labels, not dropdowns, and more importantly does not try to save them when clicking on save/apply! --- .../src/plugins/config/configoutputwidget.cpp | 86 ++--- .../openpilotgcs/src/plugins/config/output.ui | 311 ++++++++---------- 2 files changed, 155 insertions(+), 242 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp index 5ef3daf72..9cce0171e 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp @@ -103,7 +103,8 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren << m_config->ch6Link << m_config->ch7Link; - UAVDataObject * obj = dynamic_cast(objManager->getObject(QString("ActuatorSettings"))); +/* + UAVDataObject * obj = dynamic_cast(objManager->getObject(QString("ActuatorSettings"))); QList fieldList = obj->getFields(); foreach (UAVObjectField* field, fieldList) { if (field->getUnits().contains("channel")) { @@ -117,6 +118,7 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren m_config->ch7Output->addItem(field->getName()); } } + */ for (int i = 0; i < 8; i++) { @@ -292,7 +294,7 @@ void ConfigOutputWidget::runChannelTests(bool state) } /** - * Set the dropdown option for a channel output assignement + * Set the label for a channel output assignement */ void ConfigOutputWidget::assignOutputChannel(UAVDataObject *obj, QString str) { @@ -300,28 +302,28 @@ void ConfigOutputWidget::assignOutputChannel(UAVDataObject *obj, QString str) QStringList options = field->getOptions(); switch (options.indexOf(field->getValue().toString())) { case 0: - m_config->ch0Output->setCurrentIndex(m_config->ch0Output->findText(str)); + m_config->ch0Output->setText(str); break; case 1: - m_config->ch1Output->setCurrentIndex(m_config->ch1Output->findText(str)); + m_config->ch1Output->setText(str); break; case 2: - m_config->ch2Output->setCurrentIndex(m_config->ch2Output->findText(str)); + m_config->ch2Output->setText(str); break; case 3: - m_config->ch3Output->setCurrentIndex(m_config->ch3Output->findText(str)); + m_config->ch3Output->setText(str); break; case 4: - m_config->ch4Output->setCurrentIndex(m_config->ch4Output->findText(str)); + m_config->ch4Output->setText(str); break; case 5: - m_config->ch5Output->setCurrentIndex(m_config->ch5Output->findText(str)); + m_config->ch5Output->setText(str); break; case 6: - m_config->ch6Output->setCurrentIndex(m_config->ch6Output->findText(str)); + m_config->ch6Output->setText(str); break; case 7: - m_config->ch7Output->setCurrentIndex(m_config->ch7Output->findText(str)); + m_config->ch7Output->setText(str); break; } } @@ -405,14 +407,14 @@ void ConfigOutputWidget::requestRCOutputUpdate() UAVObjectManager *objManager = pm->getObject(); // Reset all channel assignements: - m_config->ch0Output->setCurrentIndex(0); - m_config->ch1Output->setCurrentIndex(0); - m_config->ch2Output->setCurrentIndex(0); - m_config->ch3Output->setCurrentIndex(0); - m_config->ch4Output->setCurrentIndex(0); - m_config->ch5Output->setCurrentIndex(0); - m_config->ch6Output->setCurrentIndex(0); - m_config->ch7Output->setCurrentIndex(0); + m_config->ch0Output->setText("-"); + m_config->ch1Output->setText("-"); + m_config->ch2Output->setText("-"); + m_config->ch3Output->setText("-"); + m_config->ch4Output->setText("-"); + m_config->ch5Output->setText("-"); + m_config->ch6Output->setText("-"); + m_config->ch7Output->setText("-"); // Get the channel assignements: UAVDataObject * obj = dynamic_cast(objManager->getObject(QString("ActuatorSettings"))); @@ -525,57 +527,9 @@ void ConfigOutputWidget::sendRCOutputUpdate() field->setValue(m_config->outputRate3->value(),2); field->setValue(m_config->outputRate4->value(),3); - // Set Actuator assignement for each channel: - // Rule: if two channels have the same setting (which is wrong!) the higher channel - // will get the setting. - - // First, reset all channel assignements: - QList fieldList = obj->getFields(); - foreach (UAVObjectField* field, fieldList) { - // NOTE: we assume that all options in ActuatorSettings are a channel assignement - // except for the options called "ChannelXXX" - if (field->getUnits().contains("channel")) { - field->setValue(field->getOptions().last()); - } - } - - if (m_config->ch0Output->currentIndex() != 0) { - field = obj->getField(m_config->ch0Output->currentText()); - field->setValue(field->getOptions().at(0)); // -> This way we don't depend on channel naming convention - } - if (m_config->ch1Output->currentIndex() != 0) { - field = obj->getField(m_config->ch1Output->currentText()); - field->setValue(field->getOptions().at(1)); // -> This way we don't depend on channel naming convention - } - if (m_config->ch2Output->currentIndex() != 0) { - field = obj->getField(m_config->ch2Output->currentText()); - field->setValue(field->getOptions().at(2)); // -> This way we don't depend on channel naming convention - } - if (m_config->ch3Output->currentIndex() != 0) { - field = obj->getField(m_config->ch3Output->currentText()); - field->setValue(field->getOptions().at(3)); // -> This way we don't depend on channel naming convention - } - if (m_config->ch4Output->currentIndex() != 0) { - field = obj->getField(m_config->ch4Output->currentText()); - field->setValue(field->getOptions().at(4)); // -> This way we don't depend on channel naming convention - } - if (m_config->ch5Output->currentIndex() != 0) { - field = obj->getField(m_config->ch5Output->currentText()); - field->setValue(field->getOptions().at(5)); // -> This way we don't depend on channel naming convention - } - if (m_config->ch6Output->currentIndex() != 0) { - field = obj->getField(m_config->ch6Output->currentText()); - field->setValue(field->getOptions().at(6)); // -> This way we don't depend on channel naming convention - } - if (m_config->ch7Output->currentIndex() != 0) { - field = obj->getField(m_config->ch7Output->currentText()); - field->setValue(field->getOptions().at(7)); // -> This way we don't depend on channel naming convention - } - // ... and send to the OP Board obj->updated(); - } diff --git a/ground/openpilotgcs/src/plugins/config/output.ui b/ground/openpilotgcs/src/plugins/config/output.ui index db63ba4c7..7a0257daf 100644 --- a/ground/openpilotgcs/src/plugins/config/output.ui +++ b/ground/openpilotgcs/src/plugins/config/output.ui @@ -162,27 +162,7 @@ Leave at 50Hz for fixed wing. - Channel 1 - - - - - - - false - - - - 8 - - - - <!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:'Ubuntu'; font-size:8pt; font-weight:400; font-style:normal;"> -<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:'Sans';">This is the actuator connected to this channel.</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:'Sans';">You can change this through the &quot;Airframe&quot; dialog (on the left).</span></p></body></html> + Channel 1: @@ -300,27 +280,7 @@ p, li { white-space: pre-wrap; } - Channel 2 - - - - - - - false - - - - 8 - - - - <!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:'Ubuntu'; font-size:8pt; font-weight:400; font-style:normal;"> -<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:'Sans';">This is the actuator connected to this channel.</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:'Sans';">You can change this through the &quot;Airframe&quot; dialog (on the left).</span></p></body></html> + Channel 2: @@ -407,27 +367,7 @@ p, li { white-space: pre-wrap; } - Channel 3 - - - - - - - false - - - - 8 - - - - <!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:'Ubuntu'; font-size:8pt; font-weight:400; font-style:normal;"> -<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:'Sans';">This is the actuator connected to this channel.</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:'Sans';">You can change this through the &quot;Airframe&quot; dialog (on the left).</span></p></body></html> + Channel 3: @@ -514,27 +454,7 @@ p, li { white-space: pre-wrap; } - Channel 4 - - - - - - - false - - - - 8 - - - - <!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:'Ubuntu'; font-size:8pt; font-weight:400; font-style:normal;"> -<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:'Sans';">This is the actuator connected to this channel.</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:'Sans';">You can change this through the &quot;Airframe&quot; dialog (on the left).</span></p></body></html> + Channel 4: @@ -621,27 +541,7 @@ p, li { white-space: pre-wrap; } - Channel 5 - - - - - - - false - - - - 8 - - - - <!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:'Ubuntu'; font-size:8pt; font-weight:400; font-style:normal;"> -<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:'Sans';">This is the actuator connected to this channel.</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:'Sans';">You can change this through the &quot;Airframe&quot; dialog (on the left).</span></p></body></html> + Channel 5: @@ -719,27 +619,7 @@ p, li { white-space: pre-wrap; } - Channel 6 - - - - - - - false - - - - 8 - - - - <!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:'Ubuntu'; font-size:8pt; font-weight:400; font-style:normal;"> -<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:'Sans';">This is the actuator connected to this channel.</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:'Sans';">You can change this through the &quot;Airframe&quot; dialog (on the left).</span></p></body></html> + Channel 6: @@ -817,54 +697,14 @@ p, li { white-space: pre-wrap; } - Channel 7 - - - - - - - false - - - - 8 - - - - <!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:'Ubuntu'; font-size:8pt; font-weight:400; font-style:normal;"> -<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:'Sans';">This is the actuator connected to this channel.</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:'Sans';">You can change this through the &quot;Airframe&quot; dialog (on the left).</span></p></body></html> + Channel 7: - Channel 8 - - - - - - - false - - - - 8 - - - - <!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:'Ubuntu'; font-size:8pt; font-weight:400; font-style:normal;"> -<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:'Sans';">This is the actuator connected to this channel.</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:'Sans';">You can change this through the &quot;Airframe&quot; dialog (on the left).</span></p></body></html> + Channel 8: @@ -1010,6 +850,133 @@ p, li { white-space: pre-wrap; } + + + + + 9 + + + + - + + + Qt::AlignCenter + + + + + + + + 9 + + + + - + + + Qt::AlignCenter + + + + + + + + 9 + + + + - + + + Qt::AlignCenter + + + + + + + + 9 + + + + - + + + Qt::AlignCenter + + + + + + + + 9 + + + + - + + + Qt::AlignCenter + + + + + + + + 9 + + + + - + + + Qt::AlignCenter + + + + + + + + 9 + + + + - + + + Qt::AlignCenter + + + + + + + + 9 + + + + - + + + Qt::AlignCenter + + + + + + + Assignment + + + @@ -1119,35 +1086,27 @@ Applies and Saves all settings to SD ch6OutMax ch7OutMin ch7OutMax - ch0Output ch0OutSlider ch0Rev ch0Link - ch1Output ch1OutSlider ch1Rev ch1Link - ch2Output ch2OutSlider ch2Rev ch2Link - ch3Output ch3OutSlider ch3Rev ch3Link - ch4Output ch4OutSlider ch4Rev ch4Link - ch5Output ch5OutSlider ch5Rev ch5Link - ch6Output ch6OutSlider ch6Rev ch6Link - ch7Output ch7OutSlider ch7Rev ch7Link