Commit cbbac43f authored by Lorenz Meier's avatar Lorenz Meier

Added flying wing support

parent b3ba7ea3
...@@ -38,6 +38,7 @@ This file is part of the QGROUNDCONTROL project ...@@ -38,6 +38,7 @@ This file is part of the QGROUNDCONTROL project
#include "QGC.h" #include "QGC.h"
#include <QHostInfo> #include <QHostInfo>
#include "UAS.h" #include "UAS.h"
#include "UASInterface.h"
#include "MainWindow.h" #include "MainWindow.h"
QGCXPlaneLink::QGCXPlaneLink(UASInterface* mav, QString remoteHost, QHostAddress localHost, quint16 localPort) : QGCXPlaneLink::QGCXPlaneLink(UASInterface* mav, QString remoteHost, QHostAddress localHost, quint16 localPort) :
...@@ -226,12 +227,8 @@ void QGCXPlaneLink::setRemoteHost(const QString& newHost) ...@@ -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) 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) if (mav->getSystemType() == MAV_TYPE_QUADROTOR)
// Only update this for multirotors // 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); Q_UNUSED(time);
...@@ -294,9 +291,9 @@ void QGCXPlaneLink::updateControls(uint64_t time, float rollAilerons, float pitc ...@@ -294,9 +291,9 @@ void QGCXPlaneLink::updateControls(uint64_t time, float rollAilerons, float pitc
{ {
// Do not update this control type for // Do not update this control type for
// all multirotors // all multirotors
if (airframeID == AIRFRAME_QUAD_X_MK_10INCH_I2C || if (mav->getSystemType() == MAV_TYPE_QUADROTOR ||
airframeID == AIRFRAME_QUAD_X_ARDRONE || mav->getSystemType() == MAV_TYPE_HEXAROTOR ||
airframeID == AIRFRAME_QUAD_DJI_F450_PWM) mav->getSystemType() == MAV_TYPE_OCTOROTOR)
{ {
return; return;
} }
...@@ -316,9 +313,26 @@ void QGCXPlaneLink::updateControls(uint64_t time, float rollAilerons, float pitc ...@@ -316,9 +313,26 @@ void QGCXPlaneLink::updateControls(uint64_t time, float rollAilerons, float pitc
p.b[4] = '\0'; p.b[4] = '\0';
p.index = 12; p.index = 12;
p.f[0] = -pitchElevator;
p.f[1] = rollAilerons; if (mav->getAirframe() == UASInterface::QGC_AIRFRAME_X8 ||
p.f[2] = yawRudder; 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(time);
Q_UNUSED(systemMode); Q_UNUSED(systemMode);
......
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
#define WITH_TEXT_TO_SPEECH 1 #define WITH_TEXT_TO_SPEECH 1
#define QGC_APPLICATION_NAME "QGroundControl" #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 namespace QGC
{ {
const QString APPNAME = "QGROUNDCONTROL"; const QString APPNAME = "QGROUNDCONTROL";
const QString COMPANYNAME = "QGROUNDCONTROL"; const QString COMPANYNAME = "QGROUNDCONTROL";
const int APPLICATIONVERSION = 101; // 1.0.1 const int APPLICATIONVERSION = 102; // 1.0.1
} }
#endif // QGC_CONFIGURATION_H #endif // QGC_CONFIGURATION_H
...@@ -150,6 +150,9 @@ public: ...@@ -150,6 +150,9 @@ public:
QGC_AIRFRAME_PTERYX, QGC_AIRFRAME_PTERYX,
QGC_AIRFRAME_TRICOPTER, QGC_AIRFRAME_TRICOPTER,
QGC_AIRFRAME_HEXCOPTER, QGC_AIRFRAME_HEXCOPTER,
QGC_AIRFRAME_X8,
QGC_AIRFRAME_VIPER_2_0,
QGC_AIRFRAME_CAMFLYER_Q,
QGC_AIRFRAME_END_OF_ENUM QGC_AIRFRAME_END_OF_ENUM
}; };
......
...@@ -547,7 +547,11 @@ void UASView::selectAirframe() ...@@ -547,7 +547,11 @@ void UASView::selectAirframe()
<< "Predator" << "Predator"
<< "Coaxial" << "Coaxial"
<< "Pteryx" << "Pteryx"
<< "Asctec Firefly"; << "Tricopter"
<< "Asctec Firefly"
<< "X8 Flying Wing"
<< "Viper 2.0 Flying Wing"
<< "Cam Flyer Q Flying Wing";
bool ok; bool ok;
QString item = QInputDialog::getItem(this, tr("Select Airframe for %1").arg(uas->getUASName()), QString item = QInputDialog::getItem(this, tr("Select Airframe for %1").arg(uas->getUASName()),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment