From cbbac43f7935dd777377c4d6b2d7d3fac9227959 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 23 Dec 2012 21:16:17 +0100 Subject: [PATCH] Added flying wing support --- src/comm/QGCXPlaneLink.cc | 34 ++++++++++++++++++++++++---------- src/configuration.h | 4 ++-- src/uas/UASInterface.h | 3 +++ src/ui/uas/UASView.cc | 6 +++++- 4 files changed, 34 insertions(+), 13 deletions(-) diff --git a/src/comm/QGCXPlaneLink.cc b/src/comm/QGCXPlaneLink.cc index 64c3f1a7c..326a17fe2 100644 --- a/src/comm/QGCXPlaneLink.cc +++ b/src/comm/QGCXPlaneLink.cc @@ -38,6 +38,7 @@ This file is part of the QGROUNDCONTROL project #include "QGC.h" #include #include "UAS.h" +#include "UASInterface.h" #include "MainWindow.h" QGCXPlaneLink::QGCXPlaneLink(UASInterface* mav, QString remoteHost, QHostAddress localHost, quint16 localPort) : @@ -226,12 +227,8 @@ void QGCXPlaneLink::setRemoteHost(const QString& newHost) void QGCXPlaneLink::updateActuators(uint64_t time, float act1, float act2, float act3, float act4, float act5, float act6, float act7, float act8) { - // XXX Control this via the onboard system type exclusively if (mav->getSystemType() == MAV_TYPE_QUADROTOR) // Only update this for multirotors -// if (airframeID == AIRFRAME_QUAD_X_MK_10INCH_I2C || -// airframeID == AIRFRAME_QUAD_X_ARDRONE || -// airframeID == AIRFRAME_QUAD_DJI_F450_PWM) { Q_UNUSED(time); @@ -294,9 +291,9 @@ void QGCXPlaneLink::updateControls(uint64_t time, float rollAilerons, float pitc { // Do not update this control type for // all multirotors - if (airframeID == AIRFRAME_QUAD_X_MK_10INCH_I2C || - airframeID == AIRFRAME_QUAD_X_ARDRONE || - airframeID == AIRFRAME_QUAD_DJI_F450_PWM) + if (mav->getSystemType() == MAV_TYPE_QUADROTOR || + mav->getSystemType() == MAV_TYPE_HEXAROTOR || + mav->getSystemType() == MAV_TYPE_OCTOROTOR) { return; } @@ -316,9 +313,26 @@ void QGCXPlaneLink::updateControls(uint64_t time, float rollAilerons, float pitc p.b[4] = '\0'; p.index = 12; - p.f[0] = -pitchElevator; - p.f[1] = rollAilerons; - p.f[2] = yawRudder; + + if (mav->getAirframe() == UASInterface::QGC_AIRFRAME_X8 || + mav->getAirframe() == UASInterface::QGC_AIRFRAME_VIPER_2_0 || + mav->getAirframe() == UASInterface::QGC_AIRFRAME_CAMFLYER_Q) + { + // de-mix delta-mixed inputs + // pitch input - mixed roll and pitch channels + p.f[0] = 0.5f * (rollAilerons - pitchElevator); + // roll input - mixed roll and pitch channels + p.f[1] = 0.5f * (rollAilerons + pitchElevator); + // yaw + p.f[2] = 0.0f; + } + else + { + // direct pass-through + p.f[0] = -pitchElevator; + p.f[1] = rollAilerons; + p.f[2] = yawRudder; + } Q_UNUSED(time); Q_UNUSED(systemMode); diff --git a/src/configuration.h b/src/configuration.h index 8c2639d01..70602a9d5 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -12,14 +12,14 @@ #define WITH_TEXT_TO_SPEECH 1 #define QGC_APPLICATION_NAME "QGroundControl" -#define QGC_APPLICATION_VERSION "v. 1.0.1 (Alpha RC18)" +#define QGC_APPLICATION_VERSION "v. 1.0.2 (beta)" namespace QGC { const QString APPNAME = "QGROUNDCONTROL"; const QString COMPANYNAME = "QGROUNDCONTROL"; -const int APPLICATIONVERSION = 101; // 1.0.1 +const int APPLICATIONVERSION = 102; // 1.0.1 } #endif // QGC_CONFIGURATION_H diff --git a/src/uas/UASInterface.h b/src/uas/UASInterface.h index 36f4fd5b2..59c5377f7 100644 --- a/src/uas/UASInterface.h +++ b/src/uas/UASInterface.h @@ -150,6 +150,9 @@ public: QGC_AIRFRAME_PTERYX, QGC_AIRFRAME_TRICOPTER, QGC_AIRFRAME_HEXCOPTER, + QGC_AIRFRAME_X8, + QGC_AIRFRAME_VIPER_2_0, + QGC_AIRFRAME_CAMFLYER_Q, QGC_AIRFRAME_END_OF_ENUM }; diff --git a/src/ui/uas/UASView.cc b/src/ui/uas/UASView.cc index 068acd288..5d6a83012 100644 --- a/src/ui/uas/UASView.cc +++ b/src/ui/uas/UASView.cc @@ -547,7 +547,11 @@ void UASView::selectAirframe() << "Predator" << "Coaxial" << "Pteryx" - << "Asctec Firefly"; + << "Tricopter" + << "Asctec Firefly" + << "X8 Flying Wing" + << "Viper 2.0 Flying Wing" + << "Cam Flyer Q Flying Wing"; bool ok; QString item = QInputDialog::getItem(this, tr("Select Airframe for %1").arg(uas->getUASName()), -- 2.22.0