diff --git a/sw/simulator/nps_fdm.h b/sw/simulator/nps_fdm.h index bbf8d08cae..de0a5ea0f2 100644 --- a/sw/simulator/nps_fdm.h +++ b/sw/simulator/nps_fdm.h @@ -22,7 +22,7 @@ struct NpsFdm { extern struct NpsFdm fdm; -extern void nps_fdm_init(); -extern void nps_fdm_run_step(double* commands, double dt); +extern void nps_fdm_init(double dt); +extern void nps_fdm_run_step(double* commands); #endif /* NPS_FDM */ diff --git a/sw/simulator/nps_fdm_jsbsim.c b/sw/simulator/nps_fdm_jsbsim.c new file mode 100644 index 0000000000..4ff95894a3 --- /dev/null +++ b/sw/simulator/nps_fdm_jsbsim.c @@ -0,0 +1,46 @@ + +#include +#include +#include + +#include "nps_fdm.h" + +#include "airframe.h" + +using namespace JSBSim; + +void nps_fdm_feed_jsbsim(void); +void nps_fdm_fetch_state(void); + +FGFDMExec* FDMExec; + +void nps_fdm_init(double dt) { + + // FDMExec = new FGFDMExec(); + +} + +void nps_fdm_run_step(double* commands) { + + nps_fdm_feed_jsbsim(double* commands); + + /* run JSBSim */ + + nps_fdm_fetch_state(); + +} + +void nps_fdm_feed_jsbsim(double* commands) { + +#if 0 + printf("Actuators Names:\n"); + for (int i=0; i