1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-18 08:54:15 +01:00

OP-1620 Added Vtail frame to setup Wizard

This commit is contained in:
Laurent Lalanne 2014-11-17 00:27:16 +01:00
parent 4b68deb878
commit c1c0c87677
6 changed files with 105 additions and 20 deletions

View File

@ -139,6 +139,9 @@ void ConnectionDiagram::setupGraphicsScene()
case VehicleConfigurationSource::FIXED_WING_ELEVON:
elementsToShow << "elevon";
break;
case VehicleConfigurationSource::FIXED_WING_VTAIL:
elementsToShow << "vtail";
break;
default:
break;
}

View File

@ -71,4 +71,10 @@ void FixedWingPage::setupSelection(Selection *selection)
"supported. Setup should include only two elevons, and should explicitly not include a rudder."),
"elevon",
SetupWizard::FIXED_WING_ELEVON);
selection->addItem(tr("Vtail"),
tr("This setup expects a traditional glider airframe using two independent aileron servos "
"on their own channel (not connected by Y adapter) plus Vtail mixing elevator/rudder."),
"vtail",
SetupWizard::FIXED_WING_VTAIL);
}

View File

@ -211,6 +211,17 @@ void OutputCalibrationPage::setupVehicle()
setupActuatorMinMaxAndNeutral(2, 2, 3);
getWizard()->setActuatorSettings(m_actuatorSettings);
break;
case SetupWizard::FIXED_WING_VTAIL:
loadSVGFile(FIXEDWING_SVG_FILE);
m_wizardIndexes << 0 << 1 << 2 << 2 << 2 << 2;
m_vehicleElementIds << "vtail" << "vtail-frame" << "vtail-motor" << "vtail-ail-left" << "vtail-ail-right" << "vtail-rudder-left" << "vtail-rudder-right";
m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 3 << 4 << 5;
m_channelIndex << 0 << 2 << 0 << 5 << 3 << 1;
setupActuatorMinMaxAndNeutral(2, 2, 5);
getWizard()->setActuatorSettings(m_actuatorSettings);
break;
default:

View File

@ -966,13 +966,13 @@
inkscape:window-height="928"
id="namedview4099"
showgrid="false"
inkscape:zoom="5.5055418"
inkscape:cx="458.39567"
inkscape:cy="2595.1281"
inkscape:zoom="6.6234143"
inkscape:cx="294.48102"
inkscape:cy="421.89869"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="elevon-frame"
inkscape:current-layer="vtail-motor"
showborder="true"
inkscape:showpageshadow="false"
showguides="false"
@ -4327,21 +4327,6 @@
d="M 449.683,830.161 V 821.571 H 453.494 C 454.26,821.571 454.842,821.648 455.24,821.8 C 455.636,821.954 455.957,822.227 456.195,822.617 C 456.431,823.007 456.55,823.439 456.55,823.912 C 456.55,824.52 456.353,825.035 455.958,825.453 C 455.562,825.871 454.954,826.137 454.13,826.25 C 454.431,826.396 454.659,826.537 454.818,826.678 C 455.15,826.985 455.464,827.366 455.759,827.823 L 457.253,830.161 H 455.823 L 454.684,828.374 C 454.352,827.858 454.08,827.464 453.866,827.189 C 453.651,826.916 453.46,826.723 453.29,826.616 C 453.12,826.507 452.946,826.428 452.769,826.387 C 452.64,826.362 452.429,826.346 452.136,826.346 H 450.82 V 830.16 L 449.683,830.161 L 449.683,830.161 z M 450.819,825.362 H 453.26 C 453.781,825.362 454.186,825.306 454.481,825.201 C 454.774,825.094 454.997,824.922 455.149,824.683 C 455.299,824.448 455.378,824.192 455.378,823.912 C 455.378,823.506 455.232,823.172 454.937,822.91 C 454.642,822.647 454.175,822.515 453.541,822.515 H 450.822 L 450.819,825.362 L 450.819,825.362 z"
id="path4097-7" /></g></g></g><g
id="vtail"><g
id="vtail-propeller"
transform="matrix(-0.63758198,0,0,0.63758198,573.85558,1590.3998)"><g
transform="translate(0,1008)"
id="g3577-1-6"><path
id="path3579-4-7"
d="M 402.97,458.154 C 402.97,458.154 422.97,450.654 442.47,451.654 C 461.97,452.654 502.97,457.154 508.97,458.154 C 508.97,458.154 458.47,464.154 432.47,463.654 C 406.47,463.154 402.97,458.154 402.97,458.154 z"
inkscape:connector-curvature="0" /><path
sodipodi:nodetypes="cscsc"
id="path3581-4-5"
d="M 394.476,458.592 C 394.476,458.592 374.476,464.49367 354.976,463.49367 C 335.476,462.49367 294.476,459.592 288.476,458.592 C 288.476,458.592 338.976,452.592 364.976,453.092 C 390.976,453.592 394.476,458.592 394.476,458.592 z"
inkscape:connector-curvature="0" /></g><path
style="fill:#010101"
inkscape:connector-curvature="0"
id="path3575-4-2"
d="M 388.375,1470.057 H 409.069 C 409.069,1470.057 403.881,1454.799 398.709,1454.682 C 393.533,1454.565 388.375,1470.057 388.375,1470.057 z" /></g><g
transform="translate(-67.999261,-57.002699)"
id="vtail-frame"><path
style="fill:#3c3c3c;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
@ -4424,7 +4409,23 @@
style="opacity:0.72250001;fill:#ffffff"
inkscape:connector-curvature="0"
d="M 363.37692,1817.6768 L 365.68692,1817.3687 C 365.95192,1818.6777 366.40392,1819.6218 367.04092,1820.1958 C 367.67792,1820.7738 368.45692,1821.0627 369.37292,1821.0627 C 370.45992,1821.0627 371.37792,1820.6857 372.12592,1819.9338 C 372.87492,1819.1798 373.24792,1818.2478 373.24792,1817.1348 C 373.24792,1816.0717 372.89992,1815.1968 372.20992,1814.5098 C 371.51692,1813.8218 370.63492,1813.4767 369.56392,1813.4767 C 369.12592,1813.4767 368.58492,1813.5627 367.93392,1813.7348 L 368.18992,1811.7077 C 368.34392,1811.7257 368.46892,1811.7317 368.56292,1811.7317 C 369.54692,1811.7317 370.43392,1811.4747 371.22092,1810.9607 C 372.00792,1810.4446 372.40092,1809.6537 372.40092,1808.5867 C 372.40092,1807.7387 372.11592,1807.0387 371.54392,1806.4827 C 370.96992,1805.9267 370.23092,1805.6487 369.32092,1805.6487 C 368.42392,1805.6487 367.67492,1805.9307 367.07492,1806.4977 C 366.47592,1807.0607 366.09092,1807.9077 365.91892,1809.0387 L 363.60892,1808.6277 C 363.89092,1807.0787 364.53192,1805.8797 365.53392,1805.0257 C 366.53392,1804.1737 367.77992,1803.7507 369.26892,1803.7507 C 370.29392,1803.7507 371.24192,1803.9717 372.10492,1804.4127 C 372.96892,1804.8507 373.62892,1805.4527 374.08792,1806.2157 C 374.54492,1806.9777 374.77392,1807.7847 374.77392,1808.6417 C 374.77392,1809.4547 374.55492,1810.1946 374.11992,1810.8627 C 373.68392,1811.5286 373.03792,1812.0597 372.18292,1812.4567 C 373.29292,1812.7127 374.15892,1813.2437 374.77392,1814.0547 C 375.39092,1814.8627 375.69792,1815.8747 375.69792,1817.0897 C 375.69792,1818.7327 375.09992,1820.1247 373.90292,1821.2677 C 372.70392,1822.4096 371.18892,1822.9806 369.35792,1822.9806 C 367.70692,1822.9806 366.33592,1822.4886 365.24492,1821.5047 C 364.15292,1820.5187 363.52992,1819.2436 363.37692,1817.6767 z"
id="path3977-3-3-9-7-9" /></g></g><g
id="path3977-3-3-9-7-9" /></g><g
id="vtail-propeller"
transform="matrix(-0.63758198,0,0,0.63758198,1066.3515,909.70159)"
inkscape:transform-center-x="-2.4156725"><g
transform="translate(0,1008)"
id="g3577-1-6"><path
id="path3579-4-7"
d="M 402.97,458.154 C 402.97,458.154 422.97,450.654 442.47,451.654 C 461.97,452.654 502.97,457.154 508.97,458.154 C 508.97,458.154 458.47,464.154 432.47,463.654 C 406.47,463.154 402.97,458.154 402.97,458.154 z"
inkscape:connector-curvature="0" /><path
sodipodi:nodetypes="cscsc"
id="path3581-4-5"
d="M 394.476,458.592 C 394.476,458.592 374.476,464.49367 354.976,463.49367 C 335.476,462.49367 294.476,459.592 288.476,458.592 C 288.476,458.592 338.976,452.592 364.976,453.092 C 390.976,453.592 394.476,458.592 394.476,458.592 z"
inkscape:connector-curvature="0" /></g><path
style="fill:#010101"
inkscape:connector-curvature="0"
id="path3575-4-2"
d="M 388.375,1470.057 H 409.069 C 409.069,1470.057 403.881,1454.799 398.709,1454.682 C 393.533,1454.565 388.375,1470.057 388.375,1470.057 z" /></g></g><g
transform="translate(-67.999261,-57.002699)"
id="vtail-rudder-left"><g
transform="matrix(-1,0,0,1,772.16163,2186.5467)"

Before

Width:  |  Height:  |  Size: 422 KiB

After

Width:  |  Height:  |  Size: 422 KiB

View File

@ -332,6 +332,9 @@ void VehicleConfigurationHelper::applyVehicleConfiguration()
case VehicleConfigurationSource::FIXED_WING_ELEVON:
setupElevon();
break;
case VehicleConfigurationSource::FIXED_WING_VTAIL:
setupVtail();
break;
default:
break;
}
@ -1920,3 +1923,63 @@ void VehicleConfigurationHelper::setupAileron()
applyMixerConfiguration(channels);
applyMultiGUISettings(SystemSettings::AIRFRAMETYPE_FIXEDWING, guiSettings);
}
void VehicleConfigurationHelper::setupVtail()
{
// Typical vehicle setup
// 1. Setup mixer data
// 2. Setup GUI data
// 3. Apply changes
mixerChannelSettings channels[ActuatorSettings::CHANNELADDR_NUMELEM];
GUIConfigDataUnion guiSettings = getGUIConfigData();
// Motor (Chan 3)
channels[2].type = MIXER_TYPE_MOTOR;
channels[2].throttle1 = 100;
channels[2].throttle2 = 0;
channels[2].roll = 0;
channels[2].pitch = 0;
channels[2].yaw = 0;
// Aileron Servo (Chan 1)
channels[0].type = MIXER_TYPE_SERVO;
channels[0].throttle1 = 0;
channels[0].throttle2 = 0;
channels[0].roll = 100;
channels[0].pitch = 0;
channels[0].yaw = 0;
// Aileron Servo 2 (Chan 6)
channels[5].type = MIXER_TYPE_SERVO;
channels[5].throttle1 = 0;
channels[5].throttle2 = 0;
channels[5].roll = 100;
channels[5].pitch = 0;
channels[5].yaw = 0;
// Right Vtail Servo (Chan 2)
channels[1].type = MIXER_TYPE_SERVO;
channels[1].throttle1 = 0;
channels[1].throttle2 = 0;
channels[1].roll = 0;
channels[1].pitch = 100;
channels[1].yaw = 100;
// Left Vtail Servo (Chan 4)
channels[3].type = MIXER_TYPE_SERVO;
channels[3].throttle1 = 0;
channels[3].throttle2 = 0;
channels[3].roll = 0;
channels[3].pitch = -100;
channels[3].yaw = 100;
guiSettings.fixedwing.FixedWingThrottle = 3;
guiSettings.fixedwing.FixedWingRoll1 = 1;
guiSettings.fixedwing.FixedWingRoll2 = 6;
guiSettings.fixedwing.FixedWingPitch1 = 4; // Vtail left (top view, nose up)
guiSettings.fixedwing.FixedWingPitch2 = 2; // Vtail right
applyMixerConfiguration(channels);
applyMultiGUISettings(SystemSettings::AIRFRAMETYPE_FIXEDWINGVTAIL, guiSettings);
}

View File

@ -113,6 +113,7 @@ private:
void setupElevon();
void setupDualAileron();
void setupAileron();
void setupVtail();
private slots:
void uAVOTransactionCompleted(UAVObject *object, bool success);