Skip to content

Commit

Permalink
decktx: Add initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
PixelyIon committed Jul 31, 2024
0 parents commit 8b6ff5a
Show file tree
Hide file tree
Showing 23 changed files with 4,607 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
BasedOnStyle: WebKit
AccessModifierOffset: -2
AlignEscapedNewlines: Left
AlignOperands: Align
AllowShortEnumsOnASingleLine: false
RemoveBracesLLVM: true
AllowShortFunctionsOnASingleLine: Empty
BraceWrapping:
AfterFunction: false
BreakBeforeBraces: Attach
CompactNamespaces: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
Cpp11BracedListStyle: true
IndentCaseBlocks: true
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
PackConstructorInitializers: Never
SpaceBeforeCpp11BracedList: false
SpaceInEmptyBlock: false
SpacesInContainerLiterals: false
NamespaceIndentation: Inner
AlignConsecutiveMacros:
Enabled: true
InsertTrailingCommas: Wrapped
BinPackArguments: false
BinPackParameters: false
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build/
.cache/
.vscode
.vs
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "external/imgui"]
path = external/imgui
url = https://github.com/ocornut/imgui/
31 changes: 31 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)

project(DeckTX LANGUAGES CXX C VERSION 1.0.0)

# Dependencies
set(BUILD_TESTS OFF)
set(BUILD_SHARED_LIBS OFF)

# CPM
include(external/CPM.cmake)

CPMAddPackage("gh:fmtlib/fmt#11.0.1")
CPMAddPackage("gh:libsdl-org/SDL#9406a9d527fc4436ade12ca3ce1e6c2e617e8ead")

# IMGUI
include(external/imgui.cmake)

# DeckTX
add_executable(DeckTX src/main.cpp src/crsf/crsf.cpp src/serial/serial.cpp)
target_include_directories(DeckTX PRIVATE src)

set_property(TARGET DeckTX PROPERTY CXX_STANDARD 23)
target_link_libraries(DeckTX fmt imgui SDL3::SDL3)

# Install
if(WIN32 AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Default install path" FORCE)
endif()

install(TARGETS DeckTX DESTINATION "${CMAKE_INSTALL_PREFIX}")
install(FILES "${PROJECT_SOURCE_DIR}/LICENSE" "${PROJECT_SOURCE_DIR}/README.md" DESTINATION "${CMAKE_INSTALL_PREFIX}")
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
### DeckTX

#### Description

A dedicated radio transmitter (TX) is conventionally needed to control drones, but any PC (such as the [Steam Deck](https://store.steampowered.com/steamdeck)) can operate as a TX when connected to a TX module, the component that's responsible for communicating with a drone over radio waves. This is plausible using external TX modules (such as the [BetaFPV SuperG Nano](https://betafpv.com/products/superg-nano-transmitter)) which are sold seperately from the radio transmitter, these often contain a USB port for flashing firmware but can be repurposed for communicating with the module itself.

[ExpressLRS](https://www.expresslrs.org/) is the open-source firmware that most modern TX modules run, these are the target of the project and any device configuration is entirely limited to these devices. The process for connecting the module to a PC involves changing the TX/RX pins to the USB ones if available alongside disabling the backpack since it uses the USB RX/TX pins by default, which needs to be done via changing these values within the ExpressLRS's firmware directly and flashing it or if the TX module supports WiFi then using the `{DEVICE_IP}/hardware.html` page. All approaches are covered in more detail [here](https://github.com/kaack/elrs-joystick-control/blob/2b8031a285bde361b8e9e5339518a4fddbdd51d0/README.md#connecting-to-the-elrs-transmitter).

#### Similar Projects

The core approach is identical to [ELRS Joystick Control](https://github.com/kaack/elrs-joystick-control), the primary difference is that DeckTX is a standalone C++ application that has an integrated UI, any external applications aren't needed to utilize it. On the other hand, ELRS Joystick Control hosts a gRPC server and web-app which needs to be connected to via a browser. Another major difference, is that DeckTX can work directly on a Steam Deck running SteamOS, while ELRS Joystick Control can only work on the Steam Deck when running Windows, at the time of writing.

It should be noted that both approaches have different tradeoffs, a browser-based UI isn't as lightweight or performant as a native application but has far more flexibility in terms of UI design and certain rich components such as maps to display GPS data can be trivially added, while being far more difficult to do on the UI framework used by DeckTX.

#### License

DeckTX is licensed at GPL 3.0 as a whole package, since the vast majority of the ecosystem (ExpressLRS, EdgeTX, etc) uses GPL licenses. Certain files are individually licensed at MIT/MPL 2.0 out of preference for a more open license, this is indicated in the SPDX header.
Loading

0 comments on commit 8b6ff5a

Please sign in to comment.