From cf9945ecdc642400a47b3ba76dda14aa100877c8 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Fri, 25 Nov 2016 16:04:12 +0000 Subject: [PATCH] sitl_run.sh: env variable NO_PXH for deamon mode This allows to set the environment variable NO_PXH to start SITL without the interactive pxh> shell. For this, px4 is called with the -d arg which sets it to deamon mode. This feature is handy to script sitl_run.sh. --- Tools/sitl_run.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Tools/sitl_run.sh b/Tools/sitl_run.sh index 3dbe53bb76..563c10a993 100755 --- a/Tools/sitl_run.sh +++ b/Tools/sitl_run.sh @@ -35,6 +35,13 @@ else sudo_enabled="" fi +# To disable user input +if [[ -n "$NO_PXH" ]]; then + no_pxh=-d +else + no_pxh="" +fi + if [ "$model" == "" ] || [ "$model" == "none" ] then echo "empty model, setting iris as default" @@ -111,7 +118,7 @@ fi # Do not exit on failure now from here on because we want the complete cleanup set +e -sitl_command="$sudo_enabled $sitl_bin $chroot_enabled $src_path $src_path/${rcS_dir}/${model}" +sitl_command="$sudo_enabled $sitl_bin $no_pxh $chroot_enabled $src_path $src_path/${rcS_dir}/${model}" echo SITL COMMAND: $sitl_command