Skip to content

Commit

Permalink
delete obsolete mavsdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Consti10 committed Sep 19, 2023
1 parent f6e9659 commit 65c98d9
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 36 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ios.yml.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ jobs:

- name: Install Dependencies
run: |

sudo ./build_install_mavsdk_static.sh
# TODO ?

- name: Build with make
run: |
Expand Down
4 changes: 2 additions & 2 deletions QOpenHD.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
}

Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/telemetry/MavlinkTelemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,&timesync);
Expand Down
4 changes: 2 additions & 2 deletions app/telemetry/MavlinkTelemetry.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/telemetry/models/fcmavlinksystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:{
Expand Down Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion app/telemetry/settings/mavlinksettingsmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions app/telemetry/util/mavlink_include.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef MAVLINK_INCLUDE_H
#define MAVLINK_INCLUDE_H

// We get mavlink from mavsdk
//#include <mavsdk/plugins/mavlink_passthrough/mavlink_passthrough.h>

#include "../../../lib/mavlink-headers/mavlink/v2.0/openhd/mavlink.h"

Expand Down
7 changes: 0 additions & 7 deletions build_install_mavsdk_static.sh

This file was deleted.

6 changes: 0 additions & 6 deletions install_build_dep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -67,6 +64,3 @@ bash build_install_mavsdk_static.sh || exit 1
# Installing python packages
gem install fpm

# Building MAVSDK
install_mavsdk

9 changes: 5 additions & 4 deletions lib/Readme.md
Original file line number Diff line number Diff line change
@@ -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).
2 changes: 1 addition & 1 deletion qml/ui/elements/AppSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 65c98d9

Please sign in to comment.