diff --git a/sw/simulator/sim_ac_fw.c b/sw/simulator/sim_ac_fw.c index e575152ec9..0ee1fa7fbc 100644 --- a/sw/simulator/sim_ac_fw.c +++ b/sw/simulator/sim_ac_fw.c @@ -28,6 +28,9 @@ #include "main_fbw.h" #include "jsbsim_hw.h" +#include +using namespace std; + using namespace JSBSim; /* Datalink Ivy function */ @@ -46,6 +49,11 @@ static void on_DL_SETTING(IvyClientPtr app __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[]){ parse_dl_setting(argv); } +static void on_DL_GET_SETTING(IvyClientPtr app __attribute__ ((unused)), + void *user_data __attribute__ ((unused)), + int argc __attribute__ ((unused)), char *argv[]){ + parse_dl_get_setting(argv); +} static void on_DL_BLOCK(IvyClientPtr app __attribute__ ((unused)), void *user_data __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[]){ @@ -61,6 +69,7 @@ void autopilot_init(void) { IvyBindMsg(on_DL_PING, NULL, "^(\\S*) DL_PING"); IvyBindMsg(on_DL_ACINFO, NULL, "^(\\S*) DL_ACINFO (\\S*) (\\S*) (\\S* (\\S*) (\\S*) (\\S*)) (\\S*) (\\S*)"); IvyBindMsg(on_DL_SETTING, NULL, "^(\\S*) DL_SETTING (\\S*) (\\S*) (\\S*)"); + IvyBindMsg(on_DL_GET_SETTING, NULL, "^(\\S*) DL_GET_SETTING (\\S*) (\\S*)"); IvyBindMsg(on_DL_BLOCK, NULL, "^(\\S*) BLOCK (\\S*) (\\S*)"); IvyBindMsg(on_DL_MOVE_WP, NULL, "^(\\S*) MOVE_WP (\\S*) (\\S*) (\\S*) (\\S*) (\\S*)"); @@ -125,8 +134,8 @@ void copy_inputs_to_jsbsim(FGFDMExec* FDMExec) { run_model = true; //set_value(FDMExec, "propulsion/set-running", 1); // set initial speed - FDMExec->GetIC()->SetAltitudeFtIC((GROUND_ALT+50.0) / FT2M); - FDMExec->GetIC()->SetVgroundFpsIC(40./FT2M); + FDMExec->GetIC()->SetAltitudeAGLFtIC(5.0 / FT2M); + FDMExec->GetIC()->SetVgroundFpsIC(20./FT2M); FDMExec->RunIC(); th = 0.; } diff --git a/sw/simulator/sim_ac_jsbsim.c b/sw/simulator/sim_ac_jsbsim.c index ff749d8f82..41f25a258e 100644 --- a/sw/simulator/sim_ac_jsbsim.c +++ b/sw/simulator/sim_ac_jsbsim.c @@ -25,9 +25,13 @@ #include "sim_ac_jsbsim.h" #include +#include #include #include +#include +using namespace std; + //#include #include @@ -210,8 +214,8 @@ void jsbsim_init(void) { // Use flight plan initial conditions IC->SetLatitudeDegIC(NAV_LAT0 / 1e7); IC->SetLongitudeDegIC(NAV_LON0 / 1e7); - IC->SetAltitudeFtIC((GROUND_ALT+100) / FT2M); - IC->SetTerrainAltitudeFtIC(GROUND_ALT / FT2M); + IC->SetAltitudeAGLFtIC(0.0 / FT2M); + IC->SetTerrainElevationFtIC(GROUND_ALT / FT2M); IC->SetPsiDegIC(QFU); IC->SetVgroundFpsIC(0.); if (!FDMExec->RunIC()) {