From 7268ef3bcc3275380b6ed7249936f4c45eef5103 Mon Sep 17 00:00:00 2001 From: JaeyoungLim Date: Sun, 26 Apr 2020 15:23:11 +0200 Subject: [PATCH] Add options to spawn multiple vehicles in different worlds Since SITL gazebo now has the ability to spawn vehicles to different worlds, this can be done for simulating multiple vehicles --- Tools/gazebo_sitl_multiple_run.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tools/gazebo_sitl_multiple_run.sh b/Tools/gazebo_sitl_multiple_run.sh index 41cb6acd04ef..92500c682de8 100755 --- a/Tools/gazebo_sitl_multiple_run.sh +++ b/Tools/gazebo_sitl_multiple_run.sh @@ -17,17 +17,19 @@ then exit 1 fi -while getopts n:m: option +while getopts n:m:w: option do case "${option}" in n) NUM_VEHICLES=${OPTARG};; m) VEHICLE_MODEL=${OPTARG};; + w) WORLD=${OPTARG};; esac done num_vehicles=${NUM_VEHICLES:=3} export PX4_SIM_MODEL=${VEHICLE_MODEL:=iris} +world=${WORLD:=empty} if [ "$PX4_SIM_MODEL" != "iris" ] && [ "$PX4_SIM_MODEL" != "plane" ] && [ "$PX4_SIM_MODEL" != "standard_vtol" ] then @@ -47,7 +49,6 @@ src_path="$SCRIPT_DIR/.." build_path=${src_path}/build/px4_sitl_default mavlink_udp_port=14560 mavlink_tcp_port=4560 -world="empty" echo "killing running instances" pkill -x px4 || true