mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-23 22:58:10 +08:00
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.
This commit is contained in:
+4
-1
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user