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/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp index a13ec1236..a534a0a5f 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp @@ -104,7 +104,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")) { @@ -118,6 +119,7 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren m_config->ch7Output->addItem(field->getName()); } } + */ for (int i = 0; i < 8; i++) { @@ -308,7 +310,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) { @@ -316,28 +318,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; } } @@ -421,14 +423,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"))); @@ -541,57 +543,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 79f76c084..95d977cf7 100644 --- a/ground/openpilotgcs/src/plugins/config/output.ui +++ b/ground/openpilotgcs/src/plugins/config/output.ui @@ -6,8 +6,8 @@ 0 0 - 600 - 466 + 659 + 511 @@ -38,7 +38,7 @@ 2 - + false @@ -52,7 +52,7 @@ Leave at 50Hz for fixed wing. - + - @@ -62,7 +62,7 @@ Leave at 50Hz for fixed wing. - + - @@ -72,7 +72,7 @@ Leave at 50Hz for fixed wing. - + - @@ -82,7 +82,7 @@ Leave at 50Hz for fixed wing. - + false @@ -96,7 +96,7 @@ Leave at 50Hz for fixed wing. - + false @@ -110,7 +110,7 @@ Leave at 50Hz for fixed wing. - + false @@ -124,7 +124,7 @@ Leave at 50Hz for fixed wing. - + - @@ -135,7 +135,7 @@ Leave at 50Hz for fixed wing. - + @@ -160,7 +160,7 @@ Leave at 50Hz for fixed wing. - + Qt::Horizontal @@ -176,7 +176,7 @@ Leave at 50Hz for fixed wing. - + 75 @@ -194,9 +194,9 @@ Leave at 50Hz for fixed wing. - + - + Qt::Horizontal @@ -232,45 +232,12 @@ Leave at 50Hz for fixed wing. - - - - Qt::Vertical - - - - 20 - 40 - - - - - 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: @@ -388,27 +355,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: @@ -495,27 +442,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: @@ -602,27 +529,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: @@ -709,27 +616,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: @@ -807,27 +694,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: @@ -905,54 +772,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: @@ -1098,6 +925,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 + + + @@ -1137,7 +1091,7 @@ p, li { white-space: pre-wrap; } - + @@ -1168,6 +1122,19 @@ p, li { white-space: pre-wrap; } + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -1316,35 +1283,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 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: 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..d9823a36c 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(); @@ -360,7 +365,6 @@ void UploaderGadgetWidget::systemBoot() 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"); 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 @@ - +