diff --git a/QGCExternalLibs.pri b/QGCExternalLibs.pri index c112037b693e9f34142698ea091c8571f23c8f70..2b1528a8fa7d2510a8f957b3b171166677766b2f 100644 --- a/QGCExternalLibs.pri +++ b/QGCExternalLibs.pri @@ -258,26 +258,6 @@ LinuxBuild : contains(MAVLINK_CONF, pixhawk) { message("Skipping support for Protocol Buffers") } -# -# libfreenect Kinect support -# - -MacBuild | LinuxBuild { - exists(/opt/local/include/libfreenect) | exists(/usr/local/include/libfreenect) { - message("Including support for libfreenect") - - #INCLUDEPATH += /usr/include/libusb-1.0 - DEFINES += QGC_LIBFREENECT_ENABLED - LIBS += -lfreenect - HEADERS += src/input/Freenect.h - SOURCES += src/input/Freenect.cc - } else { - message("Skipping support for libfreenect") - } -} else { - message("Skipping support for libfreenect") -} - # # EIGEN matrix library (NOMINMAX needed to make internal min/max work) # diff --git a/libs/opmapcontrol/src/internals/projections/lks94projection.cpp b/libs/opmapcontrol/src/internals/projections/lks94projection.cpp index f8a37c0be4f3077c071624ccf27596c8661080f5..4b72d57ceb2378285dc3515c869cca0b312d5045 100644 --- a/libs/opmapcontrol/src/internals/projections/lks94projection.cpp +++ b/libs/opmapcontrol/src/internals/projections/lks94projection.cpp @@ -28,6 +28,11 @@ #include +// These pragmas are local modifications to this third party library to silence warnings +#ifdef Q_OS_LINUX +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#endif namespace projections { LKS94Projection::LKS94Projection():MinLatitude (53.33 ), MaxLatitude (56.55 ), MinLongitude (20.22 ), @@ -787,3 +792,8 @@ Size LKS94Projection::GetTileMatrixMaxXY(int const& zoom) } } + +#ifdef Q_OS_LINUX +#pragma GCC diagnostic pop +#endif + diff --git a/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp b/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp index a6a2ba3066b5da21f45d1a0a9940d1628ad0c0fc..81b47b6d7748da54114dbb6862a04ec6afaf76e1 100644 --- a/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp +++ b/libs/opmapcontrol/src/internals/projections/mercatorprojectionyandex.cpp @@ -57,6 +57,16 @@ Point MercatorProjectionYandex::FromLatLngToPixel(double lat, double lng, const return ret; } + +// These pragmas are local modifications to this third party library to silence warnings +#ifdef Q_OS_LINUX +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#elif defined(Q_OS_MAC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#endif + internals::PointLatLng MercatorProjectionYandex::FromPixelToLatLng(const int &x, const int &y, const int &zoom) { Size s = GetTileMatrixSizePixel(zoom); @@ -82,6 +92,11 @@ internals::PointLatLng MercatorProjectionYandex::FromPixelToLatLng(const int &x, return ret; } + +#ifndef Q_OS_WIN +#pragma GCC diagnostic pop +#endif + double MercatorProjectionYandex::Clip(const double &n, const double &minValue, const double &maxValue) const { return qMin(qMax(n, minValue), maxValue); diff --git a/libs/qwt/qwt_plot_spectrogram.cpp b/libs/qwt/qwt_plot_spectrogram.cpp index 152a6a38129904cf76d211f7d124e4fc5e964307..75622ab7eeed2228d6cf46ba6cfd73a53c3054c5 100644 --- a/libs/qwt/qwt_plot_spectrogram.cpp +++ b/libs/qwt/qwt_plot_spectrogram.cpp @@ -533,6 +533,15 @@ QwtRasterData::ContourLines QwtPlotSpectrogram::renderContourLines( d_data->contourLevels, d_data->conrecAttributes ); } +// These pragmas are local modifications to this third party library to silence warnings +#ifdef Q_OS_LINUX +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#elif defined(Q_OS_MAC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" +#endif + /*! Paint the contour lines @@ -578,6 +587,10 @@ void QwtPlotSpectrogram::drawContourLines(QPainter *painter, } } +#ifndef Q_OS_WIN +#pragma GCC diagnostic pop +#endif + /*! \brief Draw the spectrogram diff --git a/libs/qwt/qwt_plot_zoomer.h b/libs/qwt/qwt_plot_zoomer.h index eb27059b8e7262a0792ec419a971301ffe8ba930..9904c53aeebb59a186981bdab35b22f7f8d3d5eb 100644 --- a/libs/qwt/qwt_plot_zoomer.h +++ b/libs/qwt/qwt_plot_zoomer.h @@ -85,8 +85,19 @@ public: public slots: void moveBy(double x, double y); + +// These pragmas are local modifications to this third party library to silence warnings +#ifndef Q_OS_WIN +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Woverloaded-virtual" +#endif + virtual void move(double x, double y); +#ifndef Q_OS_WIN +#pragma GCC diagnostic pop +#endif + virtual void zoom(const QwtDoubleRect &); virtual void zoom(int up); diff --git a/libs/serialport/qserialport.pri b/libs/serialport/qserialport.pri index 9de6a7ab05f6d50072774e49bc7adb53c0609e04..1210834c2434eebff91a90fab7806c7370ec27cb 100644 --- a/libs/serialport/qserialport.pri +++ b/libs/serialport/qserialport.pri @@ -55,4 +55,4 @@ unix:!symbian { } } -HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS +HEADERS *= $$PUBLIC_HEADERS $$PRIVATE_HEADERS diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index e16dc23f70a3685949fd1a324bf15994f904025a..4e0fec940cf7edd4e8a13c9a09da4117a17150d8 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -117,16 +117,23 @@ WindowsBuild { } # -# Warnings cleanup. Plan of attack is to turn on warnings as error once all warnings are fixed. Please -# do no change the warning level from what they are currently set to below. +# We treat all warnings as errors which must be fixed before proceeding. If you run into a problem you can't fix +# you can always use local pragmas to work around the warning. This should be used sparingly and only in cases where +# the problem absolultey can't be fixed. # MacBuild | LinuxBuild { QMAKE_CXXFLAGS_WARN_ON += -Wall } +MacBuild { + QMAKE_CXXFLAGS_WARN_ON += -Werror +} + WindowsBuild { - QMAKE_CXXFLAGS_WARN_ON += /W3 + QMAKE_CXXFLAGS_WARN_ON += /W3 \ + /wd4996 \ # silence warnings about deprecated strcpy and whatnot + /wd4290 # ignore exception specifications } # diff --git a/src/comm/MAVLinkProtocol.cc b/src/comm/MAVLinkProtocol.cc index 66f0280d8d9fe78537e1766bd2d6b4bd7298f76d..2dc631c0bdcf8955618e161c46a7b3e88af803f2 100644 --- a/src/comm/MAVLinkProtocol.cc +++ b/src/comm/MAVLinkProtocol.cc @@ -196,15 +196,7 @@ void MAVLinkProtocol::linkStatusChanged(bool connected) // Start NSH const char init[] = {0x0d, 0x0d, 0x0d}; link->writeBytes(init, sizeof(init)); - - // Stop any running mavlink instance - const char* cmd = "mavlink stop\n"; - link->writeBytes(cmd, strlen(cmd)); - link->writeBytes(init, 2); - cmd = "uorb start"; - link->writeBytes(cmd, strlen(cmd)); - link->writeBytes(init, 2); - cmd = "sh /etc/init.d/rc.usb\n"; + const char* cmd = "sh /etc/init.d/rc.usb\n"; link->writeBytes(cmd, strlen(cmd)); link->writeBytes(init, 4); } diff --git a/src/qgcunittest/MockUAS.h b/src/qgcunittest/MockUAS.h index 418df5d5b7581ed802f6695f8d0b6b110f68bbff..8f6ad10b430f5d2d7c0b8651906d919e7eeddafd 100644 --- a/src/qgcunittest/MockUAS.h +++ b/src/qgcunittest/MockUAS.h @@ -168,6 +168,9 @@ public slots: virtual void sendHilGps(quint64 time_us, double lat, double lon, double alt, int fix_type, float eph, float epv, float vel, float vn, float ve, float vd, float cog, int satellites) { Q_UNUSED(time_us); Q_UNUSED(lat); Q_UNUSED(lon); Q_UNUSED(alt); Q_UNUSED(fix_type); Q_UNUSED(eph); Q_UNUSED(epv); Q_UNUSED(vel); Q_UNUSED(vn); Q_UNUSED(ve); Q_UNUSED(vd); Q_UNUSED(cog); Q_UNUSED(satellites); Q_ASSERT(false); }; + virtual bool isRotaryWing() { Q_ASSERT(false); return false; } + virtual bool isFixedWing() { Q_ASSERT(false); return false; } + private: int _systemType; int _systemId; diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 668ad78c97c20bdc7a2890b7bce0a2b1b0c2d6fd..198fdee7bbef873ec346a9327effbccb68f8cc8e 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -2115,7 +2115,7 @@ void UAS::requestImage() if (imagePacketsArrived == 0) { mavlink_message_t msg; - mavlink_msg_data_transmission_handshake_pack(mavlink->getSystemId(), mavlink->getComponentId(), &msg, DATA_TYPE_JPEG_IMAGE, 0, 0, 0, 0, 0, 50); + mavlink_msg_data_transmission_handshake_pack(mavlink->getSystemId(), mavlink->getComponentId(), &msg, MAVLINK_DATA_STREAM_IMG_JPEG, 0, 0, 0, 0, 0, 50); sendMessage(msg); } } @@ -2170,6 +2170,32 @@ void UAS::readParametersFromStorage() sendMessage(msg); } +bool UAS::isRotaryWing() +{ + switch (type) { + case MAV_TYPE_QUADROTOR: + /* fallthrough */ + case MAV_TYPE_COAXIAL: + case MAV_TYPE_HELICOPTER: + case MAV_TYPE_HEXAROTOR: + case MAV_TYPE_OCTOROTOR: + case MAV_TYPE_TRICOPTER: + return true; + default: + return false; + } +} + +bool UAS::isFixedWing() +{ + switch (type) { + case MAV_TYPE_FIXED_WING: + return true; + default: + return false; + } +} + /** * @param rate The update rate in Hz the message should be sent */ diff --git a/src/uas/UAS.h b/src/uas/UAS.h index 9db1399a78ccd600a3cf356945aa47b2c4821b10..c24b3cb14847cfa0ffdb3d33a919702730497d8b 100644 --- a/src/uas/UAS.h +++ b/src/uas/UAS.h @@ -306,6 +306,9 @@ public: return nedAttGlobalOffset; } + bool isRotaryWing(); + bool isFixedWing(); + #if defined(QGC_PROTOBUF_ENABLED) && defined(QGC_USE_PIXHAWK_MESSAGES) px::GLOverlay getOverlay() { diff --git a/src/uas/UASInterface.h b/src/uas/UASInterface.h index 5a863a982ca888caebcd93f810d517a971606304..6395674eaa683d2e7ea4af968ecb2ed929645693 100644 --- a/src/uas/UASInterface.h +++ b/src/uas/UASInterface.h @@ -267,6 +267,9 @@ public: */ virtual QList getActions() const = 0; + static const unsigned int WAYPOINT_RADIUS_DEFAULT_FIXED_WING = 25; + static const unsigned int WAYPOINT_RADIUS_DEFAULT_ROTARY_WING = 5; + public slots: /** @brief Set a new name for the system */ @@ -376,6 +379,11 @@ public slots: virtual void startGyroscopeCalibration() = 0; virtual void startPressureCalibration() = 0; + /** @brief Return if this a rotary wing */ + virtual bool isRotaryWing() = 0; + /** @brief Return if this is a fixed wing */ + virtual bool isFixedWing() = 0; + /** @brief Set the current battery type and voltages */ virtual void setBatterySpecs(const QString& specs) = 0; /** @brief Get the current battery type and specs */ @@ -393,7 +401,6 @@ public slots: /** @brief Send raw GPS for sensor HIL */ virtual void sendHilGps(quint64 time_us, double lat, double lon, double alt, int fix_type, float eph, float epv, float vel, float vn, float ve, float vd, float cog, int satellites) = 0; - protected: QColor color; diff --git a/src/uas/UASWaypointManager.cc b/src/uas/UASWaypointManager.cc index 888a548e707cf80f7f696e12be379991bccefcb9..6202798cc3168ed9383a2e3552414839f85d4407 100644 --- a/src/uas/UASWaypointManager.cc +++ b/src/uas/UASWaypointManager.cc @@ -225,6 +225,17 @@ void UASWaypointManager::handleWaypointAck(quint8 systemId, quint8 compId, mavli current_state = WP_IDLE; readWaypoints(false); //Update "Onboard Waypoints"-tab immidiately after the waypoint list has been sent. emit updateStatusString("done."); + } else if((current_state == WP_SENDLIST || current_state == WP_SENDLIST_SENDWPS) && wpa->type != 0) { + //give up transmitting if a WP is rejected + if (wpa->type == 1) { + emit updateStatusString("upload failed: general error"); + } else if (wpa->type == 2) { + emit updateStatusString("upload failed: coordinate frame unsupported."); + } else { + emit updateStatusString("upload failed: other error."); + } + protocol_timer.stop(); + current_state = WP_IDLE; } else if(current_state == WP_CLEARLIST) { protocol_timer.stop(); current_state = WP_IDLE; @@ -905,7 +916,7 @@ void UASWaypointManager::writeWaypoints() sendWaypointCount(); } else if (waypointsEditable.count() == 0) { - sendWaypointClearAll(); + clearWaypointList(); } } else @@ -1063,11 +1074,23 @@ int UASWaypointManager::getFrameRecommendation() float UASWaypointManager::getAcceptanceRadiusRecommendation() { - if (waypointsEditable.count() > 0) { + if (waypointsEditable.count() > 0) + { return waypointsEditable.last()->getAcceptanceRadius(); - } else { - return 10.0f; } + else + { + if (uas->isRotaryWing()) + { + return UASInterface::WAYPOINT_RADIUS_DEFAULT_ROTARY_WING; + } + else if (uas->isFixedWing()) + { + return UASInterface::WAYPOINT_RADIUS_DEFAULT_FIXED_WING; + } + } + + return 10.0f; } float UASWaypointManager::getHomeAltitudeOffsetDefault() diff --git a/src/ui/WaypointList.cc b/src/ui/WaypointList.cc index 673cfd1245a8aaf0a9c5ae8053f49dc1d346ede0..5d31b7fa17e0fce3ed5d2a3871821330e009b0e7 100644 --- a/src/ui/WaypointList.cc +++ b/src/ui/WaypointList.cc @@ -283,9 +283,9 @@ void WaypointList::addEditable(bool onCurrentPosition) wp->setZ(last->getZ()); } wp->setParam1(last->getParam1()); - wp->setParam1(last->getParam2()); - wp->setParam1(last->getParam3()); - wp->setParam1(last->getParam4()); + wp->setParam2(last->getParam2()); + wp->setParam3(last->getParam3()); + wp->setParam4(last->getParam4()); wp->setAutocontinue(last->getAutoContinue()); // wp->blockSignals(false); wp->setAction(last->getAction()); diff --git a/src/ui/map3D/Q3DWidget.h b/src/ui/map3D/Q3DWidget.h index 32b9dc46415567c443e16b3a3c18ca99280129ad..037de8aa9b01916fe5bb3cdd10510602d25e3c43 100644 --- a/src/ui/map3D/Q3DWidget.h +++ b/src/ui/map3D/Q3DWidget.h @@ -39,8 +39,20 @@ This file is part of the QGROUNDCONTROL project #include #include #include + +// OpenSceneGraph has overloaded virtuals defined, since third party code we silence the warnings when the +// headers are used. +#ifndef Q_OS_WIN +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Woverloaded-virtual" +#endif + #include +#ifndef Q_OS_WIN +#pragma GCC diagnostic pop +#endif + #include "CameraParams.h" #include "GCManipulator.h" #include "SystemGroupNode.h"