mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 16:13:34 +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:
@@ -10,8 +10,10 @@ import threading
|
||||
import errno
|
||||
from typing import Any, Dict, List, TextIO, Optional
|
||||
|
||||
PX4_GAZEBO_MODELS = "Tools/simulation/gazebo/sitl_gazebo/models"
|
||||
PX4_GAZEBO_WORLDS = "Tools/simulation/gazebo/sitl_gazebo/worlds"
|
||||
PX4_SITL_GAZEBO_PATH = "Tools/simulation/gazebo-classic/sitl_gazebo-classic"
|
||||
|
||||
PX4_GAZEBO_MODELS = PX4_SITL_GAZEBO_PATH + "/models"
|
||||
PX4_GAZEBO_WORLDS = PX4_SITL_GAZEBO_PATH + "/worlds"
|
||||
|
||||
|
||||
class Runner:
|
||||
@@ -164,7 +166,7 @@ class Px4Runner(Runner):
|
||||
os.path.join(workspace_dir, "test_data"),
|
||||
"-d"
|
||||
]
|
||||
self.env["PX4_SIM_MODEL"] = "gazebo_" + self.model
|
||||
self.env["PX4_SIM_MODEL"] = "gazebo-classic_" + self.model
|
||||
self.env["PX4_SIM_SPEED_FACTOR"] = str(speed_factor)
|
||||
self.debugger = debugger
|
||||
self.clear_rootfs()
|
||||
@@ -224,7 +226,7 @@ class GzserverRunner(Runner):
|
||||
self.name = "gzserver"
|
||||
self.cwd = workspace_dir
|
||||
self.env["GAZEBO_PLUGIN_PATH"] = \
|
||||
os.path.join(workspace_dir, build_dir, "build_gazebo")
|
||||
os.path.join(workspace_dir, build_dir, "build_gazebo-classic")
|
||||
self.env["GAZEBO_MODEL_PATH"] = \
|
||||
os.path.join(workspace_dir, PX4_GAZEBO_MODELS)
|
||||
self.env["PX4_SIM_SPEED_FACTOR"] = str(speed_factor)
|
||||
@@ -262,7 +264,7 @@ class GzmodelspawnRunner(Runner):
|
||||
self.name = "gzmodelspawn"
|
||||
self.cwd = workspace_dir
|
||||
self.env["GAZEBO_PLUGIN_PATH"] = \
|
||||
os.path.join(workspace_dir, build_dir, "build_gazebo")
|
||||
os.path.join(workspace_dir, build_dir, "build_gazebo-classic")
|
||||
self.env["GAZEBO_MODEL_PATH"] = \
|
||||
os.path.join(workspace_dir, PX4_GAZEBO_MODELS)
|
||||
self.cmd = "gz"
|
||||
|
||||
@@ -4,9 +4,9 @@ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
PX4_SRC_DIR=${DIR}/..
|
||||
|
||||
source /opt/ros/${ROS_DISTRO:-kinetic}/setup.bash
|
||||
source ${PX4_SRC_DIR}/Tools/simulation/gazebo/setup_gazebo.bash ${PX4_SRC_DIR} ${PX4_SRC_DIR}/build/px4_sitl_default
|
||||
source ${PX4_SRC_DIR}/Tools/simulation/gazebo-classic/setup_gazebo.bash ${PX4_SRC_DIR} ${PX4_SRC_DIR}/build/px4_sitl_default
|
||||
|
||||
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:${PX4_SRC_DIR}:${PX4_SRC_DIR}/Tools/simulation/gazebo/sitl_gazebo
|
||||
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:${PX4_SRC_DIR}:${PX4_SRC_DIR}/Tools/simulation/gazebo-classic/sitl_gazebo-classic
|
||||
|
||||
export ROS_LOG_DIR="$HOME/.ros/ros_logs"
|
||||
mkdir -p "$ROS_LOG_DIR"
|
||||
|
||||
Reference in New Issue
Block a user