mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-22 14:24:21 +08:00
rename 'gazebo' simulation to 'gazebo-classic' (#20936)
- use `gazebo-classic` everywhere consistently referring to the original Gazebo (eg version 9,10,11) - additional `gazebo_*` helper targets added for compatibility, but warn about deprecation and tell you the new target naming - use `gz` everywhere when referring to Gazebo (aka Ignition Gazebo or new Gazebo)
This commit is contained in:
@@ -59,13 +59,13 @@ jobs:
|
||||
run: |
|
||||
export
|
||||
ulimit -a
|
||||
- name: Build PX4 and sitl_gazebo
|
||||
- name: Build PX4 and sitl_gazebo-classic
|
||||
env:
|
||||
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
|
||||
run: |
|
||||
ccache -z
|
||||
make px4_sitl_default
|
||||
make px4_sitl_default sitl_gazebo
|
||||
make px4_sitl_default sitl_gazebo-classic
|
||||
ccache -s
|
||||
|
||||
- name: Core dump settings
|
||||
|
||||
@@ -54,13 +54,13 @@ jobs:
|
||||
run: |
|
||||
export
|
||||
ulimit -a
|
||||
- name: Build PX4 and sitl_gazebo
|
||||
- name: Build PX4 and sitl_gazebo-classic
|
||||
env:
|
||||
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
|
||||
run: |
|
||||
ccache -z
|
||||
make px4_sitl_default
|
||||
make px4_sitl_default sitl_gazebo
|
||||
make px4_sitl_default sitl_gazebo-classic
|
||||
ccache -s
|
||||
|
||||
- name: Core dump settings
|
||||
|
||||
@@ -74,14 +74,14 @@ jobs:
|
||||
- name: Build SITL Gazebo
|
||||
env:
|
||||
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
|
||||
run: make px4_sitl_default sitl_gazebo
|
||||
- name: ccache post-run sitl_gazebo
|
||||
run: make px4_sitl_default sitl_gazebo-classic
|
||||
- name: ccache post-run sitl_gazebo-classic
|
||||
run: ccache -s
|
||||
- name: Build MAVSDK tests
|
||||
env:
|
||||
PX4_CMAKE_BUILD_TYPE: ${{matrix.config.build_type}}
|
||||
DONT_RUN: 1
|
||||
run: make px4_sitl_default sitl_gazebo mavsdk_tests
|
||||
run: make px4_sitl_default sitl_gazebo-classic mavsdk_tests
|
||||
- name: ccache post-run mavsdk_tests
|
||||
run: ccache -s
|
||||
|
||||
|
||||
+3
-3
@@ -10,9 +10,9 @@
|
||||
path = Tools/simulation/jmavsim/jMAVSim
|
||||
url = https://github.com/PX4/jMAVSim.git
|
||||
branch = main
|
||||
[submodule "Tools/simulation/gazebo/sitl_gazebo"]
|
||||
path = Tools/simulation/gazebo/sitl_gazebo
|
||||
url = https://github.com/PX4/PX4-SITL_gazebo.git
|
||||
[submodule "Tools/simulation/gazebo-classic/sitl_gazebo-classic"]
|
||||
path = Tools/simulation/gazebo-classic/sitl_gazebo-classic
|
||||
url = https://github.com/PX4/PX4-SITL_gazebo-classic.git
|
||||
branch = main
|
||||
[submodule "src/drivers/gps/devices"]
|
||||
path = src/drivers/gps/devices
|
||||
|
||||
Vendored
+13
-13
@@ -67,9 +67,9 @@
|
||||
"dependsOn":["px4_sitl_cleanup"]
|
||||
},
|
||||
{
|
||||
"label": "gazebo build",
|
||||
"label": "gazebo-classic build",
|
||||
"type": "shell",
|
||||
"command": "make px4_sitl_default sitl_gazebo",
|
||||
"command": "make px4_sitl_default sitl_gazebo-classic",
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}"
|
||||
},
|
||||
@@ -86,18 +86,18 @@
|
||||
"problemMatcher": [],
|
||||
},
|
||||
{
|
||||
"label": "gazebo start",
|
||||
"label": "gazebo-classic start",
|
||||
"type": "shell",
|
||||
"dependsOn": "gazebo build",
|
||||
"dependsOn": "gazebo-classic build",
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}",
|
||||
"env": {
|
||||
"GAZEBO_PLUGIN_PATH": "${workspaceFolder}/build/px4_sitl_default/build_gazebo",
|
||||
"GAZEBO_MODEL_PATH": "${workspaceFolder}/Tools/simulation/gazebo/sitl_gazebo/models",
|
||||
"GAZEBO_PLUGIN_PATH": "${workspaceFolder}/build/px4_sitl_default/build_gazebo-classic",
|
||||
"GAZEBO_MODEL_PATH": "${workspaceFolder}/Tools/simulation/gazebo-classic/sitl_gazebo-classic/models",
|
||||
"PX4_SIM_SPEED_FACTOR": "1"
|
||||
}
|
||||
},
|
||||
"command": "gzserver --verbose ${workspaceFolder}/Tools/simulation/gazebo/sitl_gazebo/worlds/empty.world",
|
||||
"command": "gzserver --verbose ${workspaceFolder}/Tools/simulation/gazebo-classic/sitl_gazebo-classic/worlds/empty.world",
|
||||
"isBackground": true,
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
@@ -128,18 +128,18 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "gazebo",
|
||||
"label": "gazebo-classic",
|
||||
"type": "shell",
|
||||
"dependsOn": "gazebo start",
|
||||
"dependsOn": "gazebo-classic start",
|
||||
"options": {
|
||||
"cwd": "${workspaceFolder}",
|
||||
"env": {
|
||||
"GAZEBO_PLUGIN_PATH": "${workspaceFolder}/build/px4_sitl_default/build_gazebo",
|
||||
"GAZEBO_MODEL_PATH": "${workspaceFolder}/Tools/simulation/gazebo/sitl_gazebo/models",
|
||||
"GAZEBO_PLUGIN_PATH": "${workspaceFolder}/build/px4_sitl_default/build_gazebo-classic",
|
||||
"GAZEBO_MODEL_PATH": "${workspaceFolder}/Tools/simulation/gazebo-classic/sitl_gazebo-classic/models",
|
||||
"PX4_SIM_SPEED_FACTOR": "1"
|
||||
}
|
||||
},
|
||||
"command": "gz model --verbose --spawn-file=${workspaceFolder}/Tools/simulation/gazebo/sitl_gazebo/models/iris/iris.sdf --model-name=iris -x 1.01 -y 0.98 -z 0.83",
|
||||
"command": "gz model --verbose --spawn-file=${workspaceFolder}/Tools/simulation/gazebo-classic/sitl_gazebo-classic/models/iris/iris.sdf --model-name=iris -x 1.01 -y 0.98 -z 0.83",
|
||||
"isBackground": false,
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
@@ -194,7 +194,7 @@
|
||||
"dependsOn":["ign gazebo kill"]
|
||||
},
|
||||
{
|
||||
"label": "gazebo kill",
|
||||
"label": "gazebo-classic kill",
|
||||
"type": "shell",
|
||||
"command": "pkill -9 -f gzserver || true",
|
||||
"presentation": {
|
||||
|
||||
@@ -388,17 +388,17 @@ tests_coverage:
|
||||
|
||||
|
||||
rostest: px4_sitl_default
|
||||
@$(MAKE) --no-print-directory px4_sitl_default sitl_gazebo
|
||||
@$(MAKE) --no-print-directory px4_sitl_default sitl_gazebo-classic
|
||||
|
||||
tests_integration: px4_sitl_default
|
||||
@$(MAKE) --no-print-directory px4_sitl_default sitl_gazebo
|
||||
@$(MAKE) --no-print-directory px4_sitl_default sitl_gazebo-classic
|
||||
@$(MAKE) --no-print-directory px4_sitl_default mavsdk_tests
|
||||
@"$(SRC_DIR)"/test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 test/mavsdk_tests/configs/sitl.json
|
||||
|
||||
tests_integration_coverage:
|
||||
@$(MAKE) clean
|
||||
@$(MAKE) --no-print-directory px4_sitl_default PX4_CMAKE_BUILD_TYPE=Coverage
|
||||
@$(MAKE) --no-print-directory px4_sitl_default sitl_gazebo
|
||||
@$(MAKE) --no-print-directory px4_sitl_default sitl_gazebo-classic
|
||||
@$(MAKE) --no-print-directory px4_sitl_default mavsdk_tests
|
||||
@"$(SRC_DIR)"/test/mavsdk_tests/mavsdk_test_runner.py --speed-factor 20 test/mavsdk_tests/configs/sitl.json
|
||||
@mkdir -p coverage
|
||||
@@ -408,13 +408,13 @@ tests_mission: rostest
|
||||
@"$(SRC_DIR)"/test/rostest_px4_run.sh mavros_posix_tests_missions.test
|
||||
|
||||
rostest_run: px4_sitl_default
|
||||
@$(MAKE) --no-print-directory px4_sitl_default sitl_gazebo
|
||||
@$(MAKE) --no-print-directory px4_sitl_default sitl_gazebo-classic
|
||||
@"$(SRC_DIR)"/test/rostest_px4_run.sh $(TEST_FILE) mission:=$(TEST_MISSION) vehicle:=$(TEST_VEHICLE)
|
||||
|
||||
tests_mission_coverage:
|
||||
@$(MAKE) clean
|
||||
@$(MAKE) --no-print-directory px4_sitl_default PX4_CMAKE_BUILD_TYPE=Coverage
|
||||
@$(MAKE) --no-print-directory px4_sitl_default sitl_gazebo PX4_CMAKE_BUILD_TYPE=Coverage
|
||||
@$(MAKE) --no-print-directory px4_sitl_default sitl_gazebo-classic PX4_CMAKE_BUILD_TYPE=Coverage
|
||||
@"$(SRC_DIR)"/test/rostest_px4_run.sh mavros_posix_test_mission.test mission:=VTOL_mission_1 vehicle:=standard_vtol
|
||||
@$(MAKE) --no-print-directory px4_sitl_default generate_coverage
|
||||
|
||||
@@ -489,7 +489,7 @@ validate_module_configs:
|
||||
|
||||
# Cleanup
|
||||
# --------------------------------------------------------------------
|
||||
.PHONY: clean submodulesclean submodulesupdate gazeboclean distclean
|
||||
.PHONY: clean submodulesclean submodulesupdate distclean
|
||||
|
||||
clean:
|
||||
@[ ! -d "$(SRC_DIR)/build" ] || find "$(SRC_DIR)/build" -mindepth 1 -maxdepth 1 -type d -exec sh -c "echo {}; cmake --build {} -- clean || rm -rf {}" \; # use generated build system to clean, wipe build directory if it fails
|
||||
@@ -507,10 +507,7 @@ submodulesupdate:
|
||||
@git submodule update --init --recursive --jobs 4
|
||||
@git fetch --all --tags --recurse-submodules=yes --jobs=4
|
||||
|
||||
gazeboclean:
|
||||
@rm -rf ~/.gazebo/*
|
||||
|
||||
distclean: gazeboclean
|
||||
distclean:
|
||||
@git submodule deinit --force $(SRC_DIR)
|
||||
@rm -rf "$(SRC_DIR)/build"
|
||||
@git clean --force -X "$(SRC_DIR)/msg/" "$(SRC_DIR)/platforms/" "$(SRC_DIR)/posix-configs/" "$(SRC_DIR)/ROMFS/" "$(SRC_DIR)/src/" "$(SRC_DIR)/test/" "$(SRC_DIR)/Tools/"
|
||||
|
||||
@@ -33,39 +33,39 @@
|
||||
|
||||
px4_add_romfs_files(
|
||||
|
||||
1010_gazebo_iris_opt_flow
|
||||
1010_gazebo_iris_opt_flow.post
|
||||
1011_gazebo_iris_irlock
|
||||
1012_gazebo_iris_rplidar
|
||||
1013_gazebo_iris_vision
|
||||
1013_gazebo_iris_vision.post
|
||||
1015_gazebo_iris_obs_avoid
|
||||
1015_gazebo_iris_obs_avoid.post
|
||||
1017_gazebo_iris_opt_flow_mockup
|
||||
1019_gazebo_iris_dual_gps
|
||||
1021_gazebo_uuv_hippocampus
|
||||
1022_gazebo_uuv_bluerov2_heavy
|
||||
1030_gazebo_plane
|
||||
1031_gazebo_plane_cam
|
||||
1032_gazebo_plane_catapult
|
||||
1010_gazebo-classic_iris_opt_flow
|
||||
1010_gazebo-classic_iris_opt_flow.post
|
||||
1011_gazebo-classic_iris_irlock
|
||||
1012_gazebo-classic_iris_rplidar
|
||||
1013_gazebo-classic_iris_vision
|
||||
1013_gazebo-classic_iris_vision.post
|
||||
1015_gazebo-classic_iris_obs_avoid
|
||||
1015_gazebo-classic_iris_obs_avoid.post
|
||||
1017_gazebo-classic_iris_opt_flow_mockup
|
||||
1019_gazebo-classic_iris_dual_gps
|
||||
1021_gazebo-classic_uuv_hippocampus
|
||||
1022_gazebo-classic_uuv_bluerov2_heavy
|
||||
1030_gazebo-classic_plane
|
||||
1031_gazebo-classic_plane_cam
|
||||
1032_gazebo-classic_plane_catapult
|
||||
1033_jsbsim_rascal
|
||||
1034_flightgear_rascal-electric
|
||||
1035_gazebo_techpod
|
||||
1035_gazebo-classic_techpod
|
||||
1036_jsbsim_malolo
|
||||
1037_gazebo_believer
|
||||
1038_gazebo_glider
|
||||
1039_gazebo_advanced_plane
|
||||
1040_gazebo_standard_vtol
|
||||
1041_gazebo_tailsitter
|
||||
1042_gazebo_tiltrotor
|
||||
1043_gazebo_standard_vtol_drop
|
||||
1044_gazebo_plane_lidar
|
||||
1060_gazebo_rover
|
||||
1061_gazebo_r1_rover
|
||||
1037_gazebo-classic_believer
|
||||
1038_gazebo-classic_glider
|
||||
1039_gazebo-classic_advanced_plane
|
||||
1040_gazebo-classic_standard_vtol
|
||||
1041_gazebo-classic_tailsitter
|
||||
1042_gazebo-classic_tiltrotor
|
||||
1043_gazebo-classic_standard_vtol_drop
|
||||
1044_gazebo-classic_plane_lidar
|
||||
1060_gazebo-classic_rover
|
||||
1061_gazebo-classic_r1_rover
|
||||
1062_flightgear_tf-r1
|
||||
1070_gazebo_boat
|
||||
1070_gazebo-classic_boat
|
||||
|
||||
2507_gazebo_cloudship
|
||||
2507_gazebo-classic_cloudship
|
||||
|
||||
3010_jsbsim_quadrotor_x
|
||||
3011_jsbsim_hexarotor_x
|
||||
@@ -73,14 +73,14 @@ px4_add_romfs_files(
|
||||
4001_gz_x500
|
||||
4002_gz_x500_depth
|
||||
|
||||
6011_gazebo_typhoon_h480
|
||||
6011_gazebo_typhoon_h480.post
|
||||
6011_gazebo-classic_typhoon_h480
|
||||
6011_gazebo-classic_typhoon_h480.post
|
||||
|
||||
10016_gazebo_iris
|
||||
10016_gazebo-classic_iris
|
||||
10017_jmavsim_iris
|
||||
10018_gazebo_iris_foggy_lidar
|
||||
10019_gazebo_omnicopter
|
||||
10030_gazebo_px4vision
|
||||
10018_gazebo-classic_iris_foggy_lidar
|
||||
10019_gazebo-classic_omnicopter
|
||||
10030_gazebo-classic_px4vision
|
||||
|
||||
10040_sihsim_quadx
|
||||
10041_sihsim_airplane
|
||||
|
||||
+3
-3
@@ -16,9 +16,9 @@ SRC_DIR=$1
|
||||
BUILD_DIR=$2
|
||||
|
||||
# setup Gazebo env and update package path
|
||||
export GAZEBO_PLUGIN_PATH=$GAZEBO_PLUGIN_PATH:${BUILD_DIR}/build_gazebo
|
||||
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:${SRC_DIR}/Tools/simulation/gazebo/sitl_gazebo/models
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${BUILD_DIR}/build_gazebo
|
||||
export GAZEBO_PLUGIN_PATH=$GAZEBO_PLUGIN_PATH:${BUILD_DIR}/build_gazebo-classic
|
||||
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:${SRC_DIR}/Tools/simulation/gazebo-classic/sitl_gazebo-classic/models
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${BUILD_DIR}/build_gazebo-classic
|
||||
|
||||
echo -e "GAZEBO_PLUGIN_PATH $GAZEBO_PLUGIN_PATH"
|
||||
echo -e "GAZEBO_MODEL_PATH $GAZEBO_MODEL_PATH"
|
||||
+7
-7
@@ -1,10 +1,10 @@
|
||||
#!/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 sitl_gazebo'
|
||||
# It assumes px4 is already built, with 'make px4_sitl_default sitl_gazebo-classic'
|
||||
|
||||
# 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:
|
||||
#./Tools/simulation/gazebo/sitl_multiple_run.sh -n 10 -m iris
|
||||
#./Tools/simulation/gazebo-classic/sitl_multiple_run.sh -n 10 -m iris
|
||||
|
||||
function cleanup() {
|
||||
pkill -x px4
|
||||
@@ -35,7 +35,7 @@ function spawn_model() {
|
||||
pushd "$working_dir" &>/dev/null
|
||||
echo "starting instance $N in $(pwd)"
|
||||
$build_path/bin/px4 -i $N -d "$build_path/etc" >out.log 2>err.log &
|
||||
python3 ${src_path}/Tools/simulation/gazebo/sitl_gazebo/scripts/jinja_gen.py ${src_path}/Tools/simulation/gazebo/sitl_gazebo/models/${MODEL}/${MODEL}.sdf.jinja ${src_path}/Tools/simulation/gazebo/sitl_gazebo --mavlink_tcp_port $((4560+${N})) --mavlink_udp_port $((14560+${N})) --mavlink_id $((1+${N})) --gst_udp_port $((5600+${N})) --video_uri $((5600+${N})) --mavlink_cam_udp_port $((14530+${N})) --output-file /tmp/${MODEL}_${N}.sdf
|
||||
python3 ${src_path}/Tools/simulation/gazebo-classic/sitl_gazebo-classic/scripts/jinja_gen.py ${src_path}/Tools/simulation/gazebo-classic/sitl_gazebo-classic/models/${MODEL}/${MODEL}.sdf.jinja ${src_path}/Tools/simulation/gazebo-classic/sitl_gazebo-classic --mavlink_tcp_port $((4560+${N})) --mavlink_udp_port $((14560+${N})) --mavlink_id $((1+${N})) --gst_udp_port $((5600+${N})) --video_uri $((5600+${N})) --mavlink_cam_udp_port $((14530+${N})) --output-file /tmp/${MODEL}_${N}.sdf
|
||||
|
||||
echo "Spawning ${MODEL}_${N} at ${X} ${Y}"
|
||||
|
||||
@@ -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=gazebo_${vehicle_model}
|
||||
export PX4_SIM_MODEL=gazebo-classic_${vehicle_model}
|
||||
|
||||
echo ${SCRIPT}
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
@@ -84,7 +84,7 @@ pkill -x px4 || true
|
||||
|
||||
sleep 1
|
||||
|
||||
source ${src_path}/Tools/simulation/gazebo/setup_gazebo.bash ${src_path} ${src_path}/build/${target}
|
||||
source ${src_path}/Tools/simulation/gazebo-classic/setup_gazebo.bash ${src_path} ${src_path}/build/${target}
|
||||
|
||||
# To use gazebo_ros ROS2 plugins
|
||||
if [[ -n "$ROS_VERSION" ]] && [ "$ROS_VERSION" == "2" ]; then
|
||||
@@ -94,7 +94,7 @@ else
|
||||
fi
|
||||
|
||||
echo "Starting gazebo"
|
||||
gzserver ${src_path}/Tools/simulation/gazebo/sitl_gazebo/worlds/${world}.world --verbose $ros_args &
|
||||
gzserver ${src_path}/Tools/simulation/gazebo-classic/sitl_gazebo-classic/worlds/${world}.world --verbose $ros_args &
|
||||
sleep 5
|
||||
|
||||
n=0
|
||||
@@ -126,7 +126,7 @@ else
|
||||
|
||||
m=0
|
||||
while [ $m -lt ${target_number} ]; do
|
||||
export PX4_SIM_MODEL=gazebo_${target_vehicle}
|
||||
export PX4_SIM_MODEL=gazebo-classic_${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=gazebo_${model}
|
||||
export PX4_SIM_MODEL=gazebo-classic_${model}
|
||||
export PX4_SIM_WORLD=${world}
|
||||
|
||||
SIM_PID=0
|
||||
@@ -77,25 +77,25 @@ if [ -x "$(command -v gazebo)" ]; then
|
||||
model_name="${model}"
|
||||
|
||||
# Set the plugin path so Gazebo finds our model and sim
|
||||
source "$src_path/Tools/simulation/gazebo/setup_gazebo.bash" "${src_path}" "${build_path}"
|
||||
source "$src_path/Tools/simulation/gazebo-classic/setup_gazebo.bash" "${src_path}" "${build_path}"
|
||||
if [ -z $PX4_SITL_WORLD ]; then
|
||||
#Spawn predefined world
|
||||
if [ "$world" == "none" ]; then
|
||||
if [ -f ${src_path}/Tools/simulation/gazebo/sitl_gazebo/worlds/${model}.world ]; then
|
||||
if [ -f ${src_path}/Tools/simulation/gazebo-classic/sitl_gazebo-classic/worlds/${model}.world ]; then
|
||||
echo "empty world, default world ${model}.world for model found"
|
||||
world_path="${src_path}/Tools/simulation/gazebo/sitl_gazebo/worlds/${model}.world"
|
||||
world_path="${src_path}/Tools/simulation/gazebo-classic/sitl_gazebo-classic/worlds/${model}.world"
|
||||
else
|
||||
echo "empty world, setting empty.world as default"
|
||||
world_path="${src_path}/Tools/simulation/gazebo/sitl_gazebo/worlds/empty.world"
|
||||
world_path="${src_path}/Tools/simulation/gazebo-classic/sitl_gazebo-classic/worlds/empty.world"
|
||||
fi
|
||||
else
|
||||
#Spawn empty world if world with model name doesn't exist
|
||||
world_path="${src_path}/Tools/simulation/gazebo/sitl_gazebo/worlds/${world}.world"
|
||||
world_path="${src_path}/Tools/simulation/gazebo-classic/sitl_gazebo-classic/worlds/${world}.world"
|
||||
fi
|
||||
else
|
||||
if [ -f ${src_path}/Tools/simulation/gazebo/sitl_gazebo/worlds/${PX4_SITL_WORLD}.world ]; then
|
||||
if [ -f ${src_path}/Tools/simulation/gazebo-classic/sitl_gazebo-classic/worlds/${PX4_SITL_WORLD}.world ]; then
|
||||
# Spawn world by name if exists in the worlds directory from environment variable
|
||||
world_path="${src_path}/Tools/simulation/gazebo/sitl_gazebo/worlds/${PX4_SITL_WORLD}.world"
|
||||
world_path="${src_path}/Tools/simulation/gazebo-classic/sitl_gazebo-classic/worlds/${PX4_SITL_WORLD}.world"
|
||||
else
|
||||
# Spawn world from environment variable with absolute path
|
||||
world_path="$PX4_SITL_WORLD"
|
||||
@@ -19,7 +19,7 @@ pkill -x px4 || true
|
||||
|
||||
sleep 1
|
||||
|
||||
export PX4_SIM_MODEL=gazebo_iris
|
||||
export PX4_SIM_MODEL=gazebo-classic_iris
|
||||
|
||||
n=0
|
||||
while [ $n -lt $sitl_num ]; do
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<arg name="vehicle" default="iris"/>
|
||||
<arg name="world" default="$(find mavlink_sitl_gazebo)/worlds/empty.world"/>
|
||||
<arg name="sdf" default="$(find mavlink_sitl_gazebo)/models/$(arg vehicle)/$(arg vehicle).sdf"/>
|
||||
<env name="PX4_SIM_MODEL" value="gazebo_$(arg vehicle)" />
|
||||
<env name="PX4_SIM_MODEL" value="gazebo-classic_$(arg vehicle)" />
|
||||
|
||||
<!-- gazebo configs -->
|
||||
<arg name="gui" default="true"/>
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
<arg name="ID" default="0"/>
|
||||
<arg name="interactive" default="true"/>
|
||||
|
||||
<env name="PX4_SIM_MODEL" value="gazebo_$(arg vehicle)" />
|
||||
<env name="PX4_SIM_MODEL" value="gazebo-classic_$(arg vehicle)" />
|
||||
<arg unless="$(arg interactive)" name="px4_command_arg1" value="-d"/>
|
||||
<arg if="$(arg interactive)" name="px4_command_arg1" value=""/>
|
||||
<node name="sitl_$(arg ID)" pkg="px4" type="px4" output="screen" args="$(find px4)/build/px4_sitl_default/etc -s etc/init.d-posix/rcS -i $(arg ID) $(arg px4_command_arg1)">
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<arg name="est" default="ekf2"/>
|
||||
<arg name="vehicle" default="iris"/>
|
||||
<arg name="ID" default="1"/>
|
||||
<env name="PX4_SIM_MODEL" value="gazebo_$(arg vehicle)" />
|
||||
<env name="PX4_SIM_MODEL" value="gazebo-classic_$(arg vehicle)" />
|
||||
<arg name="mavlink_udp_port" default="14560"/>
|
||||
<arg name="mavlink_tcp_port" default="4560"/>
|
||||
<arg name="gst_udp_port" default="5600"/>
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
<arg name="est" default="ekf2"/>
|
||||
<arg name="vehicle" default="plane"/>
|
||||
<arg name="ID" default="1"/>
|
||||
<env name="PX4_SIM_MODEL" value="gazebo_$(arg vehicle)" />
|
||||
<env name="PX4_SIM_MODEL" value="gazebo-classic_$(arg vehicle)" />
|
||||
<arg name="mavlink_udp_port" default="14560"/>
|
||||
<arg name="mavlink_tcp_port" default="4560"/>
|
||||
<!-- PX4 configs -->
|
||||
<arg name="interactive" default="true"/>
|
||||
<!-- generate sdf vehicle model -->
|
||||
<arg name="cmd" default="xmlstarlet ed -d '//plugin[@name="mavlink_interface"]/mavlink_tcp_port' -s '//plugin[@name="mavlink_interface"]' -t elem -n mavlink_tcp_port -v $(arg mavlink_tcp_port) $(find px4)/Tools/simulation/gazebo/sitl_gazebo/models/$(arg vehicle)/$(arg vehicle).sdf"/>
|
||||
<arg name="cmd" default="xmlstarlet ed -d '//plugin[@name="mavlink_interface"]/mavlink_tcp_port' -s '//plugin[@name="mavlink_interface"]' -t elem -n mavlink_tcp_port -v $(arg mavlink_tcp_port) $(find px4)/Tools/simulation/gazebo-classic/sitl_gazebo-classic/models/$(arg vehicle)/$(arg vehicle).sdf"/>
|
||||
<param command="$(arg cmd)" name="model_description"/>
|
||||
<!-- PX4 SITL -->
|
||||
<arg unless="$(arg interactive)" name="px4_command_arg1" value=""/>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user