diff --git a/libraries/SITL/SIM_JSBSim.cpp b/libraries/SITL/SIM_JSBSim.cpp
index 14ced10d6e..aee85e9120 100644
--- a/libraries/SITL/SIM_JSBSim.cpp
+++ b/libraries/SITL/SIM_JSBSim.cpp
@@ -58,6 +58,10 @@ JSBSim::JSBSim(const char *home_str, const char *frame_str) :
} else {
frame = FRAME_NORMAL;
}
+ const char *model_name = strchr(frame_str, ':');
+ if (model_name != NULL) {
+ jsbsim_model = model_name + 1;
+ }
}
/*
@@ -76,20 +80,20 @@ bool JSBSim::create_templates(void)
FILE *f = fopen(jsbsim_script, "w");
if (f == NULL) {
- hal.scheduler->panic("Unable to create jsbsim script");
+ hal.scheduler->panic("Unable to create jsbsim script %s", jsbsim_script);
}
fprintf(f,
"\n"
"\n"
"\n"
+" name=\"Testing %s\">\n"
"\n"
" \n"
-" test ArduPlane using Rascal110 and JSBSim\n"
+" test ArduPlane using %s and JSBSim\n"
" \n"
"\n"
-" \n"
-"", control_port);
+"",
+ jsbsim_model,
+ jsbsim_model,
+ jsbsim_model,
+ control_port);
fclose(f);
f = fopen(jsbsim_fgout, "w");
if (f == NULL) {
- hal.scheduler->panic("Unable to create jsbsim fgout script");
+ hal.scheduler->panic("Unable to create jsbsim fgout script %s", jsbsim_fgout);
}
fprintf(f, "\n"
"