Skip to content
Roman Dvořák edited this page Jul 22, 2023 · 8 revisions

How to compile the TF-modified FlightGear sources

The following steps are mainly retrieved from the FlightGear documentation..

mkdir -p ~/flightgear/dnc-managed
cd ~/flightgear
git clone https://git.code.sf.net/p/flightgear/fgmeta
cd ~/flightgear/dnc-managed
~/flightgear/fgmeta/download_and_compile.sh -j$(nproc) --override-repo FGFS=GitHub:github.com/ThunderFly-aerospace/FlightGear.git --component-branch FGFS=tf/gear_fix SIMGEAR FGFS DATA

Alternatively, you could compile FlightGear upstream by following the command, it may solve possible incompatibilities of 'download_and_compile.sh' script and sources.

~/flightgear/fgmeta/download_and_compile.sh -j$(nproc) SIMGEAR FGFS DATA

Link compiled FlightGear to PX4-FlightGear-bridge

The compiled FlighGear could be used with PX4-FlightGear-Bridge in case of properly setting the FG_BINARY system variable.

export FG_BINARY=/home/${USER}/flightgear/dnc-managed/run_fgfs.sh

The also needs to be the path to FG models specified. It depends on your system. The example is

export FG_MODELS_DIR=/home/${USER}/repos/TF/PX4-FlightGear-Bridge/models