From dcccae7270b99171d77fcbd25d36564f78e6094c Mon Sep 17 00:00:00 2001 From: zedamota Date: Wed, 8 Jun 2011 18:17:14 +0100 Subject: [PATCH 01/16] Change throttle default max value to 0.95 on multis --- .../plugins/config/configairframewidget.cpp | 38 ++++++++++++++----- .../src/plugins/config/configairframewidget.h | 2 +- shared/uavobjectdefinition/mixersettings.xml | 2 +- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp b/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp index f7b40e72f..e5684b3fd 100644 --- a/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp @@ -358,7 +358,7 @@ void ConfigAirframeWidget::resetFwMixer() { UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("MixerSettings"))); UAVObjectField* field = obj->getField(QString("ThrottleCurve1")); - resetMixer(m_aircraft->fixedWingThrottle, field->getNumElements()); + resetMixer(m_aircraft->fixedWingThrottle, field->getNumElements(),1); } /** @@ -368,7 +368,7 @@ void ConfigAirframeWidget::resetMrMixer() { UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("MixerSettings"))); UAVObjectField* field = obj->getField(QString("ThrottleCurve1")); - resetMixer(m_aircraft->multiThrottleCurve, field->getNumElements()); + resetMixer(m_aircraft->multiThrottleCurve, field->getNumElements(),0.95); } /** @@ -378,7 +378,7 @@ void ConfigAirframeWidget::resetCt1Mixer() { UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("MixerSettings"))); UAVObjectField* field = obj->getField(QString("ThrottleCurve1")); - resetMixer(m_aircraft->customThrottle1Curve, field->getNumElements()); + resetMixer(m_aircraft->customThrottle1Curve, field->getNumElements(),1); } /** @@ -388,18 +388,18 @@ void ConfigAirframeWidget::resetCt2Mixer() { UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("MixerSettings"))); UAVObjectField* field = obj->getField(QString("ThrottleCurve2")); - resetMixer(m_aircraft->customThrottle2Curve, field->getNumElements()); + resetMixer(m_aircraft->customThrottle2Curve, field->getNumElements(),1); } /** Resets a mixer curve */ -void ConfigAirframeWidget::resetMixer(MixerCurveWidget *mixer, int numElements) +void ConfigAirframeWidget::resetMixer(MixerCurveWidget *mixer, int numElements, double maxvalue) { QList curveValues; for (double i=0; iinitCurve(curveValues); @@ -469,19 +469,37 @@ void ConfigAirframeWidget::requestAircraftUpdate() QList curveValues; // If the 1st element of the curve is <= -10, then the curve // is a straight line (that's how the mixer works on the mainboard): + double temp=0; //used to check if default value(all 0s) is being returned if (field->getValue(0).toInt() <= -10) { for (double i=0; igetNumElements(); i++) { curveValues.append(i/(field->getNumElements()-1)); } } else { + double value; for (unsigned int i=0; i < field->getNumElements(); i++) { - curveValues.append(field->getValue(i).toDouble()); + value=field->getValue(i).toDouble(); + temp+=value; + curveValues.append(value); } } // Setup all Throttle1 curves for all types of airframes - m_aircraft->fixedWingThrottle->initCurve(curveValues); - m_aircraft->multiThrottleCurve->initCurve(curveValues); - + if(temp==0) + { curveValues.clear(); + for (double i=0; igetNumElements(); i++) { + curveValues.append(0.95*(i/(field->getNumElements()-1))); + } + m_aircraft->multiThrottleCurve->initCurve(curveValues); + curveValues.clear(); + for (double i=0; igetNumElements(); i++) { + curveValues.append(i/(field->getNumElements()-1)); + } + m_aircraft->fixedWingThrottle->initCurve(curveValues); + } + else + { + m_aircraft->multiThrottleCurve->initCurve(curveValues); + m_aircraft->fixedWingThrottle->initCurve(curveValues); + } // Load the Settings for fixed wing frames: if (frameType.startsWith("FixedWing")) { // Then retrieve how channels are setup diff --git a/ground/openpilotgcs/src/plugins/config/configairframewidget.h b/ground/openpilotgcs/src/plugins/config/configairframewidget.h index 37f6ef877..183b59494 100644 --- a/ground/openpilotgcs/src/plugins/config/configairframewidget.h +++ b/ground/openpilotgcs/src/plugins/config/configairframewidget.h @@ -59,7 +59,7 @@ private: void setupMotors(QList motorList); void resetField(UAVObjectField * field); - void resetMixer (MixerCurveWidget *mixer, int numElements); + void resetMixer (MixerCurveWidget *mixer, int numElements, double maxvalue); void resetActuators(); //void setMixerChannel(int channelNumber, bool channelIsMotor, QList vector); void setupQuadMotor(int channel, double roll, double pitch, double yaw); diff --git a/shared/uavobjectdefinition/mixersettings.xml b/shared/uavobjectdefinition/mixersettings.xml index efe48d090..c8cf455c0 100644 --- a/shared/uavobjectdefinition/mixersettings.xml +++ b/shared/uavobjectdefinition/mixersettings.xml @@ -5,7 +5,7 @@ - + From cac495cebb4f34df51ae5a5a41a690898004afd2 Mon Sep 17 00:00:00 2001 From: zedamota Date: Sat, 11 Jun 2011 19:39:24 +0100 Subject: [PATCH 02/16] Fix custom mixer throttle 1 curve. --- .../src/plugins/config/configairframewidget.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp b/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp index e5684b3fd..d97cb2d77 100644 --- a/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp @@ -471,6 +471,7 @@ void ConfigAirframeWidget::requestAircraftUpdate() // is a straight line (that's how the mixer works on the mainboard): double temp=0; //used to check if default value(all 0s) is being returned if (field->getValue(0).toInt() <= -10) { + double temp=1; for (double i=0; igetNumElements(); i++) { curveValues.append(i/(field->getNumElements()-1)); } @@ -1757,13 +1758,26 @@ void ConfigAirframeWidget::updateCustomAirframeUI() QList curveValues; // If the 1st element of the curve is <= -10, then the curve // is a straight line (that's how the mixer works on the mainboard): + double temp=0; //used to check if default value(all 0s) is being returned if (field->getValue(0).toInt() <= -10) { + double temp=1; for (double i=0; igetNumElements(); i++) { curveValues.append(i/(field->getNumElements()-1)); } } else { + double value; for (unsigned int i=0; i < field->getNumElements(); i++) { - curveValues.append(field->getValue(i).toDouble()); + value=field->getValue(i).toDouble(); + temp+=value; + curveValues.append(value); + } + } + + // Setup all Throttle1 curves for all types of airframes + if(temp==0) + { curveValues.clear(); + for (double i=0; igetNumElements(); i++) { + curveValues.append(1*(i/(field->getNumElements()-1))); } } m_aircraft->customThrottle1Curve->initCurve(curveValues); From 689eb2c588df5d7f17cae1af55eaaa6eb7ce4858 Mon Sep 17 00:00:00 2001 From: zedamota Date: Sun, 12 Jun 2011 00:49:05 +0100 Subject: [PATCH 03/16] Minor Cleaning --- .../plugins/config/configairframewidget.cpp | 72 +++++++------------ .../src/plugins/config/configccpmwidget.cpp | 7 +- .../src/plugins/config/mixercurvewidget.cpp | 12 +++- .../src/plugins/config/mixercurvewidget.h | 1 + 4 files changed, 37 insertions(+), 55 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp b/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp index d97cb2d77..53296f3f5 100644 --- a/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp @@ -397,12 +397,8 @@ void ConfigAirframeWidget::resetCt2Mixer() */ void ConfigAirframeWidget::resetMixer(MixerCurveWidget *mixer, int numElements, double maxvalue) { - QList curveValues; - for (double i=0; iinitCurve(curveValues); + mixer->initLinearCurve((quint32)numElements,maxvalue); } /** @@ -469,38 +465,30 @@ void ConfigAirframeWidget::requestAircraftUpdate() QList curveValues; // If the 1st element of the curve is <= -10, then the curve // is a straight line (that's how the mixer works on the mainboard): - double temp=0; //used to check if default value(all 0s) is being returned if (field->getValue(0).toInt() <= -10) { - double temp=1; - for (double i=0; igetNumElements(); i++) { - curveValues.append(i/(field->getNumElements()-1)); - } - } else { + m_aircraft->multiThrottleCurve->initLinearCurve(field->getNumElements(),(double)1); + m_aircraft->fixedWingThrottle->initLinearCurve(field->getNumElements(),(double)1); + } + else { + double temp=0; double value; for (unsigned int i=0; i < field->getNumElements(); i++) { value=field->getValue(i).toDouble(); temp+=value; curveValues.append(value); } + if(temp==0) + { + m_aircraft->multiThrottleCurve->initLinearCurve(field->getNumElements(),0.95);; + m_aircraft->fixedWingThrottle->initLinearCurve(field->getNumElements(),(double)1); + } + else + { + m_aircraft->multiThrottleCurve->initCurve(curveValues); + m_aircraft->fixedWingThrottle->initCurve(curveValues); + } } // Setup all Throttle1 curves for all types of airframes - if(temp==0) - { curveValues.clear(); - for (double i=0; igetNumElements(); i++) { - curveValues.append(0.95*(i/(field->getNumElements()-1))); - } - m_aircraft->multiThrottleCurve->initCurve(curveValues); - curveValues.clear(); - for (double i=0; igetNumElements(); i++) { - curveValues.append(i/(field->getNumElements()-1)); - } - m_aircraft->fixedWingThrottle->initCurve(curveValues); - } - else - { - m_aircraft->multiThrottleCurve->initCurve(curveValues); - m_aircraft->fixedWingThrottle->initCurve(curveValues); - } // Load the Settings for fixed wing frames: if (frameType.startsWith("FixedWing")) { // Then retrieve how channels are setup @@ -1758,45 +1746,33 @@ void ConfigAirframeWidget::updateCustomAirframeUI() QList curveValues; // If the 1st element of the curve is <= -10, then the curve // is a straight line (that's how the mixer works on the mainboard): - double temp=0; //used to check if default value(all 0s) is being returned if (field->getValue(0).toInt() <= -10) { - double temp=1; - for (double i=0; igetNumElements(); i++) { - curveValues.append(i/(field->getNumElements()-1)); - } + m_aircraft->customThrottle1Curve->initLinearCurve(field->getNumElements(),(double)1); } else { + double temp=0; double value; for (unsigned int i=0; i < field->getNumElements(); i++) { value=field->getValue(i).toDouble(); temp+=value; curveValues.append(value); } + if(temp==0) + m_aircraft->customThrottle1Curve->initLinearCurve(field->getNumElements(),(double)1); + else + m_aircraft->customThrottle1Curve->initCurve(curveValues); } - - // Setup all Throttle1 curves for all types of airframes - if(temp==0) - { curveValues.clear(); - for (double i=0; igetNumElements(); i++) { - curveValues.append(1*(i/(field->getNumElements()-1))); - } - } - m_aircraft->customThrottle1Curve->initCurve(curveValues); - field = obj->getField(QString("ThrottleCurve2")); curveValues.clear();; // If the 1st element of the curve is <= -10, then the curve // is a straight line (that's how the mixer works on the mainboard): if (field->getValue(0).toInt() <= -10) { - for (double i=0; igetNumElements(); i++) { - curveValues.append(i/(field->getNumElements()-1)); - } + m_aircraft->customThrottle2Curve->initLinearCurve(field->getNumElements(),(double)1); } else { for (unsigned int i=0; i < field->getNumElements(); i++) { curveValues.append(field->getValue(i).toDouble()); } + m_aircraft->customThrottle2Curve->initCurve(curveValues); } - m_aircraft->customThrottle2Curve->initCurve(curveValues); - // Retrieve Feed Forward: field = obj->getField(QString("FeedForward")); m_aircraft->customFFSlider->setValue(field->getDouble()*100); diff --git a/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp b/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp index bd4239159..84564c14b 100644 --- a/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp @@ -372,12 +372,7 @@ void ConfigccpmWidget::UpdateType() */ void ConfigccpmWidget::resetMixer(MixerCurveWidget *mixer, int numElements) { - QList curveValues; - for (double i=0; iinitCurve(curveValues); + mixer->initLinearCurve(numElements,(double)1); } void ConfigccpmWidget::UpdateCurveWidgets() diff --git a/ground/openpilotgcs/src/plugins/config/mixercurvewidget.cpp b/ground/openpilotgcs/src/plugins/config/mixercurvewidget.cpp index 2acf5babd..6e031d8d7 100644 --- a/ground/openpilotgcs/src/plugins/config/mixercurvewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/mixercurvewidget.cpp @@ -147,7 +147,17 @@ QList MixerCurveWidget::getCurve() { return list; } - +/** + Sets a linear graph + */ +void MixerCurveWidget::initLinearCurve(quint32 numPoints, double maxValue) +{ + QList points; + for (double i=0; i points); QList getCurve(); + void initLinearCurve(quint32 numPoints, double maxValue); void setCurve(QList); void setMin(double value); void setMax(double value); From 7b3241cca99baa3a3907b02d42dd4415cacc5621 Mon Sep 17 00:00:00 2001 From: Pip Date: Mon, 13 Jun 2011 16:12:04 +0100 Subject: [PATCH 04/16] Fixed GCS export file selection problem - in windows. --- .../importexport/importexportgadgetwidget.cpp | 52 ++-- .../importexport/importexportgadgetwidget.h | 4 +- .../importexport/importexportgadgetwidget.ui | 238 +++++++----------- 3 files changed, 123 insertions(+), 171 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.cpp index 350e1a3ff..6e1d4d2c3 100644 --- a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -47,10 +48,8 @@ ImportExportGadgetWidget::ImportExportGadgetWidget(QWidget *parent) : { setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); ui->setupUi(this); - ui->configFile->setExpectedKind(Utils::PathChooser::File); - ui->configFile->setPromptDialogFilter(tr("XML file (*.xml)")); - ui->configFile->setPromptDialogTitle(tr("Choose configuration file")); + filename = ""; } ImportExportGadgetWidget::~ImportExportGadgetWidget() @@ -72,35 +71,21 @@ void ImportExportGadgetWidget::changeEvent(QEvent *e) void ImportExportGadgetWidget::on_exportButton_clicked() { - QString file = ui->configFile->path(); - if (file.isEmpty()) { - QMessageBox msgBox; - msgBox.setText(tr("Empty File name.")); - msgBox.setInformativeText(tr("Please choose an export file name.")); - msgBox.setStandardButtons(QMessageBox::Ok); - msgBox.exec(); - return; - } - // Add a "XML" extension to the file in case it does not exist: - if (!file.endsWith(".xml")) + QString file = filename; + QString filter = tr("GCS Settings file (*.xml)"); + file = QFileDialog::getSaveFileName(this, tr("Save GCS Settings too file .."), QFileInfo(file).absoluteFilePath(), filter).trimmed(); + if (file.isEmpty()) { + return; + } + + // Add a "XML" extension to the file in case it does not exist: + if (!file.toLower().endsWith(".xml")) file.append(".xml"); + filename = file; + qDebug() << "Export pressed! Write to file " << QFileInfo(file).absoluteFilePath(); - if ( QFileInfo(file).exists() ){ - QMessageBox msgBox; - msgBox.setText(tr("File already exists.")); - msgBox.setInformativeText(tr("Do you want to overwrite the existing file?")); - msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); - msgBox.setDefaultButton(QMessageBox::Ok); - if ( msgBox.exec() == QMessageBox::Ok ){ - QFileInfo(file).absoluteDir().remove(QFileInfo(file).fileName()); - } - else{ - qDebug() << "Export canceled!"; - return; - } - } QMessageBox msgBox; QDir dir = QFileInfo(file).absoluteDir(); if (! dir.exists()) { @@ -163,8 +148,17 @@ void ImportExportGadgetWidget::writeError(const QString& msg) const void ImportExportGadgetWidget::on_importButton_clicked() { - QString file = ui->configFile->path(); + QString file = filename; + QString filter = tr("GCS Settings file (*.xml)"); + file = QFileDialog::getOpenFileName(this, tr("Load GCS Settings from file .."), QFileInfo(file).absoluteFilePath(), filter).trimmed(); + if (file.isEmpty()) { + return; + } + + filename = file; + qDebug() << "Import pressed! Read from file " << QFileInfo(file).absoluteFilePath(); + QMessageBox msgBox; if (! QFileInfo(file).isReadable()) { msgBox.setText(tr("Can't read file ") + QFileInfo(file).absoluteFilePath()); diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.h b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.h index ced46a059..bb6d46aa3 100644 --- a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.h +++ b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.h @@ -41,8 +41,10 @@ private: void importConfiguration(const QString& fileName); QList getConfigurables(); + QString filename; + private slots: - void on_resetButton_clicked(); + void on_resetButton_clicked(); void on_helpButton_clicked(); void on_importButton_clicked(); void on_exportButton_clicked(); diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.ui b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.ui index c29461d5c..d466d1dd2 100644 --- a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.ui +++ b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.ui @@ -7,162 +7,118 @@ 0 0 483 - 271 + 154 Form - - - + + + - - - - 0 - 0 - - - - Config File + + + Items + + + + + General (Workspace, Key-Bindings) + + + true + + + + + + + All Gadgets + + + true + + + + + + + Plugins + + + true + + + + - - - - 0 - 0 - - - - - - - - - - Items - - - - - - General (Workspace, Key-Bindings) - - - true - - - - - - - All Gadgets - - - true - - - - - - - Plugins - - - true - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 32 - 32 - - - - - - - - :/core/images/helpicon.svg:/core/images/helpicon.svg - - - - 32 - 32 - - - - true - - - - - - - Export the GCS settings selected in the checkboxes above. - - - Export - - - - - - - Import settings from the config file, only for the items checked above. - - - Import - - - - - - - Resets your GCS configuration to its default configuration. - - - Reset Config - - + + + + + + 32 + 32 + + + + + + + + :/core/images/helpicon.svg:/core/images/helpicon.svg + + + + 32 + 32 + + + + true + + + + + + + Export the GCS settings selected in the checkboxes above. + + + Export + + + + + + + Import settings from the config file, only for the items checked above. + + + Import + + + + + + + Resets your GCS configuration to its default configuration. + + + Reset Config + + + + - - - Utils::PathChooser - QWidget -
utils/pathchooser.h
- 1 -
-
From b4d65102b1ddf70125edd4defb797153d9b3e4f7 Mon Sep 17 00:00:00 2001 From: elafargue Date: Mon, 13 Jun 2011 18:59:53 +0200 Subject: [PATCH 05/16] Add "..." on import and export buttons --- .../src/plugins/importexport/importexportgadgetwidget.ui | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.ui b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.ui index d466d1dd2..a4631aba0 100644 --- a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.ui +++ b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.ui @@ -7,7 +7,7 @@ 0 0 483 - 154 + 174 @@ -89,7 +89,7 @@ Export the GCS settings selected in the checkboxes above. - Export + Export...
@@ -99,7 +99,7 @@ Import settings from the config file, only for the items checked above. - Import + Import... From 0801495ce18020ed0f83b996e6edcd9a735d5139 Mon Sep 17 00:00:00 2001 From: Stacey Sheldon Date: Tue, 7 Jun 2011 22:42:59 -0400 Subject: [PATCH 06/16] build: fix spacing on label for clean targets Whitespace only, no functional changes. --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 6b0601ebb..ae295d34d 100644 --- a/Makefile +++ b/Makefile @@ -277,7 +277,7 @@ openpilotgcs: uavobjects_gcs .PHONY: openpilotgcs_clean openpilotgcs_clean: - $(V0) @echo " CLEAN $@" + $(V0) @echo " CLEAN $@" $(V1) [ ! -d "$(BUILD_DIR)/ground/openpilotgcs" ] || $(RM) -r "$(BUILD_DIR)/ground/openpilotgcs" .PHONY: uavobjgenerator @@ -307,7 +307,7 @@ uavobjects_test: $(UAVOBJ_OUT_DIR) uavobjgenerator $(V1) $(UAVOBJGENERATOR) -v -none $(UAVOBJ_XML_DIR) $(ROOT_DIR) uavobjects_clean: - $(V0) @echo " CLEAN $@" + $(V0) @echo " CLEAN $@" $(V1) [ ! -d "$(UAVOBJ_OUT_DIR)" ] || $(RM) -r "$(UAVOBJ_OUT_DIR)" ############################## @@ -335,7 +335,7 @@ fw_$(1)_%: uavobjects_flight .PHONY: $(1)_clean $(1)_clean: fw_$(1)_clean fw_$(1)_clean: - $(V0) @echo " CLEAN $$@" + $(V0) @echo " CLEAN $$@" $(V1) $(RM) -fr $(BUILD_DIR)/fw_$(1) endef @@ -357,7 +357,7 @@ bl_$(1)_%: .PHONY: bl_$(1)_clean bl_$(1)_clean: - $(V0) @echo " CLEAN $$@" + $(V0) @echo " CLEAN $$@" $(V1) $(RM) -fr $(BUILD_DIR)/bl_$(1) endef @@ -377,7 +377,7 @@ bu_$(1)_%: bl_$(1)_bino .PHONY: bu_$(1)_clean bu_$(1)_clean: - $(V0) @echo " CLEAN $$@" + $(V0) @echo " CLEAN $$@" $(V1) $(RM) -fr $(BUILD_DIR)/bu_$(1) endef From 6313a78dc90639a9fd039f77de35bb26daa573a8 Mon Sep 17 00:00:00 2001 From: Stacey Sheldon Date: Tue, 7 Jun 2011 22:47:07 -0400 Subject: [PATCH 07/16] build: make lists of boards with fw, bl and bu Provide unique lists of boards for each type of build (fw, bl, bu) so we can refer to them in the help text. --- Makefile | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index ae295d34d..e4ea0cdfe 100644 --- a/Makefile +++ b/Makefile @@ -92,19 +92,19 @@ help: @echo " - Build firmware for " @echo " supported boards are ($(ALL_BOARDS))" @echo " fw_ - Build firmware for " - @echo " supported boards are ($(FW_TARGETS))" + @echo " supported boards are ($(FW_BOARDS))" @echo " fw__clean - Remove firmware for " @echo " fw__program - Use OpenOCD + JTAG to write firmware to " @echo @echo " [Bootloader]" @echo " bl_ - Build bootloader for " - @echo " supported boards are ($(BL_TARGETS))" + @echo " supported boards are ($(BL_BOARDS))" @echo " bl__clean - Remove bootloader for " @echo " bl__program - Use OpenOCD + JTAG to write bootloader to " @echo @echo " [Bootloader Updater]" @echo " bu_ - Build bootloader updater for " - @echo " supported boards are ($(BU_TARGETS))" + @echo " supported boards are ($(BU_BOARDS))" @echo " bu__clean - Remove bootloader updater for " @echo @echo " [Simulation]" @@ -403,14 +403,20 @@ pipxtreme_friendly := PipXtreme ins_friendly := INS ahrs_friendly := AHRS -FW_TARGETS := $(addprefix fw_, $(ALL_BOARDS)) -BL_TARGETS := $(addprefix bl_, $(ALL_BOARDS)) -BU_TARGETS := $(addprefix bu_, $(ALL_BOARDS)) +# Start out assuming that we'll build fw, bl and bu for all boards +FW_BOARDS := $(ALL_BOARDS) +BL_BOARDS := $(ALL_BOARDS) +BU_BOARDS := $(ALL_BOARDS) # FIXME: The INS build doesn't have a bootloader or bootloader # updater yet so we need to filter them out to prevent errors. -BL_TARGETS := $(filter-out bl_ins, $(BL_TARGETS)) -BU_TARGETS := $(filter-out bu_ins, $(BU_TARGETS)) +BL_BOARDS := $(filter-out ins, $(ALL_BOARDS)) +BU_BOARDS := $(filter-out ins, $(ALL_BOARDS)) + +# Generate the targets for whatever boards are left in each list +FW_TARGETS := $(addprefix fw_, $(FW_BOARDS)) +BL_TARGETS := $(addprefix bl_, $(BL_BOARDS)) +BU_TARGETS := $(addprefix bu_, $(BU_BOARDS)) .PHONY: all_fw all_fw_clean all_fw: $(addsuffix _opfw, $(FW_TARGETS)) @@ -428,6 +434,7 @@ all_bu_clean: $(addsuffix _clean, $(BU_TARGETS)) all_flight: all_fw all_bl all_bu all_flight_clean: all_fw_clean all_bl_clean all_bu_clean +# Expand the groups of targets for each board $(foreach board, $(ALL_BOARDS), $(eval $(call BOARD_PHONY_TEMPLATE,$(board)))) # Expand the bootloader updater rules From 81dbd3f4c024223ba7f66baff668ca0a908d05aa Mon Sep 17 00:00:00 2001 From: Stacey Sheldon Date: Tue, 7 Jun 2011 22:48:46 -0400 Subject: [PATCH 08/16] build: add install rule for stm32flash utility This tool can be used as a last resort for installing a bootloader to a completely bricked board that is unresponsive to even the rescue functionality in the GCS uploader gadget. --- Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Makefile b/Makefile index e4ea0cdfe..a14cc19de 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,7 @@ help: @echo " qt_sdk_install - Install the QT v4.6.2 tools" @echo " arm_sdk_install - Install the Code Sourcery ARM gcc toolchain" @echo " openocd_install - Install the OpenOCD JTAG daemon" + @echo " stm32flash_install - Install the stm32flash tool for unbricking boards" @echo @echo " [Big Hammer]" @echo " all - Generate UAVObjects, build openpilot firmware and gcs" @@ -226,6 +227,25 @@ openocd_install: openocd_clean openocd_clean: $(V1) [ ! -d "$(OPENOCD_DIR)" ] || $(RM) -r "$(OPENOCD_DIR)" +STM32FLASH_DIR := $(TOOLS_DIR)/stm32flash + +.PHONY: stm32flash_install +stm32flash_install: STM32FLASH_URL := http://stm32flash.googlecode.com/svn/trunk +stm32flash_install: STM32FLASH_REV := 52 +stm32flash_install: stm32flash_clean + # download the source + $(V0) @echo " DOWNLOAD $(STM32FLASH_URL) @ r$(STM32FLASH_REV)" + $(V1) svn export -q -r "$(STM32FLASH_REV)" "$(STM32FLASH_URL)" "$(STM32FLASH_DIR)" + + # build + $(V0) @echo " BUILD $(STM32FLASH_DIR)" + $(V1) $(MAKE) --silent -C $(STM32FLASH_DIR) all + +.PHONY: stm32flash_clean +stm32flash_clean: + $(V0) @echo " CLEAN $(STM32FLASH_DIR)" + $(V1) [ ! -d "$(STM32FLASH_DIR)" ] || $(RM) -r "$(STM32FLASH_DIR)" + ############################## # # Set up paths to tools From 8c4c73496bd8213e0cf010f16ddddc85ec1abd4f Mon Sep 17 00:00:00 2001 From: Stacey Sheldon Date: Tue, 7 Jun 2011 22:53:08 -0400 Subject: [PATCH 09/16] build: add unbrick targets Added new unbrick_ targets for each board. These targets use the stm32flash utility to install a bootloader on to the board. This is a tool of last resort and should not be used for normal firmware upgrades. Usage: make unbrick_ UNBRICK_TTY=/dev/ttyUSB0 Where: is one of coptercontrol, pipxtreme, openpilot, ins, ahrs UNBRICK_TTY is set to the serial device connected to the board. --- Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Makefile b/Makefile index a14cc19de..60c918cd4 100644 --- a/Makefile +++ b/Makefile @@ -108,6 +108,10 @@ help: @echo " supported boards are ($(BU_BOARDS))" @echo " bu__clean - Remove bootloader updater for " @echo + @echo " [Unbrick a board]" + @echo " unbrick_ - Use the STM32's built in boot ROM to write a bootloader to " + @echo " supported boards are ($(BL_BOARDS))" + @echo @echo " [Simulation]" @echo " sim_posix - Build OpenPilot simulation firmware for" @echo " a POSIX compatible system (Linux, Mac OS X, ...)" @@ -375,6 +379,20 @@ bl_$(1)_%: REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \ $$* +.PHONY: unbrick_$(1) +unbrick_$(1): bl_$(1)_hex +$(if $(filter-out undefined,$(origin UNBRICK_TTY)), + $(V0) @echo " UNBRICK $(1) via $$(UNBRICK_TTY)" + $(V1) $(STM32FLASH_DIR)/stm32flash \ + -w $(BUILD_DIR)/bl_$(1)/bl_$(1).hex \ + -g 0x0 \ + $$(UNBRICK_TTY) +, + $(V0) @echo + $(V0) @echo "ERROR: You must specify UNBRICK_TTY= to use for unbricking." + $(V0) @echo " eg. $$(MAKE) $$@ UNBRICK_TTY=/dev/ttyUSB0" +) + .PHONY: bl_$(1)_clean bl_$(1)_clean: $(V0) @echo " CLEAN $$@" From eecacc57f611523a2f6e8e8df5f244e8b3eeceac Mon Sep 17 00:00:00 2001 From: dankers Date: Sun, 19 Jun 2011 02:34:12 +1000 Subject: [PATCH 10/16] Update deluxe dials from London Flyer, added deluxe horizontal dial Note: these are not used by default, commiting to master directly --- .../Dials/deluxe/lineardial-horizontal.svg | 1329 +++++++++++++++++ artwork/Dials/deluxe/lineardial-vertical.svg | 25 +- .../dials/deluxe/lineardial-horizontal.svg | 1329 +++++++++++++++++ .../dials/deluxe/lineardial-vertical.svg | 25 +- 4 files changed, 2682 insertions(+), 26 deletions(-) create mode 100644 artwork/Dials/deluxe/lineardial-horizontal.svg create mode 100644 ground/openpilotgcs/share/openpilotgcs/dials/deluxe/lineardial-horizontal.svg diff --git a/artwork/Dials/deluxe/lineardial-horizontal.svg b/artwork/Dials/deluxe/lineardial-horizontal.svg new file mode 100644 index 000000000..2f6f71b17 --- /dev/null +++ b/artwork/Dials/deluxe/lineardial-horizontal.svg @@ -0,0 +1,1329 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Edouard Lafargue + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/artwork/Dials/deluxe/lineardial-vertical.svg b/artwork/Dials/deluxe/lineardial-vertical.svg index 11a4e1c93..010283c2c 100644 --- a/artwork/Dials/deluxe/lineardial-vertical.svg +++ b/artwork/Dials/deluxe/lineardial-vertical.svg @@ -30,7 +30,7 @@ style="stop-color:#000000;stop-opacity:1" /> + style="stop-color:#dcaf28;stop-opacity:1" /> + offset="0.38184431" + style="stop-color:#00a000;stop-opacity:1" /> + style="stop-color:#aa0000;stop-opacity:1" />