mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-22 20:36:06 +08:00
[nps] renamed fdm type from nps to jsbsim
This commit is contained in:
@@ -220,7 +220,7 @@
|
||||
<subsystem name="actuators" type="asctec"/>
|
||||
</target>
|
||||
<target name="sim" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
<subsystem name="actuators" type="mkk"/>
|
||||
</target>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<define name="ACTUATORS_START_DELAY" value="3"/>
|
||||
</target>
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
</target>
|
||||
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<define name="ACTUATORS_START_DELAY" value="3"/>
|
||||
</target>
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<!--define name="NPS_NO_SUPERVISION"/-->
|
||||
</target>
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<define name="USE_GPS_ACC4R"/>
|
||||
</target>
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
</target>
|
||||
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
|
||||
@@ -252,7 +252,7 @@
|
||||
<subsystem name="actuators" type="mkk"/>
|
||||
</target>
|
||||
<target name="sim" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
<subsystem name="actuators" type="mkk"/>
|
||||
</target>
|
||||
|
||||
@@ -197,7 +197,7 @@
|
||||
<firmware name="rotorcraft">
|
||||
<target name="ap" board="booz_1.0"/>
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
</target>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
<subsystem name="telemetry" type="transparent"/>
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
<subsystem name="actuators" type="asctec"/>
|
||||
</target>
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
<subsystem name="actuators" type="mkk"/>
|
||||
</target>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</target>
|
||||
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
</target>
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</target>
|
||||
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
</target>
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</target>
|
||||
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
</target>
|
||||
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@
|
||||
<firmware name="rotorcraft">
|
||||
<target name="ap" board="booz_1.0"/>
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
</target>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
<subsystem name="telemetry" type="transparent"/>
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
<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">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
<subsystem name="actuators" type="mkk"/>
|
||||
</target>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</target>
|
||||
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
</target>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<define name="ACTUATORS_START_DELAY" value="3"/>
|
||||
</target>
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
</target>
|
||||
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</target>
|
||||
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
</target>
|
||||
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
|
||||
@@ -191,7 +191,7 @@
|
||||
<subsystem name="actuators" type="mkk"/>
|
||||
</target>
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
<subsystem name="actuators" type="mkk"/>
|
||||
</target>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</target>
|
||||
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
</target>
|
||||
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<target name="ap" board="lisa_m_1.0">
|
||||
</target>
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
</target>
|
||||
|
||||
<subsystem name="actuators" type="pwm_supervision">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<target name="ap" board="lisa_m_2.0">
|
||||
</target>
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
</target>
|
||||
|
||||
<subsystem name="actuators" type="pwm_supervision">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<define name="USE_GPS_ACC4R"/>
|
||||
</target>
|
||||
<target name="sim" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
</target>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
<subsystem name="telemetry" type="transparent"/>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<define name="USE_GPS_ACC4R"/>
|
||||
</target>
|
||||
<target name="sim" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
</target>
|
||||
<subsystem name="radio_control" type="spektrum"/>
|
||||
<subsystem name="telemetry" type="transparent"/>
|
||||
|
||||
@@ -285,7 +285,7 @@ second attempt
|
||||
|
||||
|
||||
<target name="sim" board="pc"/>
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
<subsystem name="telemetry" type="transparent"/>
|
||||
<subsystem name="actuators" type="mkk"/>
|
||||
|
||||
@@ -243,7 +243,7 @@
|
||||
</target>
|
||||
|
||||
<target name="sim" board="pc"/>
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
<subsystem name="telemetry" type="transparent"/>
|
||||
<subsystem name="actuators" type="mkk"/>
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
<configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" value="1"/>
|
||||
</target>
|
||||
<target name="sim" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
<subsystem name="actuators" type="mkk"/>
|
||||
</target>
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
<define name="RADIO_CONTROL_SPEKTRUM_SIGNS" value="\{1,1,-1,1,-1,-1,-1,1,1,1,1,1\}"/>
|
||||
</target>
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
</target>
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
<define name="RADIO_CONTROL_SPEKTRUM_SIGNS" value="\{1,1,-1,1,-1,-1,-1,1,1,1,1,1\}"/>
|
||||
</target>
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
<subsystem name="actuators" type="mkk"/>
|
||||
</target>
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
<!--define name="RADIO_CONTROL_SPEKTRUM_SIGNS" value="\{1,1,-1,1,-1,-1,-1,1,1,1,1,1\}"/-->
|
||||
</target>
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
</target>
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@
|
||||
<define name="RADIO_CONTROL_SPEKTRUM_SIGNS" value="\{1,1,-1,1,-1,-1,-1,1,1,1,1,1\}"/>
|
||||
</target>
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
</target>
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
<configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" value="1"/>
|
||||
</target>
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
<subsystem name="actuators" type="mkk"/>
|
||||
</target>
|
||||
|
||||
@@ -195,7 +195,7 @@
|
||||
<configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" value="1"/>
|
||||
</target>
|
||||
<target name="sim" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
<subsystem name="actuators" type="mkk"/>
|
||||
</target>
|
||||
|
||||
@@ -244,7 +244,7 @@ AP_MODE_NAV
|
||||
</target>
|
||||
<!--
|
||||
<target name="sim" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="jsbsim"/>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
<subsystem name="actuators" type="mkk"/>
|
||||
</target>
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
|
||||
#
|
||||
# SITL Simulator
|
||||
#
|
||||
|
||||
SIM_TYPE = JSBSIM
|
||||
|
||||
JSBSIM_ROOT = /opt/jsbsim
|
||||
JSBSIM_INC = $(JSBSIM_ROOT)/include/JSBSim
|
||||
JSBSIM_LIB = $(JSBSIM_ROOT)/lib
|
||||
|
||||
SRC_FIRMWARE=firmwares/rotorcraft
|
||||
|
||||
SRC_BOARD=boards/$(BOARD)
|
||||
|
||||
NPSDIR = $(SIMDIR)/nps
|
||||
|
||||
|
||||
nps.ARCHDIR = sim
|
||||
|
||||
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)
|
||||
nps.CFLAGS += `pkg-config JSBSim --cflags`
|
||||
nps.LDFLAGS += `pkg-config JSBSim --libs`
|
||||
else
|
||||
JSBSIM_PKG = no
|
||||
nps.CFLAGS += -I$(JSBSIM_INC)
|
||||
nps.LDFLAGS += -L$(JSBSIM_LIB) -lJSBSim
|
||||
endif
|
||||
|
||||
|
||||
nps.srcs += $(NPSDIR)/nps_main.c \
|
||||
$(NPSDIR)/nps_fdm_jsbsim.c \
|
||||
$(NPSDIR)/nps_random.c \
|
||||
$(NPSDIR)/nps_sensors.c \
|
||||
$(NPSDIR)/nps_sensors_utils.c \
|
||||
$(NPSDIR)/nps_sensor_gyro.c \
|
||||
$(NPSDIR)/nps_sensor_accel.c \
|
||||
$(NPSDIR)/nps_sensor_mag.c \
|
||||
$(NPSDIR)/nps_sensor_baro.c \
|
||||
$(NPSDIR)/nps_sensor_gps.c \
|
||||
$(NPSDIR)/nps_radio_control.c \
|
||||
$(NPSDIR)/nps_radio_control_joystick.c \
|
||||
$(NPSDIR)/nps_radio_control_spektrum.c \
|
||||
$(NPSDIR)/nps_autopilot_rotorcraft.c \
|
||||
$(NPSDIR)/nps_ivy.c \
|
||||
$(NPSDIR)/nps_flightgear.c \
|
||||
|
||||
|
||||
|
||||
nps.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG)
|
||||
|
||||
nps.srcs += firmwares/rotorcraft/main.c
|
||||
nps.srcs += mcu.c
|
||||
nps.srcs += $(SRC_ARCH)/mcu_arch.c
|
||||
|
||||
ifeq ($(TARGET), nps)
|
||||
include $(CFG_SHARED)/i2c_select.makefile
|
||||
endif
|
||||
|
||||
|
||||
nps.CFLAGS += -DPERIODIC_FREQUENCY=512
|
||||
#nps.CFLAGS += -DUSE_LED
|
||||
nps.srcs += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c
|
||||
|
||||
nps.srcs += subsystems/settings.c
|
||||
nps.srcs += $(SRC_ARCH)/subsystems/settings_arch.c
|
||||
|
||||
nps.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport
|
||||
nps.srcs += $(SRC_FIRMWARE)/telemetry.c \
|
||||
subsystems/datalink/downlink.c \
|
||||
$(SRC_ARCH)/ivy_transport.c
|
||||
|
||||
nps.srcs += $(SRC_FIRMWARE)/commands.c
|
||||
|
||||
nps.srcs += $(SRC_FIRMWARE)/datalink.c
|
||||
|
||||
#
|
||||
# Math functions
|
||||
#
|
||||
nps.srcs += math/pprz_geodetic_int.c math/pprz_geodetic_float.c math/pprz_geodetic_double.c math/pprz_trig_int.c
|
||||
|
||||
nps.CFLAGS += -DROTORCRAFT_BARO_LED=2
|
||||
nps.srcs += $(SRC_BOARD)/baro_board.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
|
||||
#nps.CFLAGS += -DUSE_DAC
|
||||
#nps.srcs += $(SRC_ARCH)/mcu_periph/dac_arch.c
|
||||
|
||||
|
||||
#nps.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\"
|
||||
#nps.CFLAGS += -DIMU_B2_VERSION_1_1
|
||||
|
||||
nps.srcs += $(SRC_FIRMWARE)/autopilot.c
|
||||
|
||||
#
|
||||
# in makefile section of airframe xml
|
||||
# include $(CFG_BOOZ)/subsystems/booz2_ahrs_lkf.makefile
|
||||
# or
|
||||
# include $(CFG_BOOZ)/subsystems/booz2_ahrs_cmpl.makefile
|
||||
#
|
||||
|
||||
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
|
||||
#NUM_TYPE=float
|
||||
|
||||
STAB_TYPE=euler
|
||||
#STAB_TYPE=quaternion
|
||||
|
||||
ifeq ($(NUM_TYPE), integer)
|
||||
nps.CFLAGS += -DSTABILISATION_ATTITUDE_TYPE_INT
|
||||
nps.CFLAGS += -DSTABILISATION_ATTITUDE_H=\"stabilization/stabilization_attitude_int.h\"
|
||||
ifeq ($(STAB_TYPE), euler)
|
||||
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)
|
||||
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)
|
||||
nps.CFLAGS += -DSTABILISATION_ATTITUDE_TYPE_FLOAT
|
||||
nps.CFLAGS += -DSTABILISATION_ATTITUDE_H=\"stabilization/stabilization_attitude_float.h\"
|
||||
ifeq ($(STAB_TYPE), euler)
|
||||
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)
|
||||
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
|
||||
|
||||
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
|
||||
nps.srcs += $(SRC_SUBSYSTEMS)/ins/vf_float.c
|
||||
nps.CFLAGS += -DUSE_VFF -DDT_VFILTER='(1./512.)'
|
||||
|
||||
#
|
||||
# INS choice
|
||||
#
|
||||
# include ins_hff.makefile
|
||||
# or
|
||||
# nothing
|
||||
#
|
||||
|
||||
|
||||
nps.srcs += $(SRC_FIRMWARE)/navigation.c
|
||||
nps.srcs += $(SRC_SUBSYSTEMS)/navigation/common_flight_plan.c
|
||||
@@ -1,171 +1,5 @@
|
||||
# Hey Emacs, this is a -*- makefile -*-
|
||||
|
||||
#
|
||||
# SITL Simulator
|
||||
#
|
||||
include $(CFG_ROTORCRAFT)/fdm_jsbsim.makefile
|
||||
|
||||
SIM_TYPE = JSBSIM
|
||||
|
||||
JSBSIM_ROOT = /opt/jsbsim
|
||||
JSBSIM_INC = $(JSBSIM_ROOT)/include/JSBSim
|
||||
JSBSIM_LIB = $(JSBSIM_ROOT)/lib
|
||||
|
||||
SRC_FIRMWARE=firmwares/rotorcraft
|
||||
|
||||
SRC_BOARD=boards/$(BOARD)
|
||||
|
||||
NPSDIR = $(SIMDIR)/nps
|
||||
|
||||
|
||||
nps.ARCHDIR = sim
|
||||
|
||||
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)
|
||||
nps.CFLAGS += `pkg-config JSBSim --cflags`
|
||||
nps.LDFLAGS += `pkg-config JSBSim --libs`
|
||||
else
|
||||
JSBSIM_PKG = no
|
||||
nps.CFLAGS += -I$(JSBSIM_INC)
|
||||
nps.LDFLAGS += -L$(JSBSIM_LIB) -lJSBSim
|
||||
endif
|
||||
|
||||
|
||||
nps.srcs += $(NPSDIR)/nps_main.c \
|
||||
$(NPSDIR)/nps_fdm_jsbsim.c \
|
||||
$(NPSDIR)/nps_random.c \
|
||||
$(NPSDIR)/nps_sensors.c \
|
||||
$(NPSDIR)/nps_sensors_utils.c \
|
||||
$(NPSDIR)/nps_sensor_gyro.c \
|
||||
$(NPSDIR)/nps_sensor_accel.c \
|
||||
$(NPSDIR)/nps_sensor_mag.c \
|
||||
$(NPSDIR)/nps_sensor_baro.c \
|
||||
$(NPSDIR)/nps_sensor_gps.c \
|
||||
$(NPSDIR)/nps_radio_control.c \
|
||||
$(NPSDIR)/nps_radio_control_joystick.c \
|
||||
$(NPSDIR)/nps_radio_control_spektrum.c \
|
||||
$(NPSDIR)/nps_autopilot_rotorcraft.c \
|
||||
$(NPSDIR)/nps_ivy.c \
|
||||
$(NPSDIR)/nps_flightgear.c \
|
||||
|
||||
|
||||
|
||||
nps.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG)
|
||||
|
||||
nps.srcs += firmwares/rotorcraft/main.c
|
||||
nps.srcs += mcu.c
|
||||
nps.srcs += $(SRC_ARCH)/mcu_arch.c
|
||||
|
||||
ifeq ($(TARGET), nps)
|
||||
include $(CFG_SHARED)/i2c_select.makefile
|
||||
endif
|
||||
|
||||
|
||||
nps.CFLAGS += -DPERIODIC_FREQUENCY=512
|
||||
#nps.CFLAGS += -DUSE_LED
|
||||
nps.srcs += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c
|
||||
|
||||
nps.srcs += subsystems/settings.c
|
||||
nps.srcs += $(SRC_ARCH)/subsystems/settings_arch.c
|
||||
|
||||
nps.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport
|
||||
nps.srcs += $(SRC_FIRMWARE)/telemetry.c \
|
||||
subsystems/datalink/downlink.c \
|
||||
$(SRC_ARCH)/ivy_transport.c
|
||||
|
||||
nps.srcs += $(SRC_FIRMWARE)/commands.c
|
||||
|
||||
nps.srcs += $(SRC_FIRMWARE)/datalink.c
|
||||
|
||||
#
|
||||
# Math functions
|
||||
#
|
||||
nps.srcs += math/pprz_geodetic_int.c math/pprz_geodetic_float.c math/pprz_geodetic_double.c math/pprz_trig_int.c
|
||||
|
||||
nps.CFLAGS += -DROTORCRAFT_BARO_LED=2
|
||||
nps.srcs += $(SRC_BOARD)/baro_board.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
|
||||
#nps.CFLAGS += -DUSE_DAC
|
||||
#nps.srcs += $(SRC_ARCH)/mcu_periph/dac_arch.c
|
||||
|
||||
|
||||
#nps.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\"
|
||||
#nps.CFLAGS += -DIMU_B2_VERSION_1_1
|
||||
|
||||
nps.srcs += $(SRC_FIRMWARE)/autopilot.c
|
||||
|
||||
#
|
||||
# in makefile section of airframe xml
|
||||
# include $(CFG_BOOZ)/subsystems/booz2_ahrs_lkf.makefile
|
||||
# or
|
||||
# include $(CFG_BOOZ)/subsystems/booz2_ahrs_cmpl.makefile
|
||||
#
|
||||
|
||||
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
|
||||
#NUM_TYPE=float
|
||||
|
||||
STAB_TYPE=euler
|
||||
#STAB_TYPE=quaternion
|
||||
|
||||
ifeq ($(NUM_TYPE), integer)
|
||||
nps.CFLAGS += -DSTABILISATION_ATTITUDE_TYPE_INT
|
||||
nps.CFLAGS += -DSTABILISATION_ATTITUDE_H=\"stabilization/stabilization_attitude_int.h\"
|
||||
ifeq ($(STAB_TYPE), euler)
|
||||
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)
|
||||
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)
|
||||
nps.CFLAGS += -DSTABILISATION_ATTITUDE_TYPE_FLOAT
|
||||
nps.CFLAGS += -DSTABILISATION_ATTITUDE_H=\"stabilization/stabilization_attitude_float.h\"
|
||||
ifeq ($(STAB_TYPE), euler)
|
||||
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)
|
||||
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
|
||||
|
||||
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
|
||||
nps.srcs += $(SRC_SUBSYSTEMS)/ins/vf_float.c
|
||||
nps.CFLAGS += -DUSE_VFF -DDT_VFILTER='(1./512.)'
|
||||
|
||||
#
|
||||
# INS choice
|
||||
#
|
||||
# include ins_hff.makefile
|
||||
# or
|
||||
# nothing
|
||||
#
|
||||
|
||||
|
||||
nps.srcs += $(SRC_FIRMWARE)/navigation.c
|
||||
nps.srcs += $(SRC_SUBSYSTEMS)/navigation/common_flight_plan.c
|
||||
$(warning The fdm_nps subsystem has been renamed, please replace <subsystem name="fdm" type="nps"/> with <subsystem name="fdm" type="jsbsim"/> in your airframe file.)
|
||||
|
||||
Reference in New Issue
Block a user