From 65c98d9801ac335d19839beb184d81c5f6288b68 Mon Sep 17 00:00:00 2001 From: consti10 Date: Tue, 19 Sep 2023 20:13:45 +0200 Subject: [PATCH] delete obsolete mavsdk --- .github/workflows/ios.yml.txt | 3 +-- QOpenHD.pro | 4 ++-- README.md | 10 ++++------ app/telemetry/MavlinkTelemetry.cpp | 2 +- app/telemetry/MavlinkTelemetry.h | 4 ++-- app/telemetry/models/fcmavlinksystem.cpp | 4 ++-- app/telemetry/settings/mavlinksettingsmodel.h | 1 - app/telemetry/util/mavlink_include.h | 2 -- build_install_mavsdk_static.sh | 7 ------- install_build_dep.sh | 6 ------ lib/Readme.md | 9 +++++---- qml/ui/elements/AppSettings.qml | 2 +- 12 files changed, 18 insertions(+), 36 deletions(-) delete mode 100755 build_install_mavsdk_static.sh diff --git a/.github/workflows/ios.yml.txt b/.github/workflows/ios.yml.txt index 5d74e4fee..6075fce5d 100644 --- a/.github/workflows/ios.yml.txt +++ b/.github/workflows/ios.yml.txt @@ -29,8 +29,7 @@ jobs: - name: Install Dependencies run: | - - sudo ./build_install_mavsdk_static.sh + # TODO ? - name: Build with make run: | diff --git a/QOpenHD.pro b/QOpenHD.pro index 08f6bca98..c245d9714 100755 --- a/QOpenHD.pro +++ b/QOpenHD.pro @@ -76,7 +76,7 @@ INCLUDEPATH += $$PWD/lib INCLUDEPATH += $$PWD/app INCLUDEPATH += $$PWD/app/exp -# QOpenHD telemetry (mavlink, partially based on MAVSDK) features +# QOpenHD telemetry (mavlink) # REQUIRED - without it QOpenHD will compile, but be pretty much non functional include(app/telemetry/telemetry.pri) @@ -231,7 +231,7 @@ JetsonBuild { } WindowsBuild { - # This aparently makes qt use absolute paths, otherwise we get problems with mavsdk + # This aparently makes qt use absolute paths, otherwise we get compile issues ? QMAKE_PROJECT_DEPTH = 0 } diff --git a/README.md b/README.md index a95e808a2..05465c24d 100644 --- a/README.md +++ b/README.md @@ -76,13 +76,11 @@ We have a CI setup that checks compilation on Ubuntu. You can review the steps i 4. Download Qt 5.15.0+ for Android (not for the OS you're building on). 5. Clone the source code as mentioned earlier. -### Building MAVSDK (REQUIRED) +### Building QOpenHD -QOpenHD relies on the MAVSDK library. After recursively cloning qopenhd, build and install it: -``` -./build_install_mavsdk_static.sh -``` -You can then build QOpenHD by opening it in QT Creator or building it with the following commands: +Step 1) clone this repository with --recurse-submodules +Step 2) install all dependencies +Step 3) recommended - open in QT creator. Otherwise, you can build QOpenHD via the command line: ``` mkdir build cd build diff --git a/app/telemetry/MavlinkTelemetry.cpp b/app/telemetry/MavlinkTelemetry.cpp index dbe7ac003..b8a70d995 100644 --- a/app/telemetry/MavlinkTelemetry.cpp +++ b/app/telemetry/MavlinkTelemetry.cpp @@ -248,7 +248,7 @@ void MavlinkTelemetry::ping_all_systems() mavlink_message_t msg; mavlink_timesync_t timesync{}; timesync.tc1=0; - // NOTE: MAVSDK does time in nanoseconds by default + // Ardupilot seems to use us m_last_timesync_out_us=QOpenHDMavlinkHelper::getTimeMicroseconds(); timesync.ts1=m_last_timesync_out_us; mavlink_msg_timesync_encode(QOpenHDMavlinkHelper::get_own_sys_id(),QOpenHDMavlinkHelper::get_own_comp_id(),&msg,×ync); diff --git a/app/telemetry/MavlinkTelemetry.h b/app/telemetry/MavlinkTelemetry.h index 070aa259a..226e20ccc 100644 --- a/app/telemetry/MavlinkTelemetry.h +++ b/app/telemetry/MavlinkTelemetry.h @@ -15,15 +15,15 @@ #include "connection/tcp_connection.h" /** - * Changed: Used to have custom UDP and TCP stuff, but now just uses MAVSDK - MAVSDK already has both TCP and UDP support. * * @brief This is the one and only (mavlink telemetry) connection of QOpenHD to OpenHD * (More specific, the OpenHD Ground Station - but since the Ground station forwards messages to the air pi, * one can indirectly also reach the air pi via the ground pi, as well as the mavlink FC connected to the air pi). * Its functionalities are simple: + * 1) "Connecting to the ground unit (either UDP or TCP)" * 1) sending mavlink messages to OpenHD * 2) receiving mavlink messages from OpenHD - * 3) Handling the mavsdk "system discovery" for our OpenHD mavlink network, which is defined by + * 3) Handling the "system discovery" for our OpenHD mavlink network, which is defined by * a) OHD Air unit (own sys id) * b) OHD Ground unit (own sys id) * c) Optional FC connected to the air unit diff --git a/app/telemetry/models/fcmavlinksystem.cpp b/app/telemetry/models/fcmavlinksystem.cpp index 93e697e67..6a2873de5 100644 --- a/app/telemetry/models/fcmavlinksystem.cpp +++ b/app/telemetry/models/fcmavlinksystem.cpp @@ -143,7 +143,7 @@ bool FCMavlinkSystem::process_message(const mavlink_message_t &msg) break; } case MAVLINK_MSG_ID_PARAM_VALUE:{ - // handled by params mavsdk + // handled by XParam break; } case MAVLINK_MSG_ID_GPS_RAW_INT:{ @@ -452,7 +452,7 @@ bool FCMavlinkSystem::process_message(const mavlink_message_t &msg) case MAVLINK_MSG_ID_EXTENDED_SYS_STATE:{ break; } - // Commands and Params are done by mavsdk + // Commands and Params are done by XParam / XCommand case MAVLINK_MSG_ID_PARAM_EXT_ACK: case MAVLINK_MSG_ID_PARAM_EXT_VALUE: case MAVLINK_MSG_ID_COMMAND_ACK: diff --git a/app/telemetry/settings/mavlinksettingsmodel.h b/app/telemetry/settings/mavlinksettingsmodel.h index dde60a576..e84236e68 100644 --- a/app/telemetry/settings/mavlinksettingsmodel.h +++ b/app/telemetry/settings/mavlinksettingsmodel.h @@ -91,7 +91,6 @@ public slots: const uint8_t m_sys_id; const uint8_t m_comp_id; bool is_param_whitelisted(const std::string param_id)const; - // The error codes are a bit less than what mavsdk returns, since we can merge some of them into a "unknown-this should never happen" value enum class SetParamResult{ BUSY, // Too many params queued up NO_CONNECTION, // Most likely all retransmitts failed, cannot be completely avoided diff --git a/app/telemetry/util/mavlink_include.h b/app/telemetry/util/mavlink_include.h index fed4c7db7..0b525a409 100644 --- a/app/telemetry/util/mavlink_include.h +++ b/app/telemetry/util/mavlink_include.h @@ -1,8 +1,6 @@ #ifndef MAVLINK_INCLUDE_H #define MAVLINK_INCLUDE_H -// We get mavlink from mavsdk -//#include #include "../../../lib/mavlink-headers/mavlink/v2.0/openhd/mavlink.h" diff --git a/build_install_mavsdk_static.sh b/build_install_mavsdk_static.sh deleted file mode 100755 index c0595e73a..000000000 --- a/build_install_mavsdk_static.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# NOTE: requires cloning with --recurse-submodules -# Build and install MAVSDK - this needs to be done only once - -echo "we're MAVSDK free since September 2023" -# Now the static libs are installed and can be found and statically linked by qmake \ No newline at end of file diff --git a/install_build_dep.sh b/install_build_dep.sh index c4fe9ece7..87770ec2e 100755 --- a/install_build_dep.sh +++ b/install_build_dep.sh @@ -21,9 +21,6 @@ PLATFORM_PACKAGES="" } function install_rock_packages { PLATFORM_PACKAGES="qml-module-qt-labs-platform" -} -function install_mavsdk { -bash build_install_mavsdk_static.sh || exit 1 } # Add OpenHD Repository platform-specific packages @@ -67,6 +64,3 @@ bash build_install_mavsdk_static.sh || exit 1 # Installing python packages gem install fpm -# Building MAVSDK -install_mavsdk - diff --git a/lib/Readme.md b/lib/Readme.md index 1949ff072..297b0ab89 100644 --- a/lib/Readme.md +++ b/lib/Readme.md @@ -1,9 +1,10 @@ Here are all the external libraries for QOpenHD -MAVSDK needs to be built and installed on your system to compile QOpenHD -The other libraries are built and included directly during the QOpenHD compilation process (qmake-compatible). +(Github submodules) + +Since QT is really bad at linking to non-qt libraries, we do not use any code / libraries we cannot build +diectly in this application (except ffmpeg / gstreamer for video) NOTE on mavlink: -We use a custom mavlink flavour (openhd). However, we also use MAVSDK for QOpenHD, and mavlink comes with MAVSDK by default. -Therefore, we don't have mavlink as a submodule here, but rather MAVSDK. +We use a custom mavlink flavour (openhd). diff --git a/qml/ui/elements/AppSettings.qml b/qml/ui/elements/AppSettings.qml index 08c6f19cb..4b43d2d2b 100644 --- a/qml/ui/elements/AppSettings.qml +++ b/qml/ui/elements/AppSettings.qml @@ -383,7 +383,7 @@ Settings { // really really dirty, i want to get rid of it as soon as possible property bool dirty_enable_inav_hacks: false - // FC discovery - annoying mavsdk + // FC discovery - can be annoying / tricky property bool dirty_enable_mavlink_fc_sys_id_check: false property int custom_cursor_type: 0