Merge pull request #205 from flixr/nps_sim

target 'nps' for the nps simulator
This commit is contained in:
Gautier Hattenberger
2012-06-05 04:31:24 -07:00
56 changed files with 581 additions and 631 deletions
+1 -1
View File
@@ -17,7 +17,7 @@
<define name="USE_GPS_ACC4R"/>
<define name="ACTUATORS_START_DELAY" value="3"/>
</target>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
</target>
+1 -1
View File
@@ -22,7 +22,7 @@
<define name="USE_GPS_ACC4R"/>
<define name="ACTUATORS_START_DELAY" value="3"/>
</target>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
<!--define name="NPS_NO_SUPERVISION"/-->
</target>
+1 -1
View File
@@ -17,7 +17,7 @@
<define name="FAILSAFE_GROUND_DETECT"/>
<define name="USE_GPS_ACC4R"/>
</target>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
</target>
+1 -1
View File
@@ -196,7 +196,7 @@
<firmware name="rotorcraft">
<target name="ap" board="booz_1.0"/>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
</target>
<subsystem name="radio_control" type="ppm"/>
+1 -1
View File
@@ -220,7 +220,7 @@
<subsystem name="radio_control" type="spektrum"/>
<subsystem name="actuators" type="asctec"/>
</target>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
<subsystem name="radio_control" type="ppm"/>
<subsystem name="actuators" type="mkk"/>
@@ -14,18 +14,17 @@
<subsystem name="radio_control" type="spektrum"/>
<define name="RADIO_MODE" value="RADIO_AUX1"/>
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
<define name ="RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value = "UART5"/>
<define name ="OVERRIDE_UART5_IRQ_HANDLER"/>
<subsystem name="actuators" type="mkk"/>
<subsystem name="telemetry" type="transparent"/>
<define name="RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value="UART5"/>
<define name="OVERRIDE_UART5_IRQ_HANDLER"/>
</target>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
<subsystem name="radio_control" type="ppm"/>
<subsystem name="actuators" type="mkk"/>
</target>
<subsystem name="telemetry" type="transparent"/>
<subsystem name="actuators" type="mkk"/>
<subsystem name="imu" type="aspirin_v1.5"/>
<subsystem name="gps" type="ublox">
<configure name="GPS_BAUD" value="B57600"/>
@@ -84,13 +83,11 @@
<axis name="THRUST" failsafe_value="0"/>
</commands>
<!-- for the sim -->
<section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
<define name="NB" value="4"/>
<define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }"/>
</section>
<section name="SUPERVISION" prefix="SUPERVISION_">
<define name="MIN_MOTOR" value="2"/>
<define name="MAX_MOTOR" value="210"/>
@@ -268,7 +265,7 @@
<section name="SIMULATOR" prefix="NPS_">
<define name="ACTUATOR_NAMES" value="{&quot;front_motor&quot;, &quot;back_motor&quot;, &quot;right_motor&quot;, &quot;left_motor&quot;}"/>
<define name="INITIAL_CONDITITONS" value="&quot;reset00&quot;"/>
<define name="SENSORS_PARAMS" value="&quot;nps_sensors_params_booz2_a1.h&quot;"/>
<define name="SENSORS_PARAMS" value="&quot;nps_sensors_params_default.h&quot;"/>
</section>
</airframe>
@@ -8,23 +8,6 @@
GPS connected to UART1 (Since this is inside in a metal box it won't ever get a solution)
-->
<airframe name="TestConfig">
<!--
<firmware name="rotorcraft">
<target name="sim" board="pc"/>
<target name="ap" board="lisa_l_1.1"/>
<subsystem name="radio_control" type="ppm"/>
<subsystem name="telemetry" type="xbee_api">
<configure name="MODEM_BAUD" value="B38400"/>
</subsystem>
<subsystem name="control"/>
<subsystem name="gps" type="ublox"/>
<subsystem name="imu" type="b2_v1.2"/>
<subsystem name="stabilization" type="euler"/>
<subsystem name="ahrs" type="int_cmpl_quat"/>
<subsystem name="navigation"/>
</firmware>
-->
<firmware name="rotorcraft">
<target name="ap" board="lisa_l_1.1">
@@ -32,18 +15,17 @@
<subsystem name="radio_control" type="spektrum"/>
<define name="RADIO_MODE" value="RADIO_AUX1"/>
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
<define name ="RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value = "UART5"/>
<define name ="OVERRIDE_UART5_IRQ_HANDLER"/>
<subsystem name="actuators" type="mkk"/>
<subsystem name="telemetry" type="transparent"/>
<define name="RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value="UART5"/>
<define name="OVERRIDE_UART5_IRQ_HANDLER"/>
</target>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
<subsystem name="radio_control" type="ppm"/>
<subsystem name="actuators" type="mkk"/>
</target>
<subsystem name="actuators" type="mkk"/>
<subsystem name="telemetry" type="transparent"/>
<subsystem name="imu" type="b2_v1.2"/>
<subsystem name="gps" type="ublox">
<configure name="GPS_BAUD" value="B57600"/>
+1 -1
View File
@@ -9,7 +9,7 @@
<define name="USE_INS_NAV_INIT"/>
</target>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
</target>
+3 -4
View File
@@ -183,18 +183,17 @@
<target name="ap" board="lisa_l_1.1">
<!-- <define name="ACTUATORS_START_DELAY" value="1"/> -->
<subsystem name="radio_control" type="spektrum"/>
<subsystem name="actuators" type="asctec_v2"/>
<subsystem name="telemetry" type="transparent"/>
<define name="RADIO_MODE" value="RADIO_AUX2"/>
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
<define name="RADIO_CONTROL_SPEKTRUM_SIGNS" value="\{1,1,-1,1,-1,-1,-1,1,1,1,1,1\}"/>
</target>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
<subsystem name="radio_control" type="ppm"/>
<subsystem name="actuators" type="mkk"/>
</target>
<subsystem name="telemetry" type="transparent"/>
<subsystem name="actuators" type="asctec_v2"/>
<subsystem name="imu" type="b2_v1.1"/>
<subsystem name="gps" type="ublox"/>
<subsystem name="stabilization" type="euler"/>
+1 -1
View File
@@ -191,7 +191,7 @@
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
<define name="RADIO_CONTROL_SPEKTRUM_SIGNS" value="\{1,1,-1,1,-1,-1,-1,1,1,1,1,1\}"/>
</target>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
<subsystem name="radio_control" type="ppm"/>
<subsystem name="actuators" type="mkk"/>
+4 -11
View File
@@ -39,13 +39,6 @@
</command_laws>
<!-- for the sim -->
<section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
<define name="NB" value="4"/>
<define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }"/>
</section>
<section name="SUPERVISION" prefix="SUPERVISION_">
<define name="STOP_MOTOR" value="1000"/>
<define name="MIN_MOTOR" value="1100"/>
@@ -187,19 +180,19 @@
<target name="ap" board="lisa_m_2.0">
<!-- <define name="BOOZ_START_DELAY" value="1"/> -->
<subsystem name="radio_control" type="spektrum"/>
<subsystem name="actuators" type="pwm_supervision"/>
<subsystem name="telemetry" type="transparent"/>
<define name="SERVO_HZ" value="400"/>
<define name="RADIO_MODE" value="RADIO_AUX2"/>
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
<!--define name="RADIO_CONTROL_SPEKTRUM_SIGNS" value="\{1,1,-1,1,-1,-1,-1,1,1,1,1,1\}"/-->
</target>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
<subsystem name="radio_control" type="ppm"/>
<subsystem name="actuators" type="mkk"/>
</target>
<subsystem name="actuators" type="pwm_supervision">
<define name="SERVO_HZ" value="400"/>
</subsystem>
<subsystem name="imu" type="aspirin_v2.1"/>
<subsystem name="gps" type="ublox"/>
<subsystem name="stabilization" type="int_quat"/>
+6 -12
View File
@@ -30,13 +30,6 @@
</command_laws>
<!-- for the sim -->
<section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
<define name="NB" value="4"/>
<define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }"/>
</section>
<section name="SUPERVISION" prefix="SUPERVISION_">
<define name="STOP_MOTOR" value="1000"/>
<define name="MIN_MOTOR" value="1200"/>
@@ -206,19 +199,20 @@
<target name="ap" board="lisa_m_1.0">
<!-- <define name="ACTUATORS_START_DELAY" value="1"/> -->
<subsystem name="radio_control" type="spektrum"/>
<subsystem name="actuators" type="pwm_supervision"/>
<subsystem name="telemetry" type="transparent"/>
<define name="SERVO_HZ" value="400"/>
<define name="RADIO_MODE" value="RADIO_AUX2"/>
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
<define name="RADIO_CONTROL_SPEKTRUM_SIGNS" value="\{1,1,-1,1,-1,-1,-1,1,1,1,1,1\}"/>
</target>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
<subsystem name="radio_control" type="ppm"/>
<subsystem name="actuators" type="mkk"/>
</target>
<subsystem name="actuators" type="pwm_supervision">
<define name="SERVO_HZ" value="400"/>
</subsystem>
<subsystem name="telemetry" type="transparent"/>
<subsystem name="imu" type="aspirin_v1.0"/>
<subsystem name="gps" type="ublox"/>
<subsystem name="stabilization" type="euler"/>
+1 -1
View File
@@ -192,7 +192,7 @@
<define name = "RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value = "UART5"/>
<define name = "OVERRIDE_UART5_IRQ_HANDLER"/>
</target>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
<subsystem name="radio_control" type="ppm"/>
<subsystem name="actuators" type="mkk"/>
+1 -3
View File
@@ -14,12 +14,10 @@
<axis name="THRUST" failsafe_value="0"/>
</commands>
<!-- not needed anymore - in subsystem -->
<section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
<define name="NB" value="4"/>
<define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }"/>
</section>
<!-- -->
<section name="SUPERVISION" prefix="SUPERVISION_">
<define name="MIN_MOTOR" value="2"/>
@@ -196,7 +194,7 @@
<firmware name="rotorcraft">
<target name="ap" board="booz_1.0"/>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
</target>
<subsystem name="radio_control" type="ppm"/>
@@ -7,6 +7,10 @@
<firmware name="rotorcraft">
<target name="ap" board="lisa_m_2.0"/>
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
</target>
<subsystem name="actuators" type="pwm_supervision">
<define name="SERVO_HZ" value="400"/>
</subsystem>
@@ -174,6 +178,12 @@
<define name="IGAIN" value="0"/>
</section>
<section name="SIMULATOR" prefix="NPS_">
<define name="ACTUATOR_NAMES" value="{&quot;front_motor&quot;, &quot;back_motor&quot;, &quot;right_motor&quot;, &quot;left_motor&quot;}"/>
<define name="INITIAL_CONDITITONS" value="&quot;reset00&quot;"/>
<define name="SENSORS_PARAMS" value="&quot;nps_sensors_params_default.h&quot;"/>
</section>
<section name="AUTOPILOT">
<define name="MODE_MANUAL" value="AP_MODE_ATTITUDE_DIRECT"/>
<define name="MODE_AUTO1" value="AP_MODE_ATTITUDE_Z_HOLD"/>
@@ -8,7 +8,7 @@
<target name="ap" board="lisa_m_1.0">
<define name="ACTUATORS_START_DELAY" value="3"/>
</target>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
</target>
@@ -171,7 +171,7 @@
<section name="SIMULATOR" prefix="NPS_">
<define name="ACTUATOR_NAMES" value="{&quot;front_motor&quot;, &quot;back_motor&quot;, &quot;right_motor&quot;, &quot;left_motor&quot;}"/>
<define name="INITIAL_CONDITITONS" value="&quot;reset00&quot;"/>
<define name="SENSORS_PARAMS" value="&quot;nps_sensors_params_aspirin_1.5.h&quot;"/>
<define name="SENSORS_PARAMS" value="&quot;nps_sensors_params_default.h&quot;"/>
</section>
<section name="AUTOPILOT">
+2 -2
View File
@@ -11,7 +11,7 @@
<!--configure name="USE_NEW_I2C_DRIVER" value="1"/-->
</target>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
</target>
@@ -207,7 +207,7 @@
<section name="SIMULATOR" prefix="NPS_">
<define name="ACTUATOR_NAMES" value="{&quot;front_motor&quot;, &quot;back_motor&quot;, &quot;right_motor&quot;, &quot;left_motor&quot;}"/>
<define name="INITIAL_CONDITITONS" value="&quot;reset00&quot;"/>
<define name="SENSORS_PARAMS" value="&quot;nps_sensors_params_aspirin_1.5.h&quot;"/>
<define name="SENSORS_PARAMS" value="&quot;nps_sensors_params_default.h&quot;"/>
</section>
<section name="AUTOPILOT">
+1 -2
View File
@@ -16,7 +16,6 @@
<axis name="THRUST" failsafe_value="0"/>
</commands>
<!-- for the sim -->
<section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
<define name="NB" value="4"/>
<define name="ADDR" value="{ 0x52, 0x54, 0x58, 0x56 }"/>
@@ -191,7 +190,7 @@
<subsystem name="radio_control" type="ppm"/>
<subsystem name="actuators" type="mkk"/>
</target>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
<subsystem name="radio_control" type="ppm"/>
<subsystem name="actuators" type="mkk"/>
@@ -8,7 +8,7 @@
<!--configure name="USE_NEW_I2C_DRIVER" value="1"/-->
</target>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
</target>
@@ -4,16 +4,14 @@
<firmware name="rotorcraft">
<target name="ap" board="lisa_m_1.0">
<subsystem name="actuators" type="pwm_supervision">
<define name="SERVO_HZ" value="400"/>
</subsystem>
</target>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
<subsystem name="actuators" type="mkk"/>
</target>
<subsystem name="actuators" type="pwm_supervision">
<define name="SERVO_HZ" value="400"/>
</subsystem>
<subsystem name="radio_control" type="ppm"/>
<subsystem name="telemetry" type="transparent"/>
<subsystem name="imu" type="aspirin_v1.5"/>
@@ -41,13 +39,6 @@
<!-- but can be empty if no additional servos are used -->
</command_laws>
<!-- only for the nps sim -->
<section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
<define name="NB" value="4"/>
<!-- FRONT, BACK, RIGHT, LEFT -->
<define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }"/>
</section>
<section name="SUPERVISION" prefix="SUPERVISION_">
<define name="STOP_MOTOR" value="1000"/>
<define name="MIN_MOTOR" value="1100"/>
@@ -4,15 +4,14 @@
<firmware name="rotorcraft">
<target name="ap" board="lisa_m_2.0">
<subsystem name="actuators" type="pwm_supervision">
<define name="SERVO_HZ" value="400"/>
</subsystem>
</target>
<target name="sim" board="pc">
<target name="nps" board="pc">
<subsystem name="fdm" type="nps"/>
<subsystem name="actuators" type="mkk"/>
</target>
<subsystem name="actuators" type="pwm_supervision">
<define name="SERVO_HZ" value="400"/>
</subsystem>
<subsystem name="radio_control" type="ppm"/>
<subsystem name="telemetry" type="transparent"/>
<subsystem name="imu" type="aspirin_v2.1"/>
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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:
# <section name="IMU" prefix="IMU_">
#
# <define name="GYRO_X_NEUTRAL" value="33924"/>
# <define name="GYRO_Y_NEUTRAL" value="33417"/>
# <define name="GYRO_Z_NEUTRAL" value="32809"/>
#
# <define name="GYRO_X_SENS" value="1.01" integer="16"/>
# <define name="GYRO_Y_SENS" value="1.01" integer="16"/>
# <define name="GYRO_Z_SENS" value="1.01" integer="16"/>
#
# <define name="ACCEL_X_NEUTRAL" value="32081"/>
# <define name="ACCEL_Y_NEUTRAL" value="33738"/>
# <define name="ACCEL_Z_NEUTRAL" value="32441"/>
#
# <define name="ACCEL_X_SENS" value="2.50411474" integer="16"/>
# <define name="ACCEL_Y_SENS" value="2.48126183" integer="16"/>
# <define name="ACCEL_Z_SENS" value="2.51396167" integer="16"/>
#
# <define name="MAG_X_NEUTRAL" value="2358"/>
# <define name="MAG_Y_NEUTRAL" value="2362"/>
# <define name="MAG_Z_NEUTRAL" value="2119"/>
@@ -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
@@ -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:
# <section name="IMU" prefix="IMU_">
#
# <define name="GYRO_X_NEUTRAL" value="33924"/>
# <define name="GYRO_Y_NEUTRAL" value="33417"/>
# <define name="GYRO_Z_NEUTRAL" value="32809"/>
#
# <define name="GYRO_X_SENS" value="1.01" integer="16"/>
# <define name="GYRO_Y_SENS" value="1.01" integer="16"/>
# <define name="GYRO_Z_SENS" value="1.01" integer="16"/>
#
# <define name="ACCEL_X_NEUTRAL" value="32081"/>
# <define name="ACCEL_Y_NEUTRAL" value="33738"/>
# <define name="ACCEL_Z_NEUTRAL" value="32441"/>
#
# <define name="ACCEL_X_SENS" value="2.50411474" integer="16"/>
# <define name="ACCEL_Y_SENS" value="2.48126183" integer="16"/>
# <define name="ACCEL_Z_SENS" value="2.51396167" integer="16"/>
#
# <define name="MAG_X_NEUTRAL" value="2358"/>
# <define name="MAG_Y_NEUTRAL" value="2362"/>
# <define name="MAG_Z_NEUTRAL" value="2119"/>
@@ -32,9 +19,6 @@
#
# </section>
#
#
# imu aspirin
include $(CFG_SHARED)/imu_aspirin_common.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:
# <section name="IMU" prefix="IMU_">
#
# <define name="GYRO_X_NEUTRAL" value="33924"/>
# <define name="GYRO_Y_NEUTRAL" value="33417"/>
# <define name="GYRO_Z_NEUTRAL" value="32809"/>
#
# <define name="GYRO_X_SENS" value="1.01" integer="16"/>
# <define name="GYRO_Y_SENS" value="1.01" integer="16"/>
# <define name="GYRO_Z_SENS" value="1.01" integer="16"/>
#
# <define name="ACCEL_X_NEUTRAL" value="32081"/>
# <define name="ACCEL_Y_NEUTRAL" value="33738"/>
# <define name="ACCEL_Z_NEUTRAL" value="32441"/>
#
# <define name="ACCEL_X_SENS" value="2.50411474" integer="16"/>
# <define name="ACCEL_Y_SENS" value="2.48126183" integer="16"/>
# <define name="ACCEL_Z_SENS" value="2.51396167" integer="16"/>
#
# <define name="MAG_X_NEUTRAL" value="2358"/>
# <define name="MAG_Y_NEUTRAL" value="2362"/>
# <define name="MAG_Z_NEUTRAL" value="2119"/>
@@ -32,9 +19,6 @@
#
# </section>
#
#
# imu aspirin
include $(CFG_SHARED)/imu_aspirin_common.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:
# <section name="IMU" prefix="IMU_">
#
# <define name="GYRO_X_NEUTRAL" value="33924"/>
# <define name="GYRO_Y_NEUTRAL" value="33417"/>
# <define name="GYRO_Z_NEUTRAL" value="32809"/>
#
# <define name="GYRO_X_SENS" value="1.01" integer="16"/>
# <define name="GYRO_Y_SENS" value="1.01" integer="16"/>
# <define name="GYRO_Z_SENS" value="1.01" integer="16"/>
#
# <define name="ACCEL_X_NEUTRAL" value="32081"/>
# <define name="ACCEL_Y_NEUTRAL" value="33738"/>
# <define name="ACCEL_Z_NEUTRAL" value="32441"/>
#
# <define name="ACCEL_X_SENS" value="2.50411474" integer="16"/>
# <define name="ACCEL_Y_SENS" value="2.48126183" integer="16"/>
# <define name="ACCEL_Z_SENS" value="2.51396167" integer="16"/>
#
# <define name="MAG_X_NEUTRAL" value="2358"/>
# <define name="MAG_Y_NEUTRAL" value="2362"/>
# <define name="MAG_Z_NEUTRAL" value="2119"/>
@@ -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
@@ -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
@@ -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:
# <section name="IMU" prefix="IMU_">
#
# <define name="MAG_X_NEUTRAL" value="2358"/>
# <define name="MAG_Y_NEUTRAL" value="2362"/>
# <define name="MAG_Z_NEUTRAL" value="2119"/>
#
# <define name="MAG_X_SENS" value="3.4936416" integer="16"/>
# <define name="MAG_Y_SENS" value="3.607713" integer="16"/>
# <define name="MAG_Z_SENS" value="4.90788848" integer="16"/>
#
# </section>
#
nps.CFLAGS += -DIMU_TYPE_H=\"imu/imu_nps.h\"
nps.srcs += $(SRC_SUBSYSTEMS)/imu.c $(SRC_SUBSYSTEMS)/imu/imu_nps.c
@@ -0,0 +1,176 @@
/*
* Copyright (C) 2012 Felix Ruess <felix.ruess@gmail.com>
*
* 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 */
@@ -1,78 +0,0 @@
/*
* $Id$
*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
*
* 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.
*/
#include "subsystems/imu.h"
#include "generated/airframe.h"
void imu_aspirin_arch_init(void) {
imu_aspirin.status = AspirinStatusIdle;
}
#if USE_NPS
#include "nps_sensors.h"
void imu_feed_gyro_accel(void) {
#if 0
// the high byte is in buf[0], low byte in buf[1], etc.
imu_aspirin.i2c_trans_gyro.buf[0] = ((int16_t)sensors.gyro.value.x) >> 8;
imu_aspirin.i2c_trans_gyro.buf[1] = ((int16_t)sensors.gyro.value.x) & 0xff;
imu_aspirin.i2c_trans_gyro.buf[2] = ((int16_t)sensors.gyro.value.y) >> 8;
imu_aspirin.i2c_trans_gyro.buf[3] = ((int16_t)sensors.gyro.value.y) & 0xff;
imu_aspirin.i2c_trans_gyro.buf[4] = ((int16_t)sensors.gyro.value.z) >> 8;
imu_aspirin.i2c_trans_gyro.buf[5] = ((int16_t)sensors.gyro.value.z) & 0xff;
// low byte in buf[1], high byte in buf[2], etc...
imu_aspirin.accel_rx_buf[1] = ((int16_t)sensors.accel.value.x) & 0xff;
imu_aspirin.accel_rx_buf[2] = ((int16_t)sensors.accel.value.x) >> 8;
imu_aspirin.accel_rx_buf[3] = ((int16_t)sensors.accel.value.y) & 0xff;
imu_aspirin.accel_rx_buf[4] = ((int16_t)sensors.accel.value.y) >> 8;
imu_aspirin.accel_rx_buf[5] = ((int16_t)sensors.accel.value.z) & 0xff;
imu_aspirin.accel_rx_buf[6] = ((int16_t)sensors.accel.value.z) >> 8;
// set availability flags...
imu_aspirin.accel_available = true;
#else
RATES_ASSIGN(imu.gyro_unscaled, sensors.gyro.value.x, sensors.gyro.value.y, sensors.gyro.value.z);
VECT3_ASSIGN(imu.accel_unscaled, sensors.accel.value.x, sensors.accel.value.y, sensors.accel.value.z);
// set availability flags...
imu_aspirin.accel_available = true;
imu_aspirin.gyro_available_blaaa = true;
#endif
}
void imu_feed_mag(void) {
hmc5843.data.value[IMU_MAG_X_CHAN] = sensors.mag.value.x;
hmc5843.data.value[IMU_MAG_Y_CHAN] = sensors.mag.value.y;
hmc5843.data.value[IMU_MAG_Z_CHAN] = sensors.mag.value.z;
hmc5843.data_available = TRUE;
}
#endif
@@ -1,48 +0,0 @@
/*
* $Id$
*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
*
* 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.
*/
/*
*
* simulator plug for the booz2 v1 imu arch dependant functions
*
*/
#ifndef IMU_ASPIRIN_ARCH_H
#define IMU_ASPIRIN_ARCH_H
extern void imu_feed_gyro_accel(void);
extern void imu_feed_mag(void);
#define imu_aspirin_arch_int_enable() {}
#define imu_aspirin_arch_int_disable() {}
#define adxl345_write_to_reg(foo, bar) {}
#define adxl345_clear_rx_buf() {}
#define adxl345_start_reading_data() {}
static inline int imu_aspirin_eoc(void)
{
return 1;
}
#endif /* IMU_ASPIRIN_ARCH_H */
@@ -1,65 +0,0 @@
/*
* $Id$
*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
*
* 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.
*/
#include "subsystems/imu.h"
#include "generated/airframe.h"
int imu_overrun = 0;
void imu_b2_arch_init(void) {
}
void imu_periodic(void) {
}
#if USE_NPS
#include "nps_sensors.h"
void imu_feed_gyro_accel(void) {
max1168_values[IMU_GYRO_P_CHAN] = sensors.gyro.value.x;
max1168_values[IMU_GYRO_Q_CHAN] = sensors.gyro.value.y;
max1168_values[IMU_GYRO_R_CHAN] = sensors.gyro.value.z;
max1168_values[IMU_ACCEL_X_CHAN] = sensors.accel.value.x;
max1168_values[IMU_ACCEL_Y_CHAN] = sensors.accel.value.y;
max1168_values[IMU_ACCEL_Z_CHAN] = sensors.accel.value.z;
max1168_status = STA_MAX1168_DATA_AVAILABLE;
}
void imu_feed_mag(void) {
#if defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_MS2100
ms2100_values[IMU_MAG_X_CHAN] = sensors.mag.value.x;
ms2100_values[IMU_MAG_Y_CHAN] = sensors.mag.value.y;
ms2100_values[IMU_MAG_Z_CHAN] = sensors.mag.value.z;
ms2100_status = MS2100_DATA_AVAILABLE;
#elif defined IMU_B2_MAG_TYPE && IMU_B2_MAG_TYPE == IMU_B2_MAG_AMI601
ami601_values[IMU_MAG_X_CHAN] = sensors.mag.value.x;
ami601_values[IMU_MAG_Y_CHAN] = sensors.mag.value.y;
ami601_values[IMU_MAG_Z_CHAN] = sensors.mag.value.z;
ami601_status = AMI601_DATA_AVAILABLE;
#endif
}
#endif //USE_NPS
@@ -1,39 +0,0 @@
/*
* $Id$
*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
*
* 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.
*/
/*
*
* simulator plug for the booz2 v1 imu arch dependant functions
*
*/
#ifndef IMU_B2_ARCH_H
#define IMU_B2_ARCH_H
extern int imu_overrun;
#if USE_NPS
extern void imu_feed_gyro_accel(void);
extern void imu_feed_mag(void);
#endif
#endif /* IMU_B2_HW_H */
@@ -1,32 +0,0 @@
/*
* simulator ARCH for rotorcraft imu crista
*/
#include "subsystems/imu.h"
#include "generated/airframe.h"
void imu_crista_arch_init(void) {
}
#if USE_NPS
#include "nps_sensors.h"
void imu_feed_gyro_accel(void) {
ADS8344_values[IMU_GYRO_P_CHAN] = sensors.gyro.value.x;
ADS8344_values[IMU_GYRO_Q_CHAN] = sensors.gyro.value.y;
ADS8344_values[IMU_GYRO_R_CHAN] = sensors.gyro.value.z;
ADS8344_values[IMU_ACCEL_X_CHAN] = sensors.accel.value.x;
ADS8344_values[IMU_ACCEL_Y_CHAN] = sensors.accel.value.y;
ADS8344_values[IMU_ACCEL_Z_CHAN] = sensors.accel.value.z;
ADS8344_available = TRUE;
}
void imu_feed_mag(void) {
ami601_values[IMU_MAG_X_CHAN] = sensors.mag.value.x;
ami601_values[IMU_MAG_Y_CHAN] = sensors.mag.value.y;
ami601_values[IMU_MAG_Z_CHAN] = sensors.mag.value.z;
ami601_status = AMI601_DATA_AVAILABLE;
}
#endif

Some files were not shown because too many files have changed in this diff Show More