From c2664a78432ecaae88eab1e4b406b96818c6f149 Mon Sep 17 00:00:00 2001 From: edouard Date: Tue, 12 Oct 2010 21:41:06 +0000 Subject: [PATCH] OP-138 Various updates to config gadget: new quad shapes in the artwork, new tooltips, and start of the feed forward testing interface, with foolproof user safety (tm) built it... git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1950 ebee16cc-31ac-478f-84a7-5cbb03baadba --- ground/src/plugins/config/airframe.ui | 218 +++-- .../src/plugins/config/configservowidget.cpp | 29 +- .../src/plugins/config/images/quad-shapes.svg | 827 +++++++++++++++++- ground/src/plugins/config/settingswidget.ui | 10 +- 4 files changed, 915 insertions(+), 169 deletions(-) diff --git a/ground/src/plugins/config/airframe.ui b/ground/src/plugins/config/airframe.ui index 4758a4eb4..91a95e395 100644 --- a/ground/src/plugins/config/airframe.ui +++ b/ground/src/plugins/config/airframe.ui @@ -509,7 +509,8 @@ - Weight of Roll mixing in percent. Typical values are 100% for + configuration and 50% for X configuration on quads. + Weight of Roll mixing in percent. +Typical values are 100% for + configuration and 50% for X configuration on quads. 100 @@ -556,7 +557,8 @@ - Weight of Pitch mixing in percent. Typical values are 100% for + configuration and 50% for X configuration on quads. + Weight of Pitch mixing in percent. +Typical values are 100% for + configuration and 50% for X configuration on quads. 100 @@ -600,7 +602,8 @@ - Weight of Yaw mixing in percent. Typical value is 50% for + or X configuration on quads. + Weight of Yaw mixing in percent. +Typical value is 50% for + or X configuration on quads. 100 @@ -637,7 +640,7 @@ - + @@ -685,6 +688,9 @@ true + + Overall level of feed forward (in percentage). + 100 @@ -711,6 +717,11 @@ true + + When tuning: Slowly raise accel time from zero to just +under the level where the motor starts to overshoot +its target speed. + 1000.000000000000000 @@ -728,6 +739,13 @@ true + + When tuning: Slowly raise decel time from zero to just +under the level where the motor starts to undershoot +its target speed when decelerating. + +Do it after accel time is setup. + 1000.000000000000000 @@ -754,7 +772,8 @@ - Limits how much the engines can accelerate or decelerate. In 'units per second', a sound default is 1000. + Limits how much the engines can accelerate or decelerate. +In 'units per second', a sound default is 1000. 500 @@ -779,20 +798,87 @@ false + + Select the test channel for tuning feed forward. + - - - false + + + <!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:'Sans'; font-size:10pt; 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;">Beware! Check <span style=" font-weight:600;">all three</span> checkboxes to test the</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">selected channel.</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">It will run even if your airframe is not armed.</p></body></html> - Test + + + + + <!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:'Sans'; font-size:10pt; 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;">Beware! Check <span style=" font-weight:600;">all three</span> checkboxes to test the</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">selected channel.</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">It will run even if your airframe is not armed.</p></body></html> + + + + + + + + + + <!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:'Sans'; font-size:10pt; 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;">Beware! Check <span style=" font-weight:600;">all three</span> checkboxes to test the</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">selected channel.</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">It will run even if your airframe is not armed.</p></body></html> + + + Enable FF tuning + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -987,6 +1073,14 @@ 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:'Sans'; 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;">Assign your motor channels using the drawing</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">on the right as a reference. Respect propeller rotation!</p></body></html> + @@ -1171,112 +1265,6 @@ - - - - - - - - Channel1 - - - - - - - - - - Channel 2 - - - - - - - - - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - Channel 3 - - - - - - - - - - Channel 4 - - - - - - - - - - - - - - Channel 5 - - - - - - - - - - Channel 6 - - - - - - - - - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - Channel 7 - - - - - - - - - - Channel 8 - - - - - - - - - - diff --git a/ground/src/plugins/config/configservowidget.cpp b/ground/src/plugins/config/configservowidget.cpp index 18d546bdd..01cb8169c 100644 --- a/ground/src/plugins/config/configservowidget.cpp +++ b/ground/src/plugins/config/configservowidget.cpp @@ -910,15 +910,32 @@ void ConfigServoWidget::updateChannels(UAVObject* controlCommand) field = obj->getField("FlightMode"); int chIndex = field->getOptions().indexOf(field->getValue().toString()); if ( chIndex < field->getOptions().length()) { + float valueScaled; int chMin = inSliders.at(chIndex)->minimum(); int chMax = inSliders.at(chIndex)->maximum(); - if ((chMax-chMin) > 0) { - int val = controlCommand->getField("Channel")->getValue(chIndex).toInt(); - int chCur = (val-chMin)*100/(chMax-chMin); - m_config->fmsSlider->setValue(chCur); + int chNeutral = inSliders.at(chIndex)->value(); + int value = controlCommand->getField("Channel")->getValue(chIndex).toInt(); + if ((chMax > chMin && value >= chNeutral) || (chMin > chMax && value <= chNeutral)) { + if (chMax != chNeutral) { + valueScaled = (float)(value - chNeutral) / (float)(chMax - chNeutral); + } else { + valueScaled = 0; + } + } else { + if (chMin != chNeutral) { + valueScaled = (float)(value - chNeutral) / (float)(chNeutral - chMin); + } else { + valueScaled = 0; + } + } + // Bound + if (valueScaled > 1.0) { + valueScaled = 1.0; + } else if (valueScaled < -1.0) { + valueScaled = -1.0; + } + m_config->fmsSlider->setValue(valueScaled*100); } - } - } diff --git a/ground/src/plugins/config/images/quad-shapes.svg b/ground/src/plugins/config/images/quad-shapes.svg index 286655963..c1eb0214d 100644 --- a/ground/src/plugins/config/images/quad-shapes.svg +++ b/ground/src/plugins/config/images/quad-shapes.svg @@ -24,6 +24,13 @@ inkscape:vp_z="744.09448 : 526.18109 : 1" inkscape:persp3d-origin="372.04724 : 350.78739 : 1" id="perspective2925" /> + + + @@ -88,7 +103,7 @@ image/svg+xml - + @@ -98,7 +113,10 @@ id="layer1"> + inkscape:label="#g3890" + inkscape:export-filename="/tmp/quad-shapes.png" + inkscape:export-xdpi="111.09" + inkscape:export-ydpi="111.09"> + transform="translate(-16,0)" + inkscape:export-filename="/tmp/quad-shapes.png" + inkscape:export-xdpi="111.09" + inkscape:export-ydpi="111.09"> + transform="translate(460.62956,-209.6425)" + inkscape:export-filename="/tmp/quad-shapes.png" + inkscape:export-xdpi="111.09" + inkscape:export-ydpi="111.09"> + id="path2878" + inkscape:export-filename="/tmp/quad-shapes.png" + inkscape:export-xdpi="19.027815" + inkscape:export-ydpi="19.027815" /> + id="path2880" + inkscape:export-filename="/tmp/quad-shapes.png" + inkscape:export-xdpi="19.027815" + inkscape:export-ydpi="19.027815" /> + id="g3018" + inkscape:export-filename="/tmp/quad-shapes.png" + inkscape:export-xdpi="19.027815" + inkscape:export-ydpi="19.027815"> + style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:export-filename="/tmp/quad-shapes.png" + inkscape:export-xdpi="19.027815" + inkscape:export-ydpi="19.027815" /> + id="g3042" + inkscape:export-filename="/tmp/quad-shapes.png" + inkscape:export-xdpi="19.027815" + inkscape:export-ydpi="19.027815"> + style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:export-filename="/tmp/quad-shapes.png" + inkscape:export-xdpi="19.027815" + inkscape:export-ydpi="19.027815" /> + id="g3050" + inkscape:export-filename="/tmp/quad-shapes.png" + inkscape:export-xdpi="19.027815" + inkscape:export-ydpi="19.027815"> - - + id="g3035" + inkscape:export-filename="/tmp/quad-shapes.png" + inkscape:export-xdpi="19.027815" + inkscape:export-ydpi="19.027815"> + transform="translate(-318.18097,195.39402)" + inkscape:export-filename="/tmp/quad-shapes.png" + inkscape:export-xdpi="19.027815" + inkscape:export-ydpi="19.027815"> + transform="translate(-195.22908,202.03628)" + inkscape:export-filename="/tmp/quad-shapes.png" + inkscape:export-xdpi="19.027815" + inkscape:export-ydpi="19.027815"> + transform="translate(-252.68097,259.60771)" + inkscape:export-filename="/tmp/quad-shapes.png" + inkscape:export-xdpi="19.027815" + inkscape:export-ydpi="19.027815"> - - + transform="translate(-259.22908,144.01958)" + inkscape:export-filename="/tmp/quad-shapes.png" + inkscape:export-xdpi="19.027815" + inkscape:export-ydpi="19.027815"> + id="quad-hexa" + inkscape:export-filename="/tmp/quad-shapes.png" + inkscape:export-xdpi="111.09" + inkscape:export-ydpi="111.09"> + + + + + 1 + + + + + + + + + + + 5 + + + + + + + + + + 7 + + + + + + + 3 + + + + + + 8 + + + + + + + + 4 + + + + + + + + 6 + + + + + + + + 2 + + + + + + + + + 1 + + + + + + + + + + 4 + + + + + + + + 6 + + + + + + + + 3 + + + + + + + + 5 + + + + + + 2 + + + + diff --git a/ground/src/plugins/config/settingswidget.ui b/ground/src/plugins/config/settingswidget.ui index fc3e18dd6..e8da6b95e 100644 --- a/ground/src/plugins/config/settingswidget.ui +++ b/ground/src/plugins/config/settingswidget.ui @@ -23,7 +23,7 @@ - 2 + 0 @@ -1729,6 +1729,10 @@ Be sure to set the Neutral position on all sliders before sending! 27 + + Setup "TurboPWM" here: usual value is 400 Hz for multirotor airframes. +Leave at 50Hz for fixed wing. + 9999 @@ -1755,6 +1759,10 @@ Be sure to set the Neutral position on all sliders before sending! 27 + + Setup "TurboPWM" here: usual value is 400 Hz for multirotor airframes. +Leave at 50Hz for fixed wing. + 9999