SITL: use autotest_dir

this allows for the aircraft directory for SITL to be packaged without
the source tree
This commit is contained in:
Andrew Tridgell 2015-05-25 13:04:46 +10:00
parent 3daee9c8bc
commit c06d81a06a
4 changed files with 10 additions and 4 deletions

View File

@ -44,7 +44,8 @@ Aircraft::Aircraft(const char *home_str, const char *frame_str) :
gyro_noise(radians(0.1f)),
accel_noise(0.3),
rate_hz(400),
last_time_us(0)
last_time_us(0),
autotest_dir(NULL)
{
char *saveptr=NULL;
char *s = strdup(home_str);

View File

@ -57,6 +57,13 @@ public:
instance = _instance;
}
/*
set directory for additional files such as aircraft models
*/
void set_autotest_dir(const char *_autotest_dir) {
autotest_dir = _autotest_dir;
}
/*
step the FDM by one time step
*/
@ -90,6 +97,7 @@ protected:
float scaled_frame_time_us;
uint64_t last_wall_time_us;
uint8_t instance;
const char *autotest_dir;
bool on_ground(const Vector3f &pos) const;

View File

@ -72,8 +72,6 @@ bool JSBSim::create_templates(void)
control_port = 5505 + instance*10;
fdm_port = 5504 + instance*10;
asprintf(&autotest_dir, SKETCHBOOK "/Tools/autotest");
asprintf(&jsbsim_script, "%s/jsbsim_start_%u.xml", autotest_dir, instance);
asprintf(&jsbsim_fgout, "%s/jsbsim_fgout_%u.xml", autotest_dir, instance);

View File

@ -50,7 +50,6 @@ private:
uint16_t control_port;
uint16_t fdm_port;
char *autotest_dir;
char *jsbsim_script;
char *jsbsim_fgout;
int jsbsim_stdout;