From 1318e614ad91f822949ca6f16b8b1624aba07d0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Fri, 10 Aug 2018 19:22:41 +0200 Subject: [PATCH] SITL: handle 'make posix_sitl_shell' via unified rcS The command is now: 'make posix none_shell' which means: don't start a simulator and run a minimal shell only. --- ROMFS/px4fmu_common/init.d-posix/rcS | 12 +++++++----- cmake/configs/posix_sitl_shell.cmake | 5 ----- platforms/posix/cmake/sitl_target.cmake | 4 ++-- posix-configs/SITL/init/shell/iris | 13 ------------- 4 files changed, 9 insertions(+), 25 deletions(-) delete mode 100644 cmake/configs/posix_sitl_shell.cmake delete mode 100644 posix-configs/SITL/init/shell/iris diff --git a/ROMFS/px4fmu_common/init.d-posix/rcS b/ROMFS/px4fmu_common/init.d-posix/rcS index 00a4685b88..d18e87818e 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rcS +++ b/ROMFS/px4fmu_common/init.d-posix/rcS @@ -14,14 +14,13 @@ then exit 0 fi - -# TODO: In the future we want to share rc.autostart with NuttX -#source rc.autostart +RUN_MINIMAL_SHELL=no # Use the variable set by sitl_run.sh to choose the model settings. -if [ "$PX4_SIM_MODEL" == "iris" ]; then +if [ "$PX4_SIM_MODEL" == "shell" ]; then + set RUN_MINIMAL_SHELL yes +elif [ "$PX4_SIM_MODEL" == "iris" ]; then set REQUESTED_AUTOSTART 10016 - elif [ "$PX4_SIM_MODEL" == "typhoon_h480" ]; then set REQUESTED_AUTOSTART 6011 else @@ -35,6 +34,9 @@ then param load fi +# exit early when the minimal shell is requested +[ $RUN_MINIMAL_SHELL == yes ] && exit 0 + if param compare SYS_AUTOSTART $REQUESTED_AUTOSTART then set AUTOCNF no diff --git a/cmake/configs/posix_sitl_shell.cmake b/cmake/configs/posix_sitl_shell.cmake deleted file mode 100644 index bf9fcd1992..0000000000 --- a/cmake/configs/posix_sitl_shell.cmake +++ /dev/null @@ -1,5 +0,0 @@ -include(cmake/configs/posix_sitl_default.cmake) - -set(config_sitl_rcS_dir - posix-configs/SITL/init/shell - ) diff --git a/platforms/posix/cmake/sitl_target.cmake b/platforms/posix/cmake/sitl_target.cmake index e022f817a3..a5ce2c500d 100644 --- a/platforms/posix/cmake/sitl_target.cmake +++ b/platforms/posix/cmake/sitl_target.cmake @@ -45,9 +45,9 @@ ExternalProject_Add_Step(sitl_gazebo forceconfigure ) # create targets for each viewer/model/debugger combination -set(viewers none jmavsim gazebo replay) +set(viewers none jmavsim gazebo) set(debuggers none ide gdb lldb ddd valgrind callgrind) -set(models none iris iris_opt_flow iris_vision iris_rplidar iris_irlock standard_vtol plane solo tailsitter typhoon_h480 rover hippocampus tiltrotor) +set(models none shell iris iris_opt_flow iris_vision iris_rplidar iris_irlock standard_vtol plane solo tailsitter typhoon_h480 rover hippocampus tiltrotor) set(all_posix_vmd_make_targets) foreach(viewer ${viewers}) foreach(debugger ${debuggers}) diff --git a/posix-configs/SITL/init/shell/iris b/posix-configs/SITL/init/shell/iris deleted file mode 100644 index 37cb318959..0000000000 --- a/posix-configs/SITL/init/shell/iris +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/bash -# PX4 commands need the 'px4-' prefix in bash. -# (px4-alias.sh is expected to be in the PATH) -source px4-alias.sh - -uorb start - -param load -param set SYS_RESTART_TYPE 0 - -dataman start - -tone_alarm start