diff --git a/conf/airframes/ENAC/quadrotor/blender.xml b/conf/airframes/ENAC/quadrotor/blender.xml index 8001cd5ac6..a71b809f98 100644 --- a/conf/airframes/ENAC/quadrotor/blender.xml +++ b/conf/airframes/ENAC/quadrotor/blender.xml @@ -17,7 +17,7 @@ - + diff --git a/conf/airframes/ENAC/quadrotor/booz2_g1.xml b/conf/airframes/ENAC/quadrotor/booz2_g1.xml index 5c54678904..4edc153027 100644 --- a/conf/airframes/ENAC/quadrotor/booz2_g1.xml +++ b/conf/airframes/ENAC/quadrotor/booz2_g1.xml @@ -22,7 +22,7 @@ - + diff --git a/conf/airframes/ENAC/quadrotor/navgo.xml b/conf/airframes/ENAC/quadrotor/navgo.xml index 06f971bcc3..3b64ce701e 100644 --- a/conf/airframes/ENAC/quadrotor/navgo.xml +++ b/conf/airframes/ENAC/quadrotor/navgo.xml @@ -17,7 +17,7 @@ - + diff --git a/conf/airframes/Poine/booz2_a1.xml b/conf/airframes/Poine/booz2_a1.xml index 08ca88b9d5..ea9b298445 100644 --- a/conf/airframes/Poine/booz2_a1.xml +++ b/conf/airframes/Poine/booz2_a1.xml @@ -196,7 +196,7 @@ - + diff --git a/conf/airframes/Poine/booz2_a7.xml b/conf/airframes/Poine/booz2_a7.xml index 33ad581dfe..7d3d2db322 100644 --- a/conf/airframes/Poine/booz2_a7.xml +++ b/conf/airframes/Poine/booz2_a7.xml @@ -220,7 +220,7 @@ - + diff --git a/conf/airframes/TestHardware/LisaL_v1.1_aspirin_v1.5_overo_rc.xml b/conf/airframes/TestHardware/LisaL_v1.1_aspirin_v1.5_overo_rc.xml index 72a77e955e..b455885d32 100644 --- a/conf/airframes/TestHardware/LisaL_v1.1_aspirin_v1.5_overo_rc.xml +++ b/conf/airframes/TestHardware/LisaL_v1.1_aspirin_v1.5_overo_rc.xml @@ -14,18 +14,17 @@ - - - - + + - + - + + @@ -84,13 +83,11 @@ -
-
@@ -268,7 +265,7 @@
- +
diff --git a/conf/airframes/TestHardware/LisaL_v1.1_b2_v1.2_rc.xml b/conf/airframes/TestHardware/LisaL_v1.1_b2_v1.2_rc.xml index da606215dd..06c7642f92 100644 --- a/conf/airframes/TestHardware/LisaL_v1.1_b2_v1.2_rc.xml +++ b/conf/airframes/TestHardware/LisaL_v1.1_b2_v1.2_rc.xml @@ -8,23 +8,6 @@ GPS connected to UART1 (Since this is inside in a metal box it won't ever get a solution) --> - @@ -32,18 +15,17 @@ - - - - + + - + - + + diff --git a/conf/airframes/booz2_flixr.xml b/conf/airframes/booz2_flixr.xml index c8366f5b2f..fe190c5893 100644 --- a/conf/airframes/booz2_flixr.xml +++ b/conf/airframes/booz2_flixr.xml @@ -9,7 +9,7 @@ - + diff --git a/conf/airframes/esden/lisa_asctec.xml b/conf/airframes/esden/lisa_asctec.xml index adaff15afd..0dd596b3d0 100644 --- a/conf/airframes/esden/lisa_asctec.xml +++ b/conf/airframes/esden/lisa_asctec.xml @@ -183,18 +183,17 @@ - - - + - + + diff --git a/conf/airframes/esden/lisa_asctec_aspirin.xml b/conf/airframes/esden/lisa_asctec_aspirin.xml index 353d779425..f8e702ef25 100644 --- a/conf/airframes/esden/lisa_asctec_aspirin.xml +++ b/conf/airframes/esden/lisa_asctec_aspirin.xml @@ -191,7 +191,7 @@ - + diff --git a/conf/airframes/esden/lisa_m_2_asp_2_pwm.xml b/conf/airframes/esden/lisa_m_2_asp_2_pwm.xml index 892ef1d6d7..faaafac84a 100644 --- a/conf/airframes/esden/lisa_m_2_asp_2_pwm.xml +++ b/conf/airframes/esden/lisa_m_2_asp_2_pwm.xml @@ -39,13 +39,6 @@ - -
- - -
- -
@@ -187,19 +180,19 @@ - - - + - + + + diff --git a/conf/airframes/esden/lisa_m_pwm.xml b/conf/airframes/esden/lisa_m_pwm.xml index 4cb95d11fe..c5d8181dc9 100644 --- a/conf/airframes/esden/lisa_m_pwm.xml +++ b/conf/airframes/esden/lisa_m_pwm.xml @@ -30,13 +30,6 @@ - -
- - -
- -
@@ -206,19 +199,20 @@ - - - - + - + + + + + diff --git a/conf/airframes/esden/lisa_pwm_aspirin.xml b/conf/airframes/esden/lisa_pwm_aspirin.xml index 3367a22503..ba20f5f612 100644 --- a/conf/airframes/esden/lisa_pwm_aspirin.xml +++ b/conf/airframes/esden/lisa_pwm_aspirin.xml @@ -192,7 +192,7 @@ - + diff --git a/conf/airframes/examples/booz2.xml b/conf/airframes/examples/booz2.xml index 08ca88b9d5..1358e373ac 100644 --- a/conf/airframes/examples/booz2.xml +++ b/conf/airframes/examples/booz2.xml @@ -14,12 +14,10 @@ -
-
@@ -196,7 +194,7 @@ - + diff --git a/conf/airframes/examples/quadrotor_lisa_m_2_pwm.xml b/conf/airframes/examples/quadrotor_lisa_m_2_pwm.xml index 85318f3940..086d19d6a9 100644 --- a/conf/airframes/examples/quadrotor_lisa_m_2_pwm.xml +++ b/conf/airframes/examples/quadrotor_lisa_m_2_pwm.xml @@ -7,13 +7,17 @@ + + + + - + @@ -175,6 +179,12 @@
+
+ + + +
+
diff --git a/conf/airframes/examples/quadrotor_lisa_m_mkk.xml b/conf/airframes/examples/quadrotor_lisa_m_mkk.xml index dd779d1092..90669f5d1a 100644 --- a/conf/airframes/examples/quadrotor_lisa_m_mkk.xml +++ b/conf/airframes/examples/quadrotor_lisa_m_mkk.xml @@ -8,7 +8,7 @@ - + @@ -172,7 +172,7 @@
- +
diff --git a/conf/airframes/fraser_lisa_m_rotorcraft.xml b/conf/airframes/fraser_lisa_m_rotorcraft.xml index b3f63b31b7..58895e699f 100644 --- a/conf/airframes/fraser_lisa_m_rotorcraft.xml +++ b/conf/airframes/fraser_lisa_m_rotorcraft.xml @@ -11,7 +11,7 @@ - + @@ -208,7 +208,7 @@
- +
diff --git a/conf/airframes/mm/rotor/qmk1.xml b/conf/airframes/mm/rotor/qmk1.xml index a764708ed5..7e68014115 100644 --- a/conf/airframes/mm/rotor/qmk1.xml +++ b/conf/airframes/mm/rotor/qmk1.xml @@ -16,7 +16,6 @@ -
@@ -191,7 +190,7 @@ - + diff --git a/conf/airframes/mm/rotor/quadrotor_lisa_l_mkk.xml b/conf/airframes/mm/rotor/quadrotor_lisa_l_mkk.xml index 2a33d4606f..9b6368bfea 100644 --- a/conf/airframes/mm/rotor/quadrotor_lisa_l_mkk.xml +++ b/conf/airframes/mm/rotor/quadrotor_lisa_l_mkk.xml @@ -8,7 +8,7 @@ - + diff --git a/conf/airframes/mm/rotor/quadrotor_lisa_m_1_pwm.xml b/conf/airframes/mm/rotor/quadrotor_lisa_m_1_pwm.xml index 049f24cde7..5c82a07e1b 100644 --- a/conf/airframes/mm/rotor/quadrotor_lisa_m_1_pwm.xml +++ b/conf/airframes/mm/rotor/quadrotor_lisa_m_1_pwm.xml @@ -4,16 +4,14 @@ - - - - - + - + + + @@ -41,13 +39,6 @@ - -
- - - -
-
diff --git a/conf/airframes/mm/rotor/quadrotor_lisa_m_2_pwm.xml b/conf/airframes/mm/rotor/quadrotor_lisa_m_2_pwm.xml index 60b9ba120c..513331c1c2 100644 --- a/conf/airframes/mm/rotor/quadrotor_lisa_m_2_pwm.xml +++ b/conf/airframes/mm/rotor/quadrotor_lisa_m_2_pwm.xml @@ -4,15 +4,14 @@ - - - - + - + + + diff --git a/conf/firmwares/subsystems/rotorcraft/actuators_asctec.makefile b/conf/firmwares/subsystems/rotorcraft/actuators_asctec.makefile index 167ccc3068..d1d1c1137d 100644 --- a/conf/firmwares/subsystems/rotorcraft/actuators_asctec.makefile +++ b/conf/firmwares/subsystems/rotorcraft/actuators_asctec.makefile @@ -13,6 +13,6 @@ endif # Simulator -sim.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c -sim.CFLAGS += -DUSE_I2C0 -DACTUATORS_ASCTEC_DEVICE=i2c0 +nps.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c +nps.CFLAGS += -DUSE_I2C0 -DACTUATORS_ASCTEC_DEVICE=i2c0 diff --git a/conf/firmwares/subsystems/rotorcraft/actuators_asctec_v2.makefile b/conf/firmwares/subsystems/rotorcraft/actuators_asctec_v2.makefile index 6aa20bc4fc..eaa8e486c8 100644 --- a/conf/firmwares/subsystems/rotorcraft/actuators_asctec_v2.makefile +++ b/conf/firmwares/subsystems/rotorcraft/actuators_asctec_v2.makefile @@ -31,6 +31,6 @@ ap.CFLAGS += -DUSE_I2C1 endif # Simulator -sim.srcs += $(SRC_FIRMWARE)/actuators/supervision.c -sim.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c -sim.CFLAGS += -DUSE_I2C0 -DACTUATORS_ASCTEC_DEVICE=i2c0 +nps.srcs += $(SRC_FIRMWARE)/actuators/supervision.c +nps.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c +nps.CFLAGS += -DUSE_I2C0 -DACTUATORS_ASCTEC_DEVICE=i2c0 diff --git a/conf/firmwares/subsystems/rotorcraft/actuators_mkk.makefile b/conf/firmwares/subsystems/rotorcraft/actuators_mkk.makefile index 874c998a31..440c947fd8 100644 --- a/conf/firmwares/subsystems/rotorcraft/actuators_mkk.makefile +++ b/conf/firmwares/subsystems/rotorcraft/actuators_mkk.makefile @@ -52,6 +52,6 @@ ap.CFLAGS += -DUSE_I2C1 endif # Simulator -sim.srcs += $(SRC_FIRMWARE)/actuators/supervision.c -sim.srcs += $(SRC_FIRMWARE)/actuators/actuators_mkk.c -sim.CFLAGS += -DUSE_I2C0 -DACTUATORS_MKK_DEVICE=i2c0 +nps.srcs += $(SRC_FIRMWARE)/actuators/supervision.c +nps.srcs += $(SRC_FIRMWARE)/actuators/actuators_mkk.c +nps.CFLAGS += -DUSE_I2C0 -DACTUATORS_MKK_DEVICE=i2c0 diff --git a/conf/firmwares/subsystems/rotorcraft/actuators_pwm_supervision.makefile b/conf/firmwares/subsystems/rotorcraft/actuators_pwm_supervision.makefile index d092a2ff9a..0a20b31688 100644 --- a/conf/firmwares/subsystems/rotorcraft/actuators_pwm_supervision.makefile +++ b/conf/firmwares/subsystems/rotorcraft/actuators_pwm_supervision.makefile @@ -7,6 +7,6 @@ ap.srcs += $(SRC_FIRMWARE)/actuators/actuators_pwm_supervision.c ap.srcs += $(SRC_FIRMWARE)/actuators/arch/$(ARCH)/actuators_pwm_arch.c # Simulator -sim.srcs += $(SRC_FIRMWARE)/actuators/supervision.c -sim.srcs += $(SRC_FIRMWARE)/actuators/actuators_pwm_supervision.c -sim.srcs += $(SRC_FIRMWARE)/actuators/arch/$(ARCH)/actuators_pwm_arch.c +nps.srcs += $(SRC_FIRMWARE)/actuators/supervision.c +nps.srcs += $(SRC_FIRMWARE)/actuators/actuators_pwm_supervision.c +nps.srcs += $(SRC_FIRMWARE)/actuators/arch/$(ARCH)/actuators_pwm_arch.c diff --git a/conf/firmwares/subsystems/rotorcraft/actuators_skiron.makefile b/conf/firmwares/subsystems/rotorcraft/actuators_skiron.makefile index b46487f875..6365fbbfbb 100644 --- a/conf/firmwares/subsystems/rotorcraft/actuators_skiron.makefile +++ b/conf/firmwares/subsystems/rotorcraft/actuators_skiron.makefile @@ -47,7 +47,7 @@ ap.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=$(SKIRON_I2C_SCL_TIME) -DI2C0_SCLH=$(SKIRON_ endif # Simulator -sim.srcs += $(SRC_FIRMWARE)/actuators/supervision.c -sim.srcs += $(SRC_FIRMWARE)/actuators/actuators_skiron.c -sim.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=$(SKIRON_I2C_SCL_TIME) -DI2C0_SCLH=$(SKIRON_I2C_SCL_TIME) -DI2C0_VIC_SLOT=10 -DACTUATORS_MKK_DEVICE=i2c0 +nps.srcs += $(SRC_FIRMWARE)/actuators/supervision.c +nps.srcs += $(SRC_FIRMWARE)/actuators/actuators_skiron.c +nps.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=$(SKIRON_I2C_SCL_TIME) -DI2C0_SCLH=$(SKIRON_I2C_SCL_TIME) -DI2C0_VIC_SLOT=10 -DACTUATORS_MKK_DEVICE=i2c0 diff --git a/conf/firmwares/subsystems/rotorcraft/ahrs_float_cmpl_quat.makefile b/conf/firmwares/subsystems/rotorcraft/ahrs_float_cmpl_quat.makefile index 2b1c2f6ef3..b3d9af5c68 100644 --- a/conf/firmwares/subsystems/rotorcraft/ahrs_float_cmpl_quat.makefile +++ b/conf/firmwares/subsystems/rotorcraft/ahrs_float_cmpl_quat.makefile @@ -30,5 +30,5 @@ AHRS_SRCS += subsystems/ahrs/ahrs_aligner.c ap.CFLAGS += $(AHRS_CFLAGS) ap.srcs += $(AHRS_SRCS) -sim.CFLAGS += $(AHRS_CFLAGS) -sim.srcs += $(AHRS_SRCS) +nps.CFLAGS += $(AHRS_CFLAGS) +nps.srcs += $(AHRS_SRCS) diff --git a/conf/firmwares/subsystems/rotorcraft/ahrs_float_cmpl_rmat.makefile b/conf/firmwares/subsystems/rotorcraft/ahrs_float_cmpl_rmat.makefile index 96d668d346..3a240cc2af 100644 --- a/conf/firmwares/subsystems/rotorcraft/ahrs_float_cmpl_rmat.makefile +++ b/conf/firmwares/subsystems/rotorcraft/ahrs_float_cmpl_rmat.makefile @@ -30,5 +30,5 @@ AHRS_SRCS += subsystems/ahrs/ahrs_aligner.c ap.CFLAGS += $(AHRS_CFLAGS) ap.srcs += $(AHRS_SRCS) -sim.CFLAGS += $(AHRS_CFLAGS) -sim.srcs += $(AHRS_SRCS) +nps.CFLAGS += $(AHRS_CFLAGS) +nps.srcs += $(AHRS_SRCS) diff --git a/conf/firmwares/subsystems/rotorcraft/ahrs_int_cmpl_euler.makefile b/conf/firmwares/subsystems/rotorcraft/ahrs_int_cmpl_euler.makefile index 32c0fd89e9..ef5f8d3e47 100644 --- a/conf/firmwares/subsystems/rotorcraft/ahrs_int_cmpl_euler.makefile +++ b/conf/firmwares/subsystems/rotorcraft/ahrs_int_cmpl_euler.makefile @@ -26,5 +26,5 @@ AHRS_SRCS += subsystems/ahrs/ahrs_aligner.c ap.CFLAGS += $(AHRS_CFLAGS) ap.srcs += $(AHRS_SRCS) -sim.CFLAGS += $(AHRS_CFLAGS) -sim.srcs += $(AHRS_SRCS) +nps.CFLAGS += $(AHRS_CFLAGS) +nps.srcs += $(AHRS_SRCS) diff --git a/conf/firmwares/subsystems/rotorcraft/ahrs_int_cmpl_quat.makefile b/conf/firmwares/subsystems/rotorcraft/ahrs_int_cmpl_quat.makefile index 6db584eb6a..1325776ead 100644 --- a/conf/firmwares/subsystems/rotorcraft/ahrs_int_cmpl_quat.makefile +++ b/conf/firmwares/subsystems/rotorcraft/ahrs_int_cmpl_quat.makefile @@ -29,5 +29,5 @@ AHRS_SRCS += subsystems/ahrs/ahrs_aligner.c ap.CFLAGS += $(AHRS_CFLAGS) ap.srcs += $(AHRS_SRCS) -sim.CFLAGS += $(AHRS_CFLAGS) -sim.srcs += $(AHRS_SRCS) +nps.CFLAGS += $(AHRS_CFLAGS) +nps.srcs += $(AHRS_SRCS) diff --git a/conf/firmwares/subsystems/rotorcraft/ahrs_lkf.makefile b/conf/firmwares/subsystems/rotorcraft/ahrs_lkf.makefile index 0d580e6e56..2c942a23cf 100644 --- a/conf/firmwares/subsystems/rotorcraft/ahrs_lkf.makefile +++ b/conf/firmwares/subsystems/rotorcraft/ahrs_lkf.makefile @@ -7,7 +7,7 @@ ap.srcs += $(SRC_SUBSYSTEMS)/ahrs.c ap.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_aligner.c ap.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_float_lkf.c -sim.CFLAGS += -DUSE_AHRS_LKF -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED) -sim.srcs += $(SRC_SUBSYSTEMS)/ahrs.c -sim.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_aligner.c -sim.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_float_lkf.c +nps.CFLAGS += -DUSE_AHRS_LKF -DAHRS_ALIGNER_LED=$(AHRS_ALIGNER_LED) +nps.srcs += $(SRC_SUBSYSTEMS)/ahrs.c +nps.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_aligner.c +nps.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_float_lkf.c diff --git a/conf/firmwares/subsystems/rotorcraft/ahrs_mlkf.makefile b/conf/firmwares/subsystems/rotorcraft/ahrs_mlkf.makefile index 1410a9913b..b9ff3b0701 100644 --- a/conf/firmwares/subsystems/rotorcraft/ahrs_mlkf.makefile +++ b/conf/firmwares/subsystems/rotorcraft/ahrs_mlkf.makefile @@ -8,9 +8,9 @@ ap.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_aligner.c ap.srcs += $(SRC_BOOZ_PRIV)/ahrs/booz_ahrs_mlkf.c ap.srcs += $(SRC_BOOZ_PRIV)/ahrs/booz_ahrs_opt.c -sim.CFLAGS += -I$(SRC_BOOZ_PRIV) -sim.CFLAGS += -DAHRS_ALIGNER_LED=3 -sim.srcs += $(SRC_SUBSYSTEMS)/ahrs.c -sim.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_aligner.c -sim.srcs += $(SRC_BOOZ_PRIV)/ahrs/booz_ahrs_mlkf.c -sim.srcs += $(SRC_BOOZ_PRIV)/ahrs/booz_ahrs_mlkf_opt.c +nps.CFLAGS += -I$(SRC_BOOZ_PRIV) +nps.CFLAGS += -DAHRS_ALIGNER_LED=3 +nps.srcs += $(SRC_SUBSYSTEMS)/ahrs.c +nps.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_aligner.c +nps.srcs += $(SRC_BOOZ_PRIV)/ahrs/booz_ahrs_mlkf.c +nps.srcs += $(SRC_BOOZ_PRIV)/ahrs/booz_ahrs_mlkf_opt.c diff --git a/conf/firmwares/subsystems/rotorcraft/fdm_nps.makefile b/conf/firmwares/subsystems/rotorcraft/fdm_nps.makefile index 169d0ee8c3..cf819b2853 100644 --- a/conf/firmwares/subsystems/rotorcraft/fdm_nps.makefile +++ b/conf/firmwares/subsystems/rotorcraft/fdm_nps.makefile @@ -17,28 +17,28 @@ SRC_BOARD=boards/$(BOARD) NPSDIR = $(SIMDIR)/nps -sim.ARCHDIR = $(ARCH) +nps.ARCHDIR = sim -sim.CFLAGS += -DSITL -DUSE_NPS -sim.CFLAGS += `pkg-config glib-2.0 --cflags` -sim.LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lglibivy -lgsl -lgslcblas -sim.CFLAGS += -I$(NPSDIR) -I$(SRC_FIRMWARE) -I$(SRC_BOARD) -I../simulator -I$(PAPARAZZI_HOME)/conf/simulator/nps +nps.CFLAGS += -DSITL -DUSE_NPS +nps.CFLAGS += `pkg-config glib-2.0 --cflags` +nps.LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lglibivy -lgsl -lgslcblas +nps.CFLAGS += -I$(NPSDIR) -I$(SRC_FIRMWARE) -I$(SRC_BOARD) -I../simulator -I$(PAPARAZZI_HOME)/conf/simulator/nps # use the paparazzi-jsbsim package if it is installed, otherwise look for JSBsim under /opt/jsbsim ifndef JSBSIM_PKG JSBSIM_PKG = $(shell pkg-config JSBSim --exists && echo 'yes') endif ifeq ($(JSBSIM_PKG), yes) - sim.CFLAGS += `pkg-config JSBSim --cflags` - sim.LDFLAGS += `pkg-config JSBSim --libs` + nps.CFLAGS += `pkg-config JSBSim --cflags` + nps.LDFLAGS += `pkg-config JSBSim --libs` else JSBSIM_PKG = no - sim.CFLAGS += -I$(JSBSIM_INC) - sim.LDFLAGS += -L$(JSBSIM_LIB) -lJSBSim + nps.CFLAGS += -I$(JSBSIM_INC) + nps.LDFLAGS += -L$(JSBSIM_LIB) -lJSBSim endif -sim.srcs += $(NPSDIR)/nps_main.c \ +nps.srcs += $(NPSDIR)/nps_main.c \ $(NPSDIR)/nps_fdm_jsbsim.c \ $(NPSDIR)/nps_random.c \ $(NPSDIR)/nps_sensors.c \ @@ -57,53 +57,53 @@ sim.srcs += $(NPSDIR)/nps_main.c \ -sim.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) +nps.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -sim.srcs += firmwares/rotorcraft/main.c -sim.srcs += mcu.c -sim.srcs += $(SRC_ARCH)/mcu_arch.c +nps.srcs += firmwares/rotorcraft/main.c +nps.srcs += mcu.c +nps.srcs += $(SRC_ARCH)/mcu_arch.c -ifeq ($(TARGET), sim) +ifeq ($(TARGET), nps) include $(CFG_SHARED)/i2c_select.makefile endif -sim.CFLAGS += -DPERIODIC_FREQUENCY=512 -#sim.CFLAGS += -DUSE_LED -sim.srcs += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c +nps.CFLAGS += -DPERIODIC_FREQUENCY=512 +#nps.CFLAGS += -DUSE_LED +nps.srcs += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c -sim.srcs += subsystems/settings.c -sim.srcs += $(SRC_ARCH)/subsystems/settings_arch.c +nps.srcs += subsystems/settings.c +nps.srcs += $(SRC_ARCH)/subsystems/settings_arch.c -sim.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -sim.srcs += $(SRC_FIRMWARE)/telemetry.c \ +nps.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport +nps.srcs += $(SRC_FIRMWARE)/telemetry.c \ subsystems/datalink/downlink.c \ $(SRC_ARCH)/ivy_transport.c -sim.srcs += $(SRC_FIRMWARE)/commands.c +nps.srcs += $(SRC_FIRMWARE)/commands.c -sim.srcs += $(SRC_FIRMWARE)/datalink.c +nps.srcs += $(SRC_FIRMWARE)/datalink.c # # Math functions # -sim.srcs += math/pprz_geodetic_int.c math/pprz_geodetic_float.c math/pprz_geodetic_double.c math/pprz_trig_int.c +nps.srcs += math/pprz_geodetic_int.c math/pprz_geodetic_float.c math/pprz_geodetic_double.c math/pprz_trig_int.c -sim.CFLAGS += -DROTORCRAFT_BARO_LED=2 -sim.srcs += $(SRC_BOARD)/baro_board.c +nps.CFLAGS += -DROTORCRAFT_BARO_LED=2 +nps.srcs += $(SRC_BOARD)/baro_board.c -sim.CFLAGS += -DUSE_ADC -sim.srcs += $(SRC_ARCH)/mcu_periph/adc_arch.c -sim.srcs += subsystems/electrical.c +nps.CFLAGS += -DUSE_ADC +nps.srcs += $(SRC_ARCH)/mcu_periph/adc_arch.c +nps.srcs += subsystems/electrical.c # baro has variable offset amplifier on booz board -#sim.CFLAGS += -DUSE_DAC -#sim.srcs += $(SRC_ARCH)/mcu_periph/dac_arch.c +#nps.CFLAGS += -DUSE_DAC +#nps.srcs += $(SRC_ARCH)/mcu_periph/dac_arch.c -#sim.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\" -#sim.CFLAGS += -DIMU_B2_VERSION_1_1 +#nps.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\" +#nps.CFLAGS += -DIMU_B2_VERSION_1_1 -sim.srcs += $(SRC_FIRMWARE)/autopilot.c +nps.srcs += $(SRC_FIRMWARE)/autopilot.c # # in makefile section of airframe xml @@ -112,9 +112,9 @@ sim.srcs += $(SRC_FIRMWARE)/autopilot.c # include $(CFG_BOOZ)/subsystems/booz2_ahrs_cmpl.makefile # -sim.srcs += $(SRC_FIRMWARE)/stabilization.c -sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_rate.c -sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_none.c +nps.srcs += $(SRC_FIRMWARE)/stabilization.c +nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_rate.c +nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_none.c NUM_TYPE=integer @@ -124,39 +124,39 @@ STAB_TYPE=euler #STAB_TYPE=quaternion ifeq ($(NUM_TYPE), integer) - sim.CFLAGS += -DSTABILISATION_ATTITUDE_TYPE_INT - sim.CFLAGS += -DSTABILISATION_ATTITUDE_H=\"stabilization/stabilization_attitude_int.h\" + nps.CFLAGS += -DSTABILISATION_ATTITUDE_TYPE_INT + nps.CFLAGS += -DSTABILISATION_ATTITUDE_H=\"stabilization/stabilization_attitude_int.h\" ifeq ($(STAB_TYPE), euler) - sim.CFLAGS += -DSTABILISATION_ATTITUDE_REF_H=\"stabilization/stabilization_attitude_ref_euler_int.h\" - sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_ref_euler_int.c - sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_euler_int.c + nps.CFLAGS += -DSTABILISATION_ATTITUDE_REF_H=\"stabilization/stabilization_attitude_ref_euler_int.h\" + nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_ref_euler_int.c + nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_euler_int.c else ifeq ($(STAB_TYPE), quaternion) - sim.CFLAGS += -DSTABILISATION_ATTITUDE_REF_H=\"stabilization/stabilization_attitude_ref_quat_int.h\" - sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_ref_quat_int.c - sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_quat_int.c + nps.CFLAGS += -DSTABILISATION_ATTITUDE_REF_H=\"stabilization/stabilization_attitude_ref_quat_int.h\" + nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_ref_quat_int.c + nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_quat_int.c endif else ifeq ($(NUM_TYPE), float) - sim.CFLAGS += -DSTABILISATION_ATTITUDE_TYPE_FLOAT - sim.CFLAGS += -DSTABILISATION_ATTITUDE_H=\"stabilization/stabilization_attitude_float.h\" + nps.CFLAGS += -DSTABILISATION_ATTITUDE_TYPE_FLOAT + nps.CFLAGS += -DSTABILISATION_ATTITUDE_H=\"stabilization/stabilization_attitude_float.h\" ifeq ($(STAB_TYPE), euler) - sim.CFLAGS += -DSTABILISATION_ATTITUDE_REF_H=\"stabilization/stabilization_attitude_ref_euler_float.h\" - sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_ref_euler_float.c - sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_euler_float.c + nps.CFLAGS += -DSTABILISATION_ATTITUDE_REF_H=\"stabilization/stabilization_attitude_ref_euler_float.h\" + nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_ref_euler_float.c + nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_euler_float.c else ifeq ($(STAB_TYPE), quaternion) - sim.CFLAGS += -DSTABILISATION_ATTITUDE_REF_H=\"stabilization/stabilization_attitude_ref_quat_float.h\" - sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_ref_quat_float.c - sim.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_quat_float.c + nps.CFLAGS += -DSTABILISATION_ATTITUDE_REF_H=\"stabilization/stabilization_attitude_ref_quat_float.h\" + nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_ref_quat_float.c + nps.srcs += $(SRC_FIRMWARE)/stabilization/stabilization_attitude_quat_float.c endif endif -sim.CFLAGS += -DUSE_NAVIGATION -sim.srcs += $(SRC_FIRMWARE)/guidance/guidance_h.c -sim.srcs += $(SRC_FIRMWARE)/guidance/guidance_v.c -sim.srcs += $(SRC_SUBSYSTEMS)/ins.c +nps.CFLAGS += -DUSE_NAVIGATION +nps.srcs += $(SRC_FIRMWARE)/guidance/guidance_h.c +nps.srcs += $(SRC_FIRMWARE)/guidance/guidance_v.c +nps.srcs += $(SRC_SUBSYSTEMS)/ins.c # vertical filter float version -sim.srcs += $(SRC_SUBSYSTEMS)/ins/vf_float.c -sim.CFLAGS += -DUSE_VFF -DDT_VFILTER='(1./512.)' +nps.srcs += $(SRC_SUBSYSTEMS)/ins/vf_float.c +nps.CFLAGS += -DUSE_VFF -DDT_VFILTER='(1./512.)' # # INS choice @@ -167,5 +167,5 @@ sim.CFLAGS += -DUSE_VFF -DDT_VFILTER='(1./512.)' # -sim.srcs += $(SRC_FIRMWARE)/navigation.c -sim.srcs += $(SRC_SUBSYSTEMS)/navigation/common_flight_plan.c +nps.srcs += $(SRC_FIRMWARE)/navigation.c +nps.srcs += $(SRC_SUBSYSTEMS)/navigation/common_flight_plan.c diff --git a/conf/firmwares/subsystems/rotorcraft/gps_nmea.makefile b/conf/firmwares/subsystems/rotorcraft/gps_nmea.makefile index 766b4d00ff..f90c2aa2bd 100644 --- a/conf/firmwares/subsystems/rotorcraft/gps_nmea.makefile +++ b/conf/firmwares/subsystems/rotorcraft/gps_nmea.makefile @@ -17,7 +17,7 @@ ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_nmea.c $(TARGET).srcs += $(SRC_SUBSYSTEMS)/gps.c -sim.CFLAGS += -DUSE_GPS -sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\" -sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c +nps.CFLAGS += -DUSE_GPS +nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim.h\" +nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c diff --git a/conf/firmwares/subsystems/rotorcraft/gps_skytraq.makefile b/conf/firmwares/subsystems/rotorcraft/gps_skytraq.makefile index 9d4560cfce..57ee37fb20 100644 --- a/conf/firmwares/subsystems/rotorcraft/gps_skytraq.makefile +++ b/conf/firmwares/subsystems/rotorcraft/gps_skytraq.makefile @@ -14,5 +14,5 @@ ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_skytraq.h\" ap.srcs += $(SRC_SUBSYSTEMS)/gps/gps_skytraq.c -sim.CFLAGS += -DUSE_GPS -sim.srcs += $(SRC_SUBSYSTEMS)/gps.c +nps.CFLAGS += -DUSE_GPS +nps.srcs += $(SRC_SUBSYSTEMS)/gps.c diff --git a/conf/firmwares/subsystems/rotorcraft/gps_ublox.makefile b/conf/firmwares/subsystems/rotorcraft/gps_ublox.makefile index c875eebb7f..c99d67ba37 100644 --- a/conf/firmwares/subsystems/rotorcraft/gps_ublox.makefile +++ b/conf/firmwares/subsystems/rotorcraft/gps_ublox.makefile @@ -11,7 +11,7 @@ ifneq ($(GPS_LED),none) ap.CFLAGS += -DGPS_LED=$(GPS_LED) endif -sim.CFLAGS += -DUSE_GPS -sim.srcs += $(SRC_SUBSYSTEMS)/gps.c -sim.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\" -sim.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c +nps.CFLAGS += -DUSE_GPS +nps.srcs += $(SRC_SUBSYSTEMS)/gps.c +nps.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_sim_nps.h\" +nps.srcs += $(SRC_SUBSYSTEMS)/gps/gps_sim_nps.c diff --git a/conf/firmwares/subsystems/rotorcraft/imu_crista.makefile b/conf/firmwares/subsystems/rotorcraft/imu_crista.makefile index aa1dfb9cc9..14f275b05c 100644 --- a/conf/firmwares/subsystems/rotorcraft/imu_crista.makefile +++ b/conf/firmwares/subsystems/rotorcraft/imu_crista.makefile @@ -83,12 +83,4 @@ ap.srcs += $(imu_srcs) # # Simulator # - -sim.CFLAGS += -DIMU_TYPE_H=\"subsystems/imu/imu_crista.h\" -sim.srcs += $(SRC_SUBSYSTEMS)/imu.c -sim.srcs += $(SRC_SUBSYSTEMS)/imu/imu_crista.c -sim.srcs += $(SRC_ARCH)/subsystems/imu/imu_crista_arch.c - -sim.CFLAGS += -DUSE_AMI601 -sim.srcs += peripherals/ami601.c -sim.CFLAGS += -DUSE_I2C1 +include $(CFG_SHARED)/imu_nps.makefile diff --git a/conf/firmwares/subsystems/rotorcraft/imu_crista_hmc5843.makefile b/conf/firmwares/subsystems/rotorcraft/imu_crista_hmc5843.makefile index 9a5faee8fd..e4bb57a2f5 100644 --- a/conf/firmwares/subsystems/rotorcraft/imu_crista_hmc5843.makefile +++ b/conf/firmwares/subsystems/rotorcraft/imu_crista_hmc5843.makefile @@ -84,12 +84,4 @@ ap.srcs += $(imu_srcs) # # Simulator # - -sim.CFLAGS += -DIMU_TYPE_H=\"subsystems/imu/imu_crista.h\" -sim.srcs += $(SRC_SUBSYSTEMS)/imu.c -sim.srcs += $(SRC_SUBSYSTEMS)/imu/imu_crista.c -sim.srcs += $(SRC_ARCH)/subsystems/imu/imu_crista_arch.c - -sim.CFLAGS += -DUSE_AMI601 -sim.srcs += peripherals/ami601.c -sim.CFLAGS += -DUSE_I2C1 +include $(CFG_SHARED)/imu_nps.makefile diff --git a/conf/firmwares/subsystems/shared/imu_aspirin_common.makefile b/conf/firmwares/subsystems/shared/imu_aspirin_common.makefile index b017d4e366..211aa453c9 100644 --- a/conf/firmwares/subsystems/shared/imu_aspirin_common.makefile +++ b/conf/firmwares/subsystems/shared/imu_aspirin_common.makefile @@ -2,26 +2,12 @@ # # Common part for all Aspirin IMUs # +# if ACCEL and GYRO SENS/NEUTRAL are not defined, +# the defaults from the datasheet will be used # # required xml: #
# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# # # # @@ -34,8 +20,6 @@ # # -# imu aspirin - # for fixedwing firmware and ap only ifeq ($(TARGET), ap) IMU_ASPIRIN_CFLAGS = -DUSE_IMU @@ -60,5 +44,4 @@ IMU_ASPIRIN_CFLAGS += -DUSE_EXTI2_IRQ # Accel Int on PD2 IMU_ASPIRIN_CFLAGS += -DUSE_DMA1_C4_IRQ # SPI2 Rx DMA endif -sim.CFLAGS += $(IMU_ASPIRIN_CFLAGS) -DHMC5843_NO_IRQ -sim.srcs += $(IMU_ASPIRIN_SRCS) +include $(CFG_SHARED)/imu_nps.makefile diff --git a/conf/firmwares/subsystems/shared/imu_aspirin_v1.0.makefile b/conf/firmwares/subsystems/shared/imu_aspirin_v1.0.makefile index 3e2e8a7c26..d58fbb5a0e 100644 --- a/conf/firmwares/subsystems/shared/imu_aspirin_v1.0.makefile +++ b/conf/firmwares/subsystems/shared/imu_aspirin_v1.0.makefile @@ -3,25 +3,12 @@ # Aspirin IMU v1.0 # # +# if ACCEL and GYRO SENS/NEUTRAL are not defined, +# the defaults from the datasheet will be used +# # required xml: #
# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# # # # @@ -32,9 +19,6 @@ # #
# -# - -# imu aspirin include $(CFG_SHARED)/imu_aspirin_common.makefile diff --git a/conf/firmwares/subsystems/shared/imu_aspirin_v1.5.makefile b/conf/firmwares/subsystems/shared/imu_aspirin_v1.5.makefile index 2686e94905..6be651292c 100644 --- a/conf/firmwares/subsystems/shared/imu_aspirin_v1.5.makefile +++ b/conf/firmwares/subsystems/shared/imu_aspirin_v1.5.makefile @@ -3,25 +3,12 @@ # Aspirin IMU v1.5 # # +# if ACCEL and GYRO SENS/NEUTRAL are not defined, +# the defaults from the datasheet will be used +# # required xml: #
# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# # # # @@ -32,9 +19,6 @@ # #
# -# - -# imu aspirin include $(CFG_SHARED)/imu_aspirin_common.makefile diff --git a/conf/firmwares/subsystems/shared/imu_aspirin_v2.1.makefile b/conf/firmwares/subsystems/shared/imu_aspirin_v2.1.makefile index 742a8f817b..345f75eba4 100644 --- a/conf/firmwares/subsystems/shared/imu_aspirin_v2.1.makefile +++ b/conf/firmwares/subsystems/shared/imu_aspirin_v2.1.makefile @@ -3,25 +3,12 @@ # Aspirin IMU v2.0 # # +# if ACCEL and GYRO SENS/NEUTRAL are not defined, +# the defaults from the datasheet will be used +# # required xml: #
# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# # # # @@ -34,8 +21,6 @@ # # -# imu aspirin - IMU_ASPIRIN_CFLAGS = -DUSE_IMU IMU_ASPIRIN_CFLAGS += -DIMU_TYPE_H=\"imu/imu_aspirin2.h\" -DIMU_OVERRIDE_CHANNELS IMU_ASPIRIN_SRCS = $(SRC_SUBSYSTEMS)/imu.c \ @@ -62,3 +47,7 @@ IMU_ASPIRIN_CFLAGS += -DIMU_ASPIRIN_VERSION_2_1 ap.CFLAGS += $(IMU_ASPIRIN_CFLAGS) ap.srcs += $(IMU_ASPIRIN_SRCS) +# +# NPS simulator +# +include $(CFG_SHARED)/imu_nps.makefile diff --git a/conf/firmwares/subsystems/shared/imu_b2_common.makefile b/conf/firmwares/subsystems/shared/imu_b2_common.makefile index 84548578b4..5a0a35eafe 100644 --- a/conf/firmwares/subsystems/shared/imu_b2_common.makefile +++ b/conf/firmwares/subsystems/shared/imu_b2_common.makefile @@ -61,17 +61,18 @@ endif # # Simulator # +include $(CFG_SHARED)/imu_nps.makefile -sim.CFLAGS += -DIMU_TYPE_H=\"subsystems/imu/imu_b2.h\" -sim.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_AMI601 -sim.CFLAGS += -DIMU_B2_VERSION_1_0 -sim.srcs += $(SRC_SUBSYSTEMS)/imu.c -sim.srcs += $(SRC_SUBSYSTEMS)/imu/imu_b2.c -sim.srcs += $(SRC_ARCH)/subsystems/imu/imu_b2_arch.c - -sim.srcs += peripherals/max1168.c -sim.srcs += $(SRC_ARCH)/peripherals/max1168_arch.c - -sim.CFLAGS += -DUSE_AMI601 -sim.srcs += peripherals/ami601.c -sim.CFLAGS += -DUSE_I2C1 +#sim.CFLAGS += -DIMU_TYPE_H=\"subsystems/imu/imu_b2.h\" +#sim.CFLAGS += -DIMU_B2_MAG_TYPE=IMU_B2_MAG_AMI601 +#sim.CFLAGS += -DIMU_B2_VERSION_1_0 +#sim.srcs += $(SRC_SUBSYSTEMS)/imu.c +#sim.srcs += $(SRC_SUBSYSTEMS)/imu/imu_b2.c +#sim.srcs += $(SRC_ARCH)/subsystems/imu/imu_b2_arch.c +# +#sim.srcs += peripherals/max1168.c +#sim.srcs += $(SRC_ARCH)/peripherals/max1168_arch.c +# +#sim.CFLAGS += -DUSE_AMI601 +#sim.srcs += peripherals/ami601.c +#sim.CFLAGS += -DUSE_I2C1 diff --git a/conf/firmwares/subsystems/shared/imu_nps.makefile b/conf/firmwares/subsystems/shared/imu_nps.makefile new file mode 100644 index 0000000000..e26d035cd4 --- /dev/null +++ b/conf/firmwares/subsystems/shared/imu_nps.makefile @@ -0,0 +1,24 @@ +# Hey Emacs, this is a -*- makefile -*- +# +# simulated IMU for NPS (NewPaparazziSim) +# +# If ACCEL and GYRO SENS/NEUTRAL are not defined, +# the defaults of aspirin v1.5 are used. +# This fits the nps_sensors_params_default.h +# +# required xml: +#
+# +# +# +# +# +# +# +# +# +#
+# + +nps.CFLAGS += -DIMU_TYPE_H=\"imu/imu_nps.h\" +nps.srcs += $(SRC_SUBSYSTEMS)/imu.c $(SRC_SUBSYSTEMS)/imu/imu_nps.c diff --git a/conf/simulator/nps/nps_sensors_params_default.h b/conf/simulator/nps/nps_sensors_params_default.h new file mode 100644 index 0000000000..1874378859 --- /dev/null +++ b/conf/simulator/nps/nps_sensors_params_default.h @@ -0,0 +1,176 @@ +/* + * Copyright (C) 2012 Felix Ruess + * + * This file is part of paparazzi. + * + * paparazzi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * paparazzi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with paparazzi; see the file COPYING. If not, write to + * the Free Software Foundation, 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef NPS_SENSORS_PARAMS_H +#define NPS_SENSORS_PARAMS_H + +#include "generated/airframe.h" +#include "subsystems/imu.h" + + +#define NPS_BODY_TO_IMU_PHI IMU_BODY_TO_IMU_PHI +#define NPS_BODY_TO_IMU_THETA IMU_BODY_TO_IMU_THETA +#define NPS_BODY_TO_IMU_PSI IMU_BODY_TO_IMU_PSI + +/* + * Accelerometer + */ +/* ADXL345 configured to +-16g with 13bit resolution */ +#define NPS_ACCEL_MIN -4095 +#define NPS_ACCEL_MAX 4095 +/* ms-2 */ +/* aka 2^10/ACCEL_X_SENS */ +#define NPS_ACCEL_SENSITIVITY_XX ACCEL_BFP_OF_REAL(1./IMU_ACCEL_X_SENS) +#define NPS_ACCEL_SENSITIVITY_YY ACCEL_BFP_OF_REAL(1./IMU_ACCEL_Y_SENS) +#define NPS_ACCEL_SENSITIVITY_ZZ ACCEL_BFP_OF_REAL(1./IMU_ACCEL_Z_SENS) + +#define NPS_ACCEL_NEUTRAL_X IMU_ACCEL_X_NEUTRAL +#define NPS_ACCEL_NEUTRAL_Y IMU_ACCEL_Y_NEUTRAL +#define NPS_ACCEL_NEUTRAL_Z IMU_ACCEL_Z_NEUTRAL +/* m2s-4 */ +#define NPS_ACCEL_NOISE_STD_DEV_X 5.e-2 +#define NPS_ACCEL_NOISE_STD_DEV_Y 5.e-2 +#define NPS_ACCEL_NOISE_STD_DEV_Z 5.e-2 +/* ms-2 */ +#define NPS_ACCEL_BIAS_X 0 +#define NPS_ACCEL_BIAS_Y 0 +#define NPS_ACCEL_BIAS_Z 0 +/* s */ +#define NPS_ACCEL_DT (1./512.) + + + +/* + * Gyrometer + */ +/* IMU-3000 has 16 bit resolution */ +#define NPS_GYRO_MIN -32767 +#define NPS_GYRO_MAX 32767 + +/* 2^12/GYRO_X_SENS */ +#define NPS_GYRO_SENSITIVITY_PP RATE_BFP_OF_REAL(1./IMU_GYRO_P_SENS) +#define NPS_GYRO_SENSITIVITY_QQ RATE_BFP_OF_REAL(1./IMU_GYRO_Q_SENS) +#define NPS_GYRO_SENSITIVITY_RR RATE_BFP_OF_REAL(1./IMU_GYRO_R_SENS) + +#define NPS_GYRO_NEUTRAL_P IMU_GYRO_P_NEUTRAL +#define NPS_GYRO_NEUTRAL_Q IMU_GYRO_Q_NEUTRAL +#define NPS_GYRO_NEUTRAL_R IMU_GYRO_R_NEUTRAL + +#define NPS_GYRO_NOISE_STD_DEV_P RadOfDeg(0.) +#define NPS_GYRO_NOISE_STD_DEV_Q RadOfDeg(0.) +#define NPS_GYRO_NOISE_STD_DEV_R RadOfDeg(0.) + +#define NPS_GYRO_BIAS_INITIAL_P RadOfDeg( 0.0) +#define NPS_GYRO_BIAS_INITIAL_Q RadOfDeg( 0.0) +#define NPS_GYRO_BIAS_INITIAL_R RadOfDeg( 0.0) + +#define NPS_GYRO_BIAS_RANDOM_WALK_STD_DEV_P RadOfDeg(0.5) +#define NPS_GYRO_BIAS_RANDOM_WALK_STD_DEV_Q RadOfDeg(0.5) +#define NPS_GYRO_BIAS_RANDOM_WALK_STD_DEV_R RadOfDeg(0.5) +/* s */ +#define NPS_GYRO_DT (1./512.) + + + +/* + * Magnetometer + */ + /* HMC5843 has 12 bit resolution */ +#define NPS_MAG_MIN -2047 +#define NPS_MAG_MAX 2047 + +#define NPS_MAG_IMU_TO_SENSOR_PHI 0. +#define NPS_MAG_IMU_TO_SENSOR_THETA 0. +#define NPS_MAG_IMU_TO_SENSOR_PSI 0. + +#define NPS_MAG_SENSITIVITY_XX MAG_BFP_OF_REAL(1./IMU_MAG_X_SENS) +#define NPS_MAG_SENSITIVITY_YY MAG_BFP_OF_REAL(1./IMU_MAG_Y_SENS) +#define NPS_MAG_SENSITIVITY_ZZ MAG_BFP_OF_REAL(1./IMU_MAG_Z_SENS) + +#define NPS_MAG_NEUTRAL_X IMU_MAG_X_NEUTRAL +#define NPS_MAG_NEUTRAL_Y IMU_MAG_Y_NEUTRAL +#define NPS_MAG_NEUTRAL_Z IMU_MAG_Z_NEUTRAL + +#define NPS_MAG_NOISE_STD_DEV_X 2e-3 +#define NPS_MAG_NOISE_STD_DEV_Y 2e-3 +#define NPS_MAG_NOISE_STD_DEV_Z 2e-3 + +#define NPS_MAG_DT (1./100.) + + +/* + * Range meter + */ +#define BSM_RANGEMETER_RESOLUTION (1024) +#define BSM_RANGEMETER_SENSITIVITY (1024. / 12.) +#define BSM_RANGEMETER_MAX_RANGE (6. * BSM_RANGEMETER_SENSITIVITY) +#define BSM_RANGEMETER_DT (1./20.) + + +/* + * Barometer + */ +/* m */ +/* aka 2^8/INS_BARO_SENS */ +#define NPS_BARO_QNH 900. +#define NPS_BARO_SENSITIVITY 17.066667 +#define NPS_BARO_DT (1./100.) +#define NPS_BARO_NOISE_STD_DEV 5.e-2 + +/* + * GPS + */ + +#ifndef GPS_PERFECT +#define GPS_PERFECT 1 +#endif + +#if GPS_PERFECT + +#define NPS_GPS_SPEED_NOISE_STD_DEV 0. +#define NPS_GPS_SPEED_LATENCY 0. +#define NPS_GPS_POS_NOISE_STD_DEV 0.001 +#define NPS_GPS_POS_BIAS_INITIAL_X 0. +#define NPS_GPS_POS_BIAS_INITIAL_Y 0. +#define NPS_GPS_POS_BIAS_INITIAL_Z 0. +#define NPS_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_X 0. +#define NPS_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Y 0. +#define NPS_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Z 0. +#define NPS_GPS_POS_LATENCY 0. + +#else + +#define NPS_GPS_SPEED_NOISE_STD_DEV 0.5 +#define NPS_GPS_SPEED_LATENCY 0.2 +#define NPS_GPS_POS_NOISE_STD_DEV 2 +#define NPS_GPS_POS_BIAS_INITIAL_X 0e-1 +#define NPS_GPS_POS_BIAS_INITIAL_Y -0e-1 +#define NPS_GPS_POS_BIAS_INITIAL_Z -0e-1 +#define NPS_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_X 1e-3 +#define NPS_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Y 1e-3 +#define NPS_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Z 1e-3 +#define NPS_GPS_POS_LATENCY 0.2 + +#endif /* GPS_PERFECT */ + +#define NPS_GPS_DT (1./4.) + +#endif /* NPS_SENSORS_PARAMS_H */ diff --git a/sw/airborne/subsystems/imu/imu_nps.c b/sw/airborne/subsystems/imu/imu_nps.c new file mode 100644 index 0000000000..1e3aeaaf78 --- /dev/null +++ b/sw/airborne/subsystems/imu/imu_nps.c @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2012 Felix Ruess