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:
JaeyoungLim
2020-09-29 15:44:58 +02:00
committed by GitHub
parent c9c20666a2
commit 9d3e159e65
2 changed files with 18 additions and 4 deletions

View File

@@ -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"]