Browse Source

Tools: abort SITL start if gzserver fails

Sometimes gzserver seems to not start or not start fast enough. In this
case, instead of stalling forever, it would be nice to abort.
sbg
Julian Oes 5 years ago
parent
commit
26021b01cb
  1. 5
      Tools/sitl_run.sh

5
Tools/sitl_run.sh

@ -105,8 +105,11 @@ elif [ "$program" == "gazebo" ] && [ ! -n "$no_sim" ]; then @@ -105,8 +105,11 @@ elif [ "$program" == "gazebo" ] && [ ! -n "$no_sim" ]; then
fi
fi
SIM_PID=$!
gz model --spawn-file="${src_path}/Tools/sitl_gazebo/models/${model}/${model}.sdf" --model-name=${model} -x 1.01 -y 0.98 -z 0.83
if gz model --spawn-file="${src_path}/Tools/sitl_gazebo/models/${model}/${model}.sdf" --model-name=${model} -x 1.01 -y 0.98 -z 0.83 2>&1 | grep "An instance of Gazebo is not running."; then
echo "Start of gzserver failed"
exit 1
fi
if [[ -n "$HEADLESS" ]]; then
echo "not running gazebo gui"

Loading…
Cancel
Save