Browse Source
* Add jsbsim bridge to enable jsbsim for px4 SITL/HIL on jsbsim This is a PX4 HIL/SITL integration into JSBSim. JSBSim is an open source flight dynamics model (http://jsbsim.sourceforge.net/) Currently there are three models available which is the rascal, quadrotor_x, hexarotor_x integrated into the bridge. The simulation can be run with the firmware with the following command for example ``` make px4_sitl jsbsim_rascal ``` The visualization is done flightgear and is done by the bridge sending UDP packets to flightgear. To disable the visualization `HEADLESS=1` when running the make command. The simulation can be configured through the configuration files under the `config` directory through a xml file. Senor configurations, The xml file name should match the name of the model. * Update Tools/sitl_run.sh Co-authored-by: Beat Küng <beat-kueng@gmx.net> Co-authored-by: Beat Küng <beat-kueng@gmx.net>sbg
7 changed files with 202 additions and 1 deletions
@ -0,0 +1,12 @@
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh |
||||
# |
||||
# @name Quadrotor SITL model for JSBSim |
||||
# |
||||
# @type Quadrotor Wide |
||||
# |
||||
# @maintainer Jaeyoung Lim <jaeyoung@auterion.com> |
||||
# |
||||
|
||||
sh /etc/init.d/rc.mc_defaults |
||||
|
||||
set MIXER quad_w |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh |
||||
# |
||||
# @name Hexacopter SITL model for JSBSim |
||||
# |
||||
# @type Hexarotor x |
||||
# |
||||
# @maintainer Jaeyoung Lim <jaeyoung@auterion.com> |
||||
# |
||||
|
||||
sh /etc/init.d/rc.mc_defaults |
||||
|
||||
if [ $AUTOCNF = yes ] |
||||
then |
||||
param set MC_PITCHRATE_P 0.1 |
||||
param set MC_PITCHRATE_I 0.05 |
||||
param set MC_PITCH_P 6.0 |
||||
param set MC_ROLLRATE_P 0.15 |
||||
param set MC_ROLLRATE_I 0.1 |
||||
param set MC_ROLL_P 6.0 |
||||
param set MPC_XY_VEL_I_ACC 4 |
||||
param set MPC_XY_VEL_P_ACC 3 |
||||
|
||||
param set RTL_DESCEND_ALT 10 |
||||
param set RTL_LAND_DELAY 0 |
||||
|
||||
param set TRIG_INTERFACE 3 |
||||
param set TRIG_MODE 4 |
||||
param set MNT_MODE_IN 4 |
||||
param set MNT_DO_STAB 2 |
||||
param set MAV_PROTO_VER 2 |
||||
fi |
||||
|
||||
set MAV_TYPE 13 |
||||
|
||||
set MIXER hexa_x |
@ -0,0 +1 @@
@@ -0,0 +1 @@
|
||||
Subproject commit efe19dbec7e82784a48c6b6e7710f54468c8a8d4 |
@ -0,0 +1,40 @@
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash |
||||
# |
||||
# Setup environment to make JSBSim visible to PX4. |
||||
# |
||||
# License: according to LICENSE.md in the root directory of the PX4 Firmware repository |
||||
|
||||
if [ "$#" != 3 ]; then |
||||
echo -e "usage: source setup_jsbsim.bash src_dir build_dir model\n" |
||||
return 1 |
||||
fi |
||||
|
||||
SRC_DIR="$1" |
||||
BUILD_DIR="$2" |
||||
MODEL="$3" |
||||
|
||||
export FG_AIRCRAFT="${SRC_DIR}/Tools/jsbsim_bridge/models" |
||||
|
||||
# This is needed for aircraft namespace mapping |
||||
# Need more architectural discussions to make this more scalable |
||||
case "$MODEL" in |
||||
rascal) |
||||
AIRCRAFT_DIR="Rascal" |
||||
MODEL_NAME="Rascal110-JSBSim" |
||||
;; |
||||
quadrotor_x) |
||||
AIRCRAFT_DIR="quadrotor_x" |
||||
MODEL_NAME="quadrotor_x" |
||||
;; |
||||
hexarotor_x) |
||||
AIRCRAFT_DIR="hexarotor_x" |
||||
MODEL_NAME="hexarotor_x" |
||||
;; |
||||
*) |
||||
echo "Unknown Model" |
||||
exit 1 |
||||
|
||||
esac |
||||
|
||||
export JSBSIM_AIRCRAFT_DIR="$AIRCRAFT_DIR" |
||||
export JSBSIM_AIRCRAFT_MODEL="$MODEL_NAME" |
Loading…
Reference in new issue