diff --git a/conf/airframes/jsbsim.xml b/conf/airframes/jsbsim.xml
index b8430c233b..a5f1812b4d 100644
--- a/conf/airframes/jsbsim.xml
+++ b/conf/airframes/jsbsim.xml
@@ -213,6 +213,8 @@
CONFIG = \"tiny_2_1.h\"
+MY_JSBSIM_ROOT = /home/violato/enac/programs/JSBSim
+MY_JSBSIM_LIB = /home/violato/enac/programs/install_jsbsim
include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile
@@ -224,11 +226,11 @@ sim.ARCH = sitl
sim.TARGET = sim
sim.TARGETDIR = sim
-sim.CFLAGS += -I$(SIMDIR) -I/home/cocoleon/usr/include/JSBSim -I/usr/include
+sim.CFLAGS += -I$(SIMDIR) -I/usr/local/include -I$(MY_JSBSIM_LIB)/include/JSBSim
sim.CFLAGS += `pkg-config glib-2.0 --cflags` -I /usr/include/meschach
-sim.LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lmeschach -lpcre -lglibivy -L/home/cocoleon/usr/lib/ -lJSBSim
+sim.LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lmeschach -lpcre -lglibivy -L$(MY_JSBSIM_LIB)/lib -lJSBSim
-sim.CFLAGS += -DJSBSIM_ROOT_DIR=\"/home/cocoleon/dev/paparazzi3/conf/simulator/JSBSim/\"
+sim.CFLAGS += -DJSBSIM_ROOT_DIR=\"/home/violato/enac/programs/JSBSim/\"
sim.CFLAGS += -DCONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN
@@ -238,7 +240,7 @@ sim.srcs = $(SRC_ARCH)/sim_jsbsim.c $(SRC_ARCH)/ivy_transport.c
sim.srcs += latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl.c fw_v_ctl.c nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c
sim.srcs += nav_line.c nav_survey_rectangle.c
-sim.srcs += $(SIMDIR)/sim_ac_jsbsim.cpp $(SIMDIR)/sim_ac_fw.cpp
+sim.srcs += $(SIMDIR)/sim_ac_jsbsim.c $(SIMDIR)/sim_ac_fw.c
diff --git a/sw/simulator/Makefile b/sw/simulator/Makefile
index e386e5668f..fd063dbe04 100644
--- a/sw/simulator/Makefile
+++ b/sw/simulator/Makefile
@@ -87,24 +87,23 @@ clean :
#
# NPS
#
-JSBSIM = /home/violato/JSBSim
+JSBSIM = /usr/local
CC = g++
-CFLAGS = -Wall -I $(JSBSIM)/src -I../include
+CFLAGS = -Wall -I $(JSBSIM)/include/JSBSim -I../include
LDFLAGS = -L $(JSBSIM)/lib -lJSBSim
-CFLAGS += -I /usr/include/meschach
-LDFLAGS += -lmeschach
+CFLAGS += -I /usr/include/meschach -I /usr/local/include/
+LDFLAGS += -lmeschach -L /usr/lib
CFLAGS += `pkg-config glib-2.0 --cflags`
LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lpcre -lglibivy
test1: nps_test1.c nps_jsbsim.c
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
-test2: nps_test2.c nps_jsbsim.c
+test2: nps_test2.c
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
-
#
# Dependencies
#
diff --git a/sw/simulator/nps_fdm.h b/sw/simulator/nps_fdm.h
index cb727869ba..d56e7d8d0b 100644
--- a/sw/simulator/nps_fdm.h
+++ b/sw/simulator/nps_fdm.h
@@ -1,21 +1,26 @@
#ifndef NPS_FDM
#define NPS_FDM
+
#include "std.h"
-#include
+#include
/* Unit Conversion Constants */
#define FT2M 0.3048
-/* Vehicle specific descriptions */
+/********************************************/
+/* Vehicle specific descriptions */
+/********************************************/
+/* Dummy test vehicle (mass with vertical force) */
struct NpsDummy {
/* throttle for the control force */
double f_input;
};
+/* Quadrotor */
#define NPS_QUAD_MOTOR_FRONT 0
#define NPS_QUAD_MOTOR_BACK 1
#define NPS_QUAD_MOTOR_RIGHT 2
@@ -32,6 +37,7 @@ struct NpsQuad {
};
+/* Fixed Wing Airplane */
#define NPS_SFW_ACTUATOR_THROTTLE 0
#define NPS_SFW_ACTUATOR_AILERON_R 1
#define NPS_SFW_ACTUATOR_AILERON_L 2
@@ -48,10 +54,14 @@ struct NpsSFW {
};
+/********************************************/
+/* State Structure */
+/********************************************/
struct NpsFdmState {
- // generic vehicle state
+ // part of state
+ // valid for any kind of vehicle
bool_t on_ground;
VEC* ecef_pos;
@@ -71,13 +81,4 @@ struct NpsFdmState {
};
-
-
-
-
-
-
-
-
-
#endif /* NPS_FDM */
diff --git a/sw/simulator/nps_jsbsim.c b/sw/simulator/nps_jsbsim.c
index 770808f2e2..0b22f8370c 100644
--- a/sw/simulator/nps_jsbsim.c
+++ b/sw/simulator/nps_jsbsim.c
@@ -5,12 +5,9 @@
#include