From 83f31f63eeed5bbcfe12b43d6b3036242d04bf72 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Fri, 4 Sep 2015 18:09:19 +0200 Subject: [PATCH] LP-110 Wizard : Ground and plane motors move to output 4 --- .../setupwizard/pages/outputcalibrationpage.cpp | 24 +- .../setupwizard/resources/connection-diagrams.svg | 89 +-- .../resources/fixedwing-shapes-wizard.svg | 201 ++++--- .../setupwizard/resources/ground-shapes-wizard.svg | 661 +++++++++++++++++---- .../setupwizard/vehicleconfigurationhelper.cpp | 152 ++--- 5 files changed, 808 insertions(+), 319 deletions(-) diff --git a/ground/gcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp b/ground/gcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp index d093a784e..be54e549e 100644 --- a/ground/gcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp +++ b/ground/gcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp @@ -212,9 +212,9 @@ void OutputCalibrationPage::setupVehicle() m_vehicleElementIds << "aileron" << "aileron-frame" << "aileron-motor" << "aileron-ail-left" << "aileron-ail-right" << "aileron-elevator" << "aileron-rudder"; m_vehicleElementTypes << FULL << FRAME << MOTOR << SERVO << SERVO << SERVO << SERVO; m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 3 << 4 << 5; - m_channelIndex << 0 << 2 << 0 << 5 << 1 << 3; + m_channelIndex << 0 << 3 << 0 << 5 << 1 << 2; - setupActuatorMinMaxAndNeutral(2, 2, 6); // should be 5 instead 6 but output 5 is not used + setupActuatorMinMaxAndNeutral(3, 3, 6); // should be 5 instead 6 but output 5 is not used getWizard()->setActuatorSettings(m_actuatorSettings); break; @@ -224,9 +224,9 @@ void OutputCalibrationPage::setupVehicle() m_vehicleElementIds << "singleaileron" << "singleaileron-frame" << "singleaileron-motor" << "singleaileron-aileron" << "singleaileron-elevator" << "singleaileron-rudder"; m_vehicleElementTypes << FULL << FRAME << MOTOR << SERVO << SERVO << SERVO; m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 3 << 4; - m_channelIndex << 0 << 2 << 0 << 1 << 3; + m_channelIndex << 0 << 3 << 0 << 1 << 2; - setupActuatorMinMaxAndNeutral(2, 2, 4); + setupActuatorMinMaxAndNeutral(3, 3, 4); getWizard()->setActuatorSettings(m_actuatorSettings); break; @@ -236,9 +236,9 @@ void OutputCalibrationPage::setupVehicle() m_vehicleElementIds << "elevon" << "elevon-frame" << "elevon-motor" << "elevon-left" << "elevon-right"; m_vehicleElementTypes << FULL << FRAME << MOTOR << SERVO << SERVO; m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 3; - m_channelIndex << 0 << 2 << 0 << 1; + m_channelIndex << 0 << 3 << 0 << 1; - setupActuatorMinMaxAndNeutral(2, 2, 3); + setupActuatorMinMaxAndNeutral(3, 3, 3); getWizard()->setActuatorSettings(m_actuatorSettings); break; @@ -248,9 +248,9 @@ void OutputCalibrationPage::setupVehicle() m_vehicleElementIds << "vtail" << "vtail-frame" << "vtail-motor" << "vtail-ail-left" << "vtail-ail-right" << "vtail-rudder-left" << "vtail-rudder-right"; m_vehicleElementTypes << FULL << FRAME << MOTOR << SERVO << SERVO << SERVO << SERVO; m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 3 << 4 << 5; - m_channelIndex << 0 << 2 << 0 << 5 << 3 << 1; + m_channelIndex << 0 << 3 << 0 << 5 << 2 << 1; - setupActuatorMinMaxAndNeutral(2, 2, 6); // should be 5 instead 6 but output 5 is not used + setupActuatorMinMaxAndNeutral(3, 3, 6); // should be 5 instead 6 but output 5 is not used getWizard()->setActuatorSettings(m_actuatorSettings); break; @@ -262,9 +262,9 @@ void OutputCalibrationPage::setupVehicle() m_vehicleElementIds << "car" << "car-frame" << "car-motor" << "car-steering"; m_vehicleElementTypes << FULL << FRAME << MOTOR << SERVO; m_vehicleHighlightElementIndexes << 0 << 1 << 2; - m_channelIndex << 0 << 1 << 0; + m_channelIndex << 0 << 3 << 0; - setupActuatorMinMaxAndNeutral(1, 1, 2); + setupActuatorMinMaxAndNeutral(3, 3, 2); getWizard()->setActuatorSettings(m_actuatorSettings); break; @@ -286,9 +286,9 @@ void OutputCalibrationPage::setupVehicle() m_vehicleElementIds << "motorbike" << "motorbike-frame" << "motorbike-motor" << "motorbike-steering"; m_vehicleElementTypes << FULL << FRAME << MOTOR << SERVO; m_vehicleHighlightElementIndexes << 0 << 1 << 2; - m_channelIndex << 0 << 1 << 0; + m_channelIndex << 0 << 3 << 0; - setupActuatorMinMaxAndNeutral(1, 1, 2); + setupActuatorMinMaxAndNeutral(3, 3, 2); getWizard()->setActuatorSettings(m_actuatorSettings); break; diff --git a/ground/gcs/src/plugins/setupwizard/resources/connection-diagrams.svg b/ground/gcs/src/plugins/setupwizard/resources/connection-diagrams.svg index 8bc133ea2..f8c5882ba 100644 --- a/ground/gcs/src/plugins/setupwizard/resources/connection-diagrams.svg +++ b/ground/gcs/src/plugins/setupwizard/resources/connection-diagrams.svg @@ -30,19 +30,19 @@ inkscape:window-height="928" id="namedview4616" showgrid="false" - inkscape:zoom="0.56829069" - inkscape:cx="617.05784" - inkscape:cy="502.76029" + inkscape:zoom="1.6073688" + inkscape:cx="845.3775" + inkscape:cy="601.39702" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" - inkscape:current-layer="svg12651" + inkscape:current-layer="layer47" fit-margin-top="15" fit-margin-left="15" fit-margin-right="15" fit-margin-bottom="15" inkscape:snap-grids="true" - showguides="false" + showguides="true" inkscape:guide-bbox="true" inkscape:snap-global="true" inkscape:snap-bbox="true" @@ -40658,8 +40658,9 @@ inkscape:groupmode="layer" id="layer13" inkscape:label="multirotors-frames" - style="display:inline" - transform="translate(-32.46875,315.85439)"> + style="display:none" + transform="translate(-32.46875,315.85439)" + sodipodi:insensitive="true"> + transform="translate(-32.46875,315.85439)"> @@ -46622,7 +46622,7 @@ id="circle3915-5-9" /> @@ -47260,7 +47260,7 @@ id="circle3808-2" /> @@ -47624,7 +47624,7 @@ id="circle3853-8" /> @@ -47664,8 +47664,8 @@ transform="translate(-424.57206,737.27388)" /> @@ -47683,7 +47683,7 @@ sodipodi:nodetypes="cccc" /> @@ -47722,13 +47722,13 @@ transform="matrix(0.86182848,-0.00300837,0.00369546,1.0586653,60.05965,-689.19036)" id="elevon-left-bg"> @@ -48411,7 +48411,7 @@ id="circle3808-0-9" /> @@ -48647,8 +48647,8 @@ transform="translate(1.2734359,1.2734359)" sodipodi:nodetypes="ccccc" /> @@ -49864,7 +49864,7 @@ cx="408.685" /> @@ -49987,7 +49987,7 @@ cx="214.054" /> @@ -50039,20 +50039,20 @@ @@ -50069,7 +50069,7 @@ inkscape:groupmode="layer" id="layer34" inkscape:label="fixed-wing-two-servos" - style="display:none" + style="display:inline" sodipodi:insensitive="true"> + inkscape:label="ground-vehicles" + sodipodi:insensitive="true" + style="display:none"> @@ -52016,8 +52017,8 @@ d="m -15.116465,1673.5434 l 91.222621,-0.1041 l 51.576774,-65.0956 l 261.28532,-0.1041 l 63.42887,113.2472" style="display:inline;opacity:0.6;fill:none;stroke:#ff0000;stroke-width:2.99576831;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#DotS);marker-end:url(#Arrow2Send)" /> @@ -53148,8 +53149,8 @@ d="m 650.86221,463.39425 l 364.89049,-0.4164" style="display:inline;opacity:0.6;fill:none;stroke:#ff0000;stroke-width:2.99576831;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#DotS);marker-end:url(#Arrow2Send)" /> diff --git a/ground/gcs/src/plugins/setupwizard/resources/fixedwing-shapes-wizard.svg b/ground/gcs/src/plugins/setupwizard/resources/fixedwing-shapes-wizard.svg index 311f49231..bc55b6a0f 100644 --- a/ground/gcs/src/plugins/setupwizard/resources/fixedwing-shapes-wizard.svg +++ b/ground/gcs/src/plugins/setupwizard/resources/fixedwing-shapes-wizard.svg @@ -1083,13 +1083,13 @@ inkscape:window-height="928" id="namedview4099" showgrid="false" - inkscape:zoom="0.24405855" - inkscape:cx="319.25037" - inkscape:cy="1499.6401" + inkscape:zoom="2.0277616" + inkscape:cx="306.2049" + inkscape:cy="553.84428" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" - inkscape:current-layer="vtail" + inkscape:current-layer="g9119-8-5" showborder="true" inkscape:showpageshadow="false" showguides="false" @@ -2544,18 +2544,7 @@ d="M 411.403,217.337 C 422.322,228.265 422.322,245.981 411.39,256.901 C 400.469,267.826 382.753,267.826 371.827,256.901 C 360.906,245.98 360.906,228.268 371.837,217.346 C 382.758,206.42 400.472,206.418 411.402,217.335" id="path5397_3_-36-4" inkscape:connector-curvature="0" - style="fill:#49494b" />4 -4 +4 +4 +4 +4 -4 +4 +4 +4 +4 -image/svg+xml4 +4 +getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) { + if ((m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC) || + (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC3D)) { + // Motor output4, bank2 if (i == 1) { data.BankUpdateFreq[i] = escFrequence; } - } else if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_NANO) { + } else if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) { + // Motor output4, bank3 if (i == 2) { data.BankUpdateFreq[i] = escFrequence; } + } else if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_NANO) { + // Motor output4, bank4 + if (i == 3) { + data.BankUpdateFreq[i] = escFrequence; + } } } @@ -548,11 +556,19 @@ void VehicleConfigurationHelper::applyActuatorConfiguration() for (quint16 i = 0; i < ActuatorSettings::BANKUPDATEFREQ_NUMELEM; i++) { data.BankUpdateFreq[i] = servoFrequence; data.BankMode[i] = ActuatorSettings::BANKMODE_PWM; - if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) { + if ((m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC) || + (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC3D)) { + // Motor output4, bank2 + if (i == 1) { + data.BankUpdateFreq[i] = escFrequence; + } + } else if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO) { + // Motor output4, bank3 if (i == 1) { data.BankUpdateFreq[i] = escFrequence; } } else if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_NANO) { + // Motor output4, bank4 if (i == 2) { data.BankUpdateFreq[i] = escFrequence; } @@ -1897,13 +1913,13 @@ void VehicleConfigurationHelper::setupDualAileron() 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; + // Motor (Chan 4) + channels[3].type = MIXER_TYPE_MOTOR; + channels[3].throttle1 = 100; + channels[3].throttle2 = 0; + channels[3].roll = 0; + channels[3].pitch = 0; + channels[3].yaw = 0; // Aileron Servo 1 (Chan 1) channels[0].type = MIXER_TYPE_SERVO; @@ -1929,19 +1945,19 @@ void VehicleConfigurationHelper::setupDualAileron() channels[1].pitch = 100; channels[1].yaw = 0; - // Rudder Servo (Chan 4) - channels[3].type = MIXER_TYPE_SERVO; - channels[3].throttle1 = 0; - channels[3].throttle2 = 0; - channels[3].roll = 0; - channels[3].pitch = 0; - channels[3].yaw = -100; + // Rudder Servo (Chan 3) + channels[2].type = MIXER_TYPE_SERVO; + channels[2].throttle1 = 0; + channels[2].throttle2 = 0; + channels[2].roll = 0; + channels[2].pitch = 0; + channels[2].yaw = -100; - guiSettings.fixedwing.FixedWingThrottle = 3; + guiSettings.fixedwing.FixedWingThrottle = 4; guiSettings.fixedwing.FixedWingRoll1 = 1; guiSettings.fixedwing.FixedWingRoll2 = 6; guiSettings.fixedwing.FixedWingPitch1 = 2; - guiSettings.fixedwing.FixedWingYaw1 = 4; + guiSettings.fixedwing.FixedWingYaw1 = 3; applyMixerConfiguration(channels); applyMultiGUISettings(SystemSettings::AIRFRAMETYPE_FIXEDWING, guiSettings); @@ -1957,13 +1973,13 @@ void VehicleConfigurationHelper::setupAileron() 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; + // Motor (Chan 4) + channels[3].type = MIXER_TYPE_MOTOR; + channels[3].throttle1 = 100; + channels[3].throttle2 = 0; + channels[3].roll = 0; + channels[3].pitch = 0; + channels[3].yaw = 0; // Aileron Servo (Chan 1) channels[0].type = MIXER_TYPE_SERVO; @@ -1981,18 +1997,18 @@ void VehicleConfigurationHelper::setupAileron() channels[1].pitch = 100; channels[1].yaw = 0; - // Rudder Servo (Chan 4) - channels[3].type = MIXER_TYPE_SERVO; - channels[3].throttle1 = 0; - channels[3].throttle2 = 0; - channels[3].roll = 0; - channels[3].pitch = 0; - channels[3].yaw = -100; + // Rudder Servo (Chan 3) + channels[2].type = MIXER_TYPE_SERVO; + channels[2].throttle1 = 0; + channels[2].throttle2 = 0; + channels[2].roll = 0; + channels[2].pitch = 0; + channels[2].yaw = -100; - guiSettings.fixedwing.FixedWingThrottle = 3; + guiSettings.fixedwing.FixedWingThrottle = 4; guiSettings.fixedwing.FixedWingRoll1 = 1; guiSettings.fixedwing.FixedWingPitch1 = 2; - guiSettings.fixedwing.FixedWingYaw1 = 4; + guiSettings.fixedwing.FixedWingYaw1 = 3; applyMixerConfiguration(channels); applyMultiGUISettings(SystemSettings::AIRFRAMETYPE_FIXEDWING, guiSettings); @@ -2008,13 +2024,13 @@ void VehicleConfigurationHelper::setupVtail() 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; + // Motor (Chan 4) + channels[3].type = MIXER_TYPE_MOTOR; + channels[3].throttle1 = 100; + channels[3].throttle2 = 0; + channels[3].roll = 0; + channels[3].pitch = 0; + channels[3].yaw = 0; // Aileron Servo (Chan 1) channels[0].type = MIXER_TYPE_SERVO; @@ -2040,18 +2056,18 @@ void VehicleConfigurationHelper::setupVtail() 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; + // Left Vtail Servo (Chan 3) + channels[2].type = MIXER_TYPE_SERVO; + channels[2].throttle1 = 0; + channels[2].throttle2 = 0; + channels[2].roll = 0; + channels[2].pitch = -100; + channels[2].yaw = -100; - guiSettings.fixedwing.FixedWingThrottle = 3; + guiSettings.fixedwing.FixedWingThrottle = 4; guiSettings.fixedwing.FixedWingRoll1 = 1; guiSettings.fixedwing.FixedWingRoll2 = 6; - guiSettings.fixedwing.FixedWingPitch1 = 4; // Vtail left (top view, nose up) + guiSettings.fixedwing.FixedWingPitch1 = 3; // Vtail left (top view, nose up) guiSettings.fixedwing.FixedWingPitch2 = 2; // Vtail right applyMixerConfiguration(channels); @@ -2082,16 +2098,16 @@ void VehicleConfigurationHelper::setupCar() channels[0].pitch = 0; channels[0].yaw = 100; - // Motor (Chan 2) - channels[1].type = MIXER_TYPE_REVERSABLEMOTOR; - channels[1].throttle1 = 100; - channels[1].throttle2 = 0; - channels[1].roll = 0; - channels[1].pitch = 0; - channels[1].yaw = 0; + // Motor (Chan 4) + channels[3].type = MIXER_TYPE_REVERSABLEMOTOR; + channels[3].throttle1 = 100; + channels[3].throttle2 = 0; + channels[3].roll = 0; + channels[3].pitch = 0; + channels[3].yaw = 0; guiSettings.ground.GroundVehicleSteering1 = 1; - guiSettings.ground.GroundVehicleThrottle2 = 2; + guiSettings.ground.GroundVehicleThrottle2 = 4; applyMixerConfiguration(channels); applyMultiGUISettings(SystemSettings::AIRFRAMETYPE_GROUNDVEHICLECAR, guiSettings); @@ -2148,16 +2164,16 @@ void VehicleConfigurationHelper::setupMotorcycle() channels[0].pitch = 0; channels[0].yaw = 100; - // Motor (Chan 2) - channels[1].type = MIXER_TYPE_MOTOR; - channels[1].throttle1 = 100; - channels[1].throttle2 = 0; - channels[1].roll = 0; - channels[1].pitch = 0; - channels[1].yaw = 0; + // Motor (Chan 4) + channels[3].type = MIXER_TYPE_MOTOR; + channels[3].throttle1 = 100; + channels[3].throttle2 = 0; + channels[3].roll = 0; + channels[3].pitch = 0; + channels[3].yaw = 0; guiSettings.ground.GroundVehicleSteering1 = 1; - guiSettings.ground.GroundVehicleThrottle2 = 2; + guiSettings.ground.GroundVehicleThrottle2 = 4; applyMixerConfiguration(channels); applyMultiGUISettings(SystemSettings::AIRFRAMETYPE_GROUNDVEHICLEMOTORCYCLE, guiSettings); -- 2.11.4.GIT