mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 15:58:53 +08:00
SITL Gazebo classic make airframes simulator specific
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# run multiple instances of the 'px4' binary, with the gazebo SITL simulation
|
||||
# It assumes px4 is already built, with 'make px4_sitl_default gazebo'
|
||||
# It assumes px4 is already built, with 'make px4_sitl_default sitl_gazebo'
|
||||
|
||||
# The simulator is expected to send to TCP port 4560+i for i in [0, N-1]
|
||||
# For example gazebo can be run like this:
|
||||
@@ -69,7 +69,7 @@ num_vehicles=${NUM_VEHICLES:=3}
|
||||
world=${WORLD:=empty}
|
||||
target=${TARGET:=px4_sitl_default}
|
||||
vehicle_model=${VEHICLE_MODEL:="iris"}
|
||||
export PX4_SIM_MODEL=${vehicle_model}
|
||||
export PX4_SIM_MODEL=gazebo_${vehicle_model}
|
||||
|
||||
echo ${SCRIPT}
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
@@ -126,7 +126,7 @@ else
|
||||
|
||||
m=0
|
||||
while [ $m -lt ${target_number} ]; do
|
||||
export PX4_SIM_MODEL=${target_vehicle}
|
||||
export PX4_SIM_MODEL=gazebo_${target_vehicle}
|
||||
spawn_model ${target_vehicle}${LABEL} $n $target_x $target_y
|
||||
m=$(($m + 1))
|
||||
n=$(($n + 1))
|
||||
|
||||
@@ -67,7 +67,7 @@ fi
|
||||
# be running from last time
|
||||
pkill -x gazebo || true
|
||||
|
||||
export PX4_SIM_MODEL=${model}
|
||||
export PX4_SIM_MODEL=gazebo_${model}
|
||||
export PX4_SIM_WORLD=${world}
|
||||
|
||||
SIM_PID=0
|
||||
@@ -75,10 +75,6 @@ SIM_PID=0
|
||||
if [ -x "$(command -v gazebo)" ]; then
|
||||
# Get the model name
|
||||
model_name="${model}"
|
||||
# Check if a 'modelname-gen.sdf' file exist for the models using jinja and generating the SDF files
|
||||
if [ -f "${src_path}/Tools/simulation/gazebo/sitl_gazebo/models/${model}/${model}-gen.sdf" ]; then
|
||||
model_name="${model}-gen"
|
||||
fi
|
||||
|
||||
# Set the plugin path so Gazebo finds our model and sim
|
||||
source "$src_path/Tools/simulation/gazebo/setup_gazebo.bash" "${src_path}" "${build_path}"
|
||||
|
||||
@@ -19,7 +19,7 @@ pkill -x px4 || true
|
||||
|
||||
sleep 1
|
||||
|
||||
export PX4_SIM_MODEL=iris
|
||||
export PX4_SIM_MODEL=gazebo_iris
|
||||
|
||||
n=0
|
||||
while [ $n -lt $sitl_num ]; do
|
||||
|
||||
Reference in New Issue
Block a user