diff --git a/CMakeLists.txt b/CMakeLists.txt index 21974be991e4eed51a0b10e6ea46b4397e430897..e4038003b4e79968665b7719f2cde7c5f4289a7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,10 @@ set(CMAKE_AUTOUIC ON) set(CMAKE_AUTORCC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + add_compile_options(-Wall -Wextra -Wno-address-of-packed-member) +endif() + # CMake build type # Debug Release RelWithDebInfo MinSizeRel Coverage if (NOT CMAKE_BUILD_TYPE) @@ -142,7 +146,6 @@ set(QGC_RESOURCES qgcresources.qrc qgroundcontrol.qrc qgcimages.qrc - src/FirmwarePlugin/APM/APMResources.qrc src/FirmwarePlugin/PX4/PX4Resources.qrc src/Airmap/airmap.qrc diff --git a/ChangeLog.md b/ChangeLog.md index 3fa9ce4d842a394885838686a3f2706951274818..d67c4b62f92894a359c57ec44aad6d5403a4df73 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -6,6 +6,8 @@ Note: This file only contains high level features or important fixes. ### 3.6.0 - Daily Build +* Log Replay: Support changing speed of playback +* Basic object avoidance added to vehicles. * Added ability to set a joystick button to be single action or repeated action while the button is held down. * Rework joysticks. Fixed several issues and updated setup UI. * Adding support for UDP RTP h.265 video streams diff --git a/custom-example/res/CustomFlyView.qml b/custom-example/res/CustomFlyView.qml index c7e8f010a0568fab5d882fa6ca12f0dcfe29a32d..90760fa58bf758fe7d0b9bf9e1ed0eb08afec139 100644 --- a/custom-example/res/CustomFlyView.qml +++ b/custom-example/res/CustomFlyView.qml @@ -604,6 +604,26 @@ Item { } } //------------------------------------------------------------------------- + //-- Object Avoidance + Item { + visible: activeVehicle && activeVehicle.objectAvoidance.available && activeVehicle.objectAvoidance.enabled + anchors.centerIn: parent + width: parent.width * 0.5 + height: parent.height * 0.5 + Repeater { + model: activeVehicle && activeVehicle.objectAvoidance.gridSize > 0 ? activeVehicle.objectAvoidance.gridSize : [] + Rectangle { + width: ScreenTools.defaultFontPixelWidth + height: width + radius: width * 0.5 + color: distance < 0.25 ? "red" : "orange" + x: (parent.width * activeVehicle.objectAvoidance.grid(modelData).x) + (parent.width * 0.5) + y: (parent.height * activeVehicle.objectAvoidance.grid(modelData).y) + (parent.height * 0.5) + property real distance: activeVehicle.objectAvoidance.distance(modelData) + } + } + } + //------------------------------------------------------------------------- //-- Connection Lost While Armed Popup { id: connectionLostArmed diff --git a/custom-example/src/CustomPlugin.cc b/custom-example/src/CustomPlugin.cc index f715a4e681c9e38a02af37d5b4ab5b3368a37094..a0ba656d97a2196a69b524a3a751b1cfc2ab4b54 100644 --- a/custom-example/src/CustomPlugin.cc +++ b/custom-example/src/CustomPlugin.cc @@ -47,7 +47,7 @@ customQuickInterfaceSingletonFactory(QQmlEngine*, QJSEngine*) { qCDebug(CustomLog) << "Creating CustomQuickInterface instance"; CustomQuickInterface* pIFace = new CustomQuickInterface(); - CustomPlugin* pPlug = dynamic_cast(qgcApp()->toolbox()->corePlugin()); + auto* pPlug = qobject_cast(qgcApp()->toolbox()->corePlugin()); if(pPlug) { pIFace->init(); } else { diff --git a/custom-example/src/CustomVideoManager.cc b/custom-example/src/CustomVideoManager.cc index 7e72973da3ef2bc323109ee7d2554fb2fcb8bb39..047c66ebab2d785d97f17208bb9bbb2b7a86b6d8 100644 --- a/custom-example/src/CustomVideoManager.cc +++ b/custom-example/src/CustomVideoManager.cc @@ -26,7 +26,7 @@ CustomVideoManager::_updateSettings() return; //-- Check encoding if(_activeVehicle && _activeVehicle->dynamicCameras()) { - CustomCameraControl* pCamera = dynamic_cast(_activeVehicle->dynamicCameras()->currentCameraInstance()); + auto* pCamera = qobject_cast(_activeVehicle->dynamicCameras()->currentCameraInstance()); if(pCamera) { Fact *fact = pCamera->videoEncoding(); if (fact) { diff --git a/qgcimages.qrc b/qgcimages.qrc index 446cea18c16d5dbcd93ede94a573713954ec79bd..2da131ce591fcbc22cfce1fd8aefe8fc4a5e1d7e 100644 --- a/qgcimages.qrc +++ b/qgcimages.qrc @@ -1,6 +1,5 @@ - resources/camera.svg src/FlightMap/Images/adsbVehicle.svg src/AutoPilotPlugins/Common/Images/AirframeSimulation.svg src/AutoPilotPlugins/Common/Images/AirframeUnknown.svg @@ -59,6 +58,7 @@ src/FlightMap/Images/attitudePointer.svg src/FlightMap/Images/AwarenessAircraft.svg src/ui/toolbar/Images/Battery.svg + resources/camera.svg src/Camera/images/camera_photo.svg src/Camera/images/camera_video.svg src/AutoPilotPlugins/PX4/Images/CameraComponentIcon.png @@ -91,6 +91,7 @@ src/ui/toolbar/Images/Hamburger.svg src/FlightMap/Images/Help.svg src/FlightMap/Images/HelpBlack.svg + src/AutoPilotPlugins/PX4/Images/HITL.svg src/FlightMap/Images/Home.svg src/ui/toolbar/Images/Joystick.png src/AutoPilotPlugins/PX4/Images/LandMode.svg @@ -117,6 +118,7 @@ src/AutoPilotPlugins/Common/Images/MotorComponentIcon.svg src/AutoPilotPlugins/PX4/Images/no-logging-light.svg src/AutoPilotPlugins/PX4/Images/no-logging.svg + src/AutoPilotPlugins/PX4/Images/ObjectAvoidance.svg src/ui/toolbar/Images/PaperPlane.svg src/FlightMap/Images/PiP.svg src/FlightMap/Images/pipHide.svg diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 55ac49c3e5e56877588ad9046fd822c7f15fe73b..818ed0c97d9b2955a1ad70afed4dc05ca2189409 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -855,6 +855,7 @@ HEADERS+= \ src/Vehicle/MultiVehicleManager.h \ src/Vehicle/GPSRTKFactGroup.h \ src/Vehicle/Vehicle.h \ + src/Vehicle/VehicleObjectAvoidance.h \ src/VehicleSetup/VehicleComponent.h \ !MobileBuild { !NoSerialBuild { @@ -881,6 +882,7 @@ SOURCES += \ src/Vehicle/MultiVehicleManager.cc \ src/Vehicle/GPSRTKFactGroup.cc \ src/Vehicle/Vehicle.cc \ + src/Vehicle/VehicleObjectAvoidance.cc \ src/VehicleSetup/VehicleComponent.cc \ !MobileBuild { !NoSerialBuild { diff --git a/src/Airmap/AirMapAdvisoryManager.cc b/src/Airmap/AirMapAdvisoryManager.cc index de4a4d91335e21dd260559f998444ea8936a0eb6..29151da8ed1466724b675952c177f4744b2e0039 100644 --- a/src/Airmap/AirMapAdvisoryManager.cc +++ b/src/Airmap/AirMapAdvisoryManager.cc @@ -84,7 +84,7 @@ AirMapAdvisoryManager::_requestAdvisories() } params.geometry = Geometry(polygon); //-- Rulesets - AirMapRulesetsManager* pRulesMgr = dynamic_cast(qgcApp()->toolbox()->airspaceManager()->ruleSets()); + auto* pRulesMgr = qobject_cast(qgcApp()->toolbox()->airspaceManager()->ruleSets()); QString ruleIDs; if(pRulesMgr) { for(int rs = 0; rs < pRulesMgr->ruleSets()->count(); rs++) { diff --git a/src/Airmap/AirMapFlightPlanManager.cc b/src/Airmap/AirMapFlightPlanManager.cc index ff763255baa82408755f84739f458e8896d362b7..e49f47b92631f784cdc70e7553c3f2df736be9d8 100644 --- a/src/Airmap/AirMapFlightPlanManager.cc +++ b/src/Airmap/AirMapFlightPlanManager.cc @@ -428,7 +428,7 @@ AirMapFlightPlanManager::_createFlightPlan() void AirMapFlightPlanManager::_updateRulesAndFeatures(std::vector& rulesets, std::unordered_map& features, bool updateFeatures) { - AirMapRulesetsManager* pRulesMgr = dynamic_cast(qgcApp()->toolbox()->airspaceManager()->ruleSets()); + auto* pRulesMgr = qobject_cast(qgcApp()->toolbox()->airspaceManager()->ruleSets()); if(pRulesMgr) { for(int rs = 0; rs < pRulesMgr->ruleSets()->count(); rs++) { AirMapRuleSet* ruleSet = qobject_cast(pRulesMgr->ruleSets()->get(rs)); diff --git a/src/Airmap/CMakeLists.txt b/src/Airmap/CMakeLists.txt index 6952af9398d8654ca0cd3c14b252f1982040f5e7..1f8a0cd2088e84b16d1a687902e511091f73dfaf 100644 --- a/src/Airmap/CMakeLists.txt +++ b/src/Airmap/CMakeLists.txt @@ -17,6 +17,18 @@ if(QGC_AIRMAP) airmap.qrc ) + add_custom_target(AirmapQml + SOURCES + AirmapSettings.qml + AirspaceRegulation.qml + ComplianceRules.qml + FlightDetails.qml + RuleSelector.qml + AirspaceControl.qml + AirspaceWeather.qml + FlightBrief.qml + FlightFeature.qml + ) else() add_library(Airmap dummy/AirspaceManager.cc diff --git a/src/AnalyzeView/CMakeLists.txt b/src/AnalyzeView/CMakeLists.txt index a92627a29d9bfd006e7701a0dc45f185a9f69fdb..9f46fd9932f0719c6446a78ed362c2e8ae2016a8 100644 --- a/src/AnalyzeView/CMakeLists.txt +++ b/src/AnalyzeView/CMakeLists.txt @@ -17,6 +17,17 @@ add_library(AnalyzeView ${EXTRA_SRC} ) +add_custom_target( + AnalyzeViewQml +SOURCES + AnalyzePage.qml + AnalyzeView.qml + GeoTagPage.qml + LogDownloadPage.qml + MavlinkConsolePage.qml + MAVLinkInspectorPage.qml +) + target_link_libraries(AnalyzeView PRIVATE qgc diff --git a/src/AutoPilotPlugins/APM/CMakeLists.txt b/src/AutoPilotPlugins/APM/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..565e54157a17e8a03271c16ebbb1a27689f468f9 --- /dev/null +++ b/src/AutoPilotPlugins/APM/CMakeLists.txt @@ -0,0 +1,35 @@ +add_custom_target(APMAutoPilotPluginQml +SOURCES + APMAirframeComponent.qml + APMAirframeComponentSummary.qml + APMCameraComponent.qml + APMCameraComponentSummary.qml + APMCameraSubComponent.qml + APMFlightModesComponent.qml + APMFlightModesComponentSummary.qml + APMHeliComponent.qml + APMLightsComponent.qml + APMLightsComponentSummary.qml + APMNotSupported.qml + APMPowerComponent.qml + APMPowerComponentSummary.qml + APMRadioComponentSummary.qml + APMSafetyComponent.qml + APMSafetyComponentCopter.qml + APMSafetyComponentPlane.qml + APMSafetyComponentRover.qml + APMSafetyComponentSub.qml + APMSafetyComponentSummary.qml + APMSafetyComponentSummaryCopter.qml + APMSafetyComponentSummaryPlane.qml + APMSafetyComponentSummaryRover.qml + APMSafetyComponentSummarySub.qml + APMSensorsComponent.qml + APMSensorsComponentSummary.qml + APMSubFrameComponent.qml + APMSubFrameComponentSummary.qml + APMSubMotorComponent.qml + APMTuningComponentCopter.qml + APMTuningComponentSub.qml + +) \ No newline at end of file diff --git a/src/AutoPilotPlugins/CMakeLists.txt b/src/AutoPilotPlugins/CMakeLists.txt index 9d27b5e061f7cb8a17ec41d644d4a57a546bfc12..2a3776e928a7147d0b5c67c56586e350a999a9cb 100644 --- a/src/AutoPilotPlugins/CMakeLists.txt +++ b/src/AutoPilotPlugins/CMakeLists.txt @@ -1,4 +1,8 @@ +add_subdirectory(APM) +add_subdirectory(Common) +add_subdirectory(PX4) + add_library(AutoPilotPlugins APM/APMAirframeComponent.cc APM/APMAirframeComponentController.cc diff --git a/src/AutoPilotPlugins/Common/CMakeLists.txt b/src/AutoPilotPlugins/Common/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..60f3e8382b9ec1740a202ab16fdc7ef16de69373 --- /dev/null +++ b/src/AutoPilotPlugins/Common/CMakeLists.txt @@ -0,0 +1,9 @@ +add_custom_target(CommonAutoPilotPluginQml +SOURCES + ESP8266Component.qml + ESP8266ComponentSummary.qml + MotorComponent.qml + RadioComponent.qml + SetupPage.qml + SyslinkComponent.qml +) \ No newline at end of file diff --git a/src/AutoPilotPlugins/PX4/CMakeLists.txt b/src/AutoPilotPlugins/PX4/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..fcd4ae40461a97a9dee6272a0c8334f97489ebe9 --- /dev/null +++ b/src/AutoPilotPlugins/PX4/CMakeLists.txt @@ -0,0 +1,23 @@ +add_custom_target(PX4AutoPilotPluginQml +SOURCES + AirframeComponent.qml + AirframeComponentSummary.qml + CameraComponent.qml + CameraComponentSummary.qml + FlightModesComponentSummary.qml + PX4AdvancedFlightModes.qml + PX4FlightModes.qml + PX4RadioComponentSummary.qml + PX4SimpleFlightModes.qml + PX4TuningComponentCopter.qml + PX4TuningComponentPlane.qml + PX4TuningComponentVTOL.qml + PowerComponent.qml + PowerComponentSummary.qml + SafetyComponent.qml + SafetyComponentSummary.qml + SensorsComponent.qml + SensorsComponentSummary.qml + SensorsComponentSummaryFixedWing.qml + SensorsSetup.qml +) \ No newline at end of file diff --git a/src/AutoPilotPlugins/PX4/Images/HITL.svg b/src/AutoPilotPlugins/PX4/Images/HITL.svg new file mode 100644 index 0000000000000000000000000000000000000000..d8b318bac4e16fcfdc34f910b2296965b8a660a0 --- /dev/null +++ b/src/AutoPilotPlugins/PX4/Images/HITL.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/AutoPilotPlugins/PX4/Images/LandMode.svg b/src/AutoPilotPlugins/PX4/Images/LandMode.svg index d6dabab67e323daeeb4551e262252b916d8ba3c9..5a6f9801e7da7be140d71b467ee47ffa56f6c3fc 100644 --- a/src/AutoPilotPlugins/PX4/Images/LandMode.svg +++ b/src/AutoPilotPlugins/PX4/Images/LandMode.svg @@ -1,26 +1,24 @@ - + + viewBox="0 0 72 72" style="enable-background:new 0 0 72 72;" xml:space="preserve"> - + - - - + + + - + diff --git a/src/AutoPilotPlugins/PX4/Images/LandModeCopter.svg b/src/AutoPilotPlugins/PX4/Images/LandModeCopter.svg index 5cb700fba2acfb3934876d545002c59d084d4caa..fb79a66645404809a3f6f1af573c51a57df49bf4 100644 --- a/src/AutoPilotPlugins/PX4/Images/LandModeCopter.svg +++ b/src/AutoPilotPlugins/PX4/Images/LandModeCopter.svg @@ -1,10 +1,10 @@ - + + viewBox="0 0 72 72" style="enable-background:new 0 0 72 72;" xml:space="preserve"> - - - + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - + + + diff --git a/src/AutoPilotPlugins/PX4/Images/ObjectAvoidance.svg b/src/AutoPilotPlugins/PX4/Images/ObjectAvoidance.svg new file mode 100644 index 0000000000000000000000000000000000000000..34e1614770228c36781c105a6a58714c85950ef1 --- /dev/null +++ b/src/AutoPilotPlugins/PX4/Images/ObjectAvoidance.svg @@ -0,0 +1,78 @@ + + + + + + + Layer 1 + + + + + + + + + + + Layer 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/AutoPilotPlugins/PX4/Images/ReturnToHomeAltitude.svg b/src/AutoPilotPlugins/PX4/Images/ReturnToHomeAltitude.svg index e6c59e0438d6e937c47eeba50808eb3ef73e5a2a..0e2fe04779fb576b36088c65cf61a835802836b3 100644 --- a/src/AutoPilotPlugins/PX4/Images/ReturnToHomeAltitude.svg +++ b/src/AutoPilotPlugins/PX4/Images/ReturnToHomeAltitude.svg @@ -1,5 +1,5 @@ - +