mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2025-12-11 00:56:23 +08:00
Make mavsdk test runner handle generated sdf files (#15797)
Update sitl_gazebo Fix indent errors Fix syntax error Fix indentation errors Fix syntax errors use autopep8
This commit is contained in:
@@ -224,9 +224,23 @@ class GzmodelspawnRunner(Runner):
|
||||
self.env["GAZEBO_MODEL_PATH"] = \
|
||||
workspace_dir + "/Tools/sitl_gazebo/models"
|
||||
self.cmd = "gz"
|
||||
self.args = ["model", "--spawn-file", workspace_dir +
|
||||
"/Tools/sitl_gazebo/models/" +
|
||||
self.model + "/" + self.model + ".sdf",
|
||||
|
||||
if os.path.isfile(workspace_dir +
|
||||
"/Tools/sitl_gazebo/models/" +
|
||||
self.model + "/" + self.model + ".sdf"):
|
||||
model_path = workspace_dir + \
|
||||
"/Tools/sitl_gazebo/models/" + \
|
||||
self.model + "/" + self.model + ".sdf"
|
||||
elif os.path.isfile(workspace_dir +
|
||||
"/Tools/sitl_gazebo/models/" +
|
||||
self.model + "/" + self.model + "-gen.sdf"):
|
||||
model_path = workspace_dir + \
|
||||
"/Tools/sitl_gazebo/models/" + \
|
||||
self.model + "/" + self.model + "-gen.sdf"
|
||||
else:
|
||||
raise Exception("Model not found")
|
||||
|
||||
self.args = ["model", "--spawn-file", model_path,
|
||||
"--model-name", self.model,
|
||||
"-x", "1.01", "-y", "0.98", "-z", "0.83"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user