mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
Add options to spawn multiple vehicles in different worlds (#14764)
Since SITL gazebo now has the ability to spawn vehicles to different worlds, this can be done for simulating multiple vehicles
This commit is contained in:
@@ -17,17 +17,19 @@ then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while getopts n:m: option
|
while getopts n:m:w: option
|
||||||
do
|
do
|
||||||
case "${option}"
|
case "${option}"
|
||||||
in
|
in
|
||||||
n) NUM_VEHICLES=${OPTARG};;
|
n) NUM_VEHICLES=${OPTARG};;
|
||||||
m) VEHICLE_MODEL=${OPTARG};;
|
m) VEHICLE_MODEL=${OPTARG};;
|
||||||
|
w) WORLD=${OPTARG};;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
num_vehicles=${NUM_VEHICLES:=3}
|
num_vehicles=${NUM_VEHICLES:=3}
|
||||||
export PX4_SIM_MODEL=${VEHICLE_MODEL:=iris}
|
export PX4_SIM_MODEL=${VEHICLE_MODEL:=iris}
|
||||||
|
world=${WORLD:=empty}
|
||||||
|
|
||||||
if [ "$PX4_SIM_MODEL" != "iris" ] && [ "$PX4_SIM_MODEL" != "plane" ] && [ "$PX4_SIM_MODEL" != "standard_vtol" ]
|
if [ "$PX4_SIM_MODEL" != "iris" ] && [ "$PX4_SIM_MODEL" != "plane" ] && [ "$PX4_SIM_MODEL" != "standard_vtol" ]
|
||||||
then
|
then
|
||||||
@@ -47,7 +49,6 @@ src_path="$SCRIPT_DIR/.."
|
|||||||
build_path=${src_path}/build/px4_sitl_default
|
build_path=${src_path}/build/px4_sitl_default
|
||||||
mavlink_udp_port=14560
|
mavlink_udp_port=14560
|
||||||
mavlink_tcp_port=4560
|
mavlink_tcp_port=4560
|
||||||
world="empty"
|
|
||||||
|
|
||||||
echo "killing running instances"
|
echo "killing running instances"
|
||||||
pkill -x px4 || true
|
pkill -x px4 || true
|
||||||
|
|||||||
Reference in New Issue
Block a user