Tools: add env variable to disable follow mode

This adds the env variable PX4_NO_FOLLOW_MODE to disable the follow mode
in Gazebo.
This commit is contained in:
Julian Oes 2021-03-11 18:19:39 +01:00
parent 4a7b2c490a
commit c13266ad26
1 changed files with 8 additions and 1 deletions

View File

@ -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