From c13266ad269d1382d9dafa53fb9b27bb2580a6df Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Thu, 11 Mar 2021 18:19:39 +0100 Subject: [PATCH] Tools: add env variable to disable follow mode This adds the env variable PX4_NO_FOLLOW_MODE to disable the follow mode in Gazebo. --- 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 4118a807de..9f36364ab2 100755 --- a/Tools/sitl_run.sh +++ b/Tools/sitl_run.sh @@ -49,6 +49,13 @@ else verbose="" fi +# Disable follow mode +if [[ "$PX4_NO_FOLLOW_MODE" != "1" ]]; then + follow_mode="--gui-client-plugin libgazebo_user_camera_plugin.so" +else + follow_mode="" +fi + if [ "$program" == "jmavsim" ]; then jmavsim_pid=`ps aux | grep java | grep "\-jar jmavsim_run.jar" | awk '{ print $2 }'` if [ -n "$jmavsim_pid" ]; then @@ -163,7 +170,7 @@ elif [ "$program" == "gazebo" ] && [ ! -n "$no_sim" ]; then # gzserver needs to be running to avoid a race. Since the launch # is putting it into the background we need to avoid it by backing off sleep 3 - nice -n 20 gzclient --verbose --gui-client-plugin libgazebo_user_camera_plugin.so & + nice -n 20 gzclient --verbose $follow_mode & GUI_PID=$! fi else