Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/build_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build Tests

on:
push:
branches:
- 'master'
pull_request:
branches:
- '*'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
ubuntu_release: [
bionic
]
container: px4io/px4-dev-simulation-${{ matrix.ubuntu_release }}:2020-04-01
steps:
- uses: actions/checkout@v1
with:
token: ${{ secrets.ACCESS_TOKEN }}
- name: build
run:
mkdir build;
cd build;
cmake ..;
make
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[submodule "models/FlightGear-Rascal"]
path = models/FlightGear-Rascal
path = models/Rascal
url = https://github.com/ThunderFly-aerospace/FlightGear-Rascal.git
[submodule "models/FlightGear-TF-G1"]
path = models/TF-G1
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# FlightGear Bridge

![Build Tests](https://github.com/PX4/PX4-FlightGear-Bridge/workflows/Build%20Tests/badge.svg)

The FlightGear alternative to the current PX4's mainstream simulator Gazebo.

![FlightGear SITL connected with PX4 and QGroundControl](art/screenshot.png)
Expand Down
1 change: 0 additions & 1 deletion models/FlightGear-Rascal
Submodule FlightGear-Rascal deleted from 13da7d
1 change: 1 addition & 0 deletions models/Rascal
Submodule Rascal added at 5e7529
47 changes: 47 additions & 0 deletions scripts/vehicle1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash
# get absolute path of models folder
SCRIPT=$(readlink -f $0)
ROOT_DIR=`dirname $SCRIPT`/../
FIRMWARE_DIR=`dirname $SCRIPT`/../../../
MODEL_PATH=${ROOT_DIR}/models

export FG_BINARY=fgfs
export FG_MODELS_DIR=${MODEL_PATH}
export FG_ARGS_EX="--allow-nasal-read=${MODEL_PATH} \
--callsign=TF-A1 \
--offset-distance=0.005 \
--offset-azimuth=310 \
--ignore-autosave \
--disable-hold-short \
--prop:input/joysticks/js=0 \
--disable-mouse-pointer \
--multiplay=out,10,127.0.0.1,5000 \
--multiplay=in,10,127.0.0.1,5001"
export PX4_ID=0
export model="rascal"

#expect that we have builded target px4_sitl_nolockstep with FlightGear bridge
#by px4_sitl_nolockstep flightgear_rascal

src_path=${FIRMWARE_DIR}
build_path=${FIRMWARE_DIR}"/build/px4_sitl_nolockstep/"
sitl_bin=${build_path}"/bin/px4"

#copied form sitl_run.sh
rootfs="$build_path/tmp/rootfs_"$PX4_ID # this is the working directory
mkdir -p "$rootfs"

cd "${src_path}/Tools/flightgear_bridge/"
"${src_path}/Tools/flightgear_bridge/FG_run.py" "models/"${model}".json" $PX4_ID
"${build_path}/build_flightgear_bridge/flightgear_bridge" $PX4_ID `./get_FGbridge_params.py "models/"${model}".json"` &
FG_BRIDGE_PID=`echo $!`

cd ${rootfs}
sitl_command="\"$sitl_bin\" $no_pxh \"$src_path\"/ROMFS/px4fmu_common -s etc/init.d-posix/rcS -t \"$src_path\"/test_data -i $PX4_ID"
echo $sitl_command

export PX4_SIM_MODEL=${model}
eval $sitl_command

kill $FG_BRIDGE_PID
kill -9 `cat /tmp/px4fgfspid_$PX4_ID`
47 changes: 47 additions & 0 deletions scripts/vehicle2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash
# get absolute path of models folder
SCRIPT=$(readlink -f $0)
ROOT_DIR=`dirname $SCRIPT`/../
FIRMWARE_DIR=`dirname $SCRIPT`/../../../
MODEL_PATH=${ROOT_DIR}/models

export FG_BINARY=fgfs
export FG_MODELS_DIR=${MODEL_PATH}
export FG_ARGS_EX="--allow-nasal-read=${MODEL_PATH} \
--callsign=TF-A2 \
--offset-distance=0.02 \
--offset-azimuth=310 \
--ignore-autosave \
--disable-hold-short \
--prop:input/joysticks/js=0 \
--disable-mouse-pointer \
--multiplay=out,10,127.0.0.1,5001 \
--multiplay=in,10,127.0.0.1,5000"
export PX4_ID=1
export model="rascal"

#expect that we have builded target px4_sitl_nolockstep with FlightGear bridge
#by px4_sitl_nolockstep flightgear_rascal

src_path=${FIRMWARE_DIR}
build_path=${FIRMWARE_DIR}"/build/px4_sitl_nolockstep/"
sitl_bin=${build_path}"/bin/px4"

#copied form sitl_run.sh
rootfs="$build_path/tmp/rootfs_"$PX4_ID # this is the working directory
mkdir -p "$rootfs"

cd "${src_path}/Tools/flightgear_bridge/"
"${src_path}/Tools/flightgear_bridge/FG_run.py" "models/"${model}".json" $PX4_ID
"${build_path}/build_flightgear_bridge/flightgear_bridge" $PX4_ID `./get_FGbridge_params.py "models/"${model}".json"` &
FG_BRIDGE_PID=`echo $!`

cd ${rootfs}
sitl_command="\"$sitl_bin\" $no_pxh \"$src_path\"/ROMFS/px4fmu_common -s etc/init.d-posix/rcS -t \"$src_path\"/test_data -i $PX4_ID"
echo $sitl_command

export PX4_SIM_MODEL=${model}
eval $sitl_command

kill $FG_BRIDGE_PID
kill -9 `cat /tmp/px4fgfspid_$PX4_ID`