[modules] simulator modules (SIM and NPS) (#1990)

This commit is contained in:
Gautier Hattenberger
2017-01-26 22:06:48 +01:00
committed by Felix Ruess
parent 85e3f4d19c
commit b47c10fd00
4 changed files with 134 additions and 0 deletions
+91
View File
@@ -0,0 +1,91 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="nps" dir="simulator">
<doc>
<description>
New Paparazzi Simulator (NPS)
Bindings between embedded autopilot code and a flight dynamic model (FDM).
Possible FDM are: JSBSim or CRRCSIM, see corresponding modules.
Can run Software In The Loop (SITL) or Hardware In The Loop (HITL) simulations.
</description>
<configure name="USE_HITL" value="0|1" description="run as SITL (0:default) or HITL (1) simulation"/>
</doc>
<header/>
<makefile target="nps">
<configure name="USE_HITL" default="0"/>
<flag name="ARCHDIR" value="sim"/>
<flag name="MAKEFILE" value="nps"/>
<define name="SITL"/>
<define name="USE_NPS"/>
<raw>
nps.LDFLAGS += -lm -livy $(shell pcre-config --libs) -lgsl -lgslcblas
# detect system arch and include rt and pthread library only on linux
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
nps.LDFLAGS += -lrt -pthread
endif
# sdl needed for joystick input
nps.LDFLAGS += $(shell sdl-config --libs)
# glib is still needed for some components (such as radio input)
nps.CFLAGS += $(shell pkg-config glib-2.0 --cflags)
nps.LDFLAGS += $(shell pkg-config glib-2.0 --libs)
#
# add the simulator directory to the make searchpath
#
VPATH += $(PAPARAZZI_SRC)/sw/simulator
</raw>
<include name="$(SRC_FIRMWARE)"/>
<include name="$(SRC_BOARD)"/>
<include name="$(PAPARAZZI_SRC)/sw/simulator"/>
<include name="$(PAPARAZZI_SRC)/sw/simulator/nps"/>
<include name="$(PAPARAZZI_HOME)/conf/simulator/nps"/>
<file name="nps_random.c" dir="nps"/>
<file name="nps_sensors.c" dir="nps"/>
<file name="nps_sensors_utils.c" dir="nps"/>
<file name="nps_sensor_gyro.c" dir="nps"/>
<file name="nps_sensor_accel.c" dir="nps"/>
<file name="nps_sensor_mag.c" dir="nps"/>
<file name="nps_sensor_baro.c" dir="nps"/>
<file name="nps_sensor_sonar.c" dir="nps"/>
<file name="nps_sensor_gps.c" dir="nps"/>
<file name="nps_sensor_airspeed.c" dir="nps"/>
<file name="nps_sensor_temperature.c" dir="nps"/>
<file name="nps_electrical.c" dir="nps"/>
<file name="nps_atmosphere.c" dir="nps"/>
<file name="nps_ivy.c" dir="nps"/>
<file name="nps_flightgear.c" dir="nps"/>
<file name="nps_radio_control.c" dir="nps"/>
<file name="nps_radio_control_joystick.c" dir="nps"/>
<file name="nps_radio_control_spektrum.c" dir="nps"/>
<file name="nps_main_common.c" dir="nps"/>
<file name="math/pprz_geodetic_wmm2015.c" dir="math"/>
</makefile>
<makefile target="nps" cond="if ($(USE_HITL),0)">
<file name="nps_main_sitl.c" dir="nps"/>
</makefile>
<makefile target="nps" cond="if ($(USE_HITL),1)">
<configure name="INS_DEV" default="/dev/ttyUSB1"/>
<configure name="INS_BAUD" default="B921600"/>
<configure name="AP_DEV" default="/dev/ttyUSB2"/>
<configure name="AP_BAUD" default="B921600"/>
<define name="INS_DEV" value="$(INS_DEV)" type="string"/>
<define name="INS_BAUD" value="$(INS_BAUD)"/>
<define name="AP_DEV" value="$(AP_DEV)" type="string"/>
<define name="AP_BAUD" value="$(AP_BAUD)"/>
<file name="nps_main_hitl.c" dir="nps"/>
<file name="nps_ins_vectornav.c" dir="nps"/> <!-- TODO: move to ins_vectornav -->
</makefile>
<makefile target="nps" firmware="fixedwing">
<file name="nps_autopilot_fixedwing" dir="nps"/>
</makefile>
<makefile target="nps" firmware="rotorcraft">
<file name="nps_autopilot_rotorcraft" dir="nps"/>
</makefile>
</module>
+29
View File
@@ -0,0 +1,29 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="sim" dir="simulator">
<doc>
<description>
Basic Simulator (SIM)
Bindings between embedded autopilot code and a flight dynamic model (FDM).
FDM and low level code is written in OCaml.
Only for fixed-wing.
</description>
</doc>
<header/>
<makefile target="sim">
<define name="SITL"/>
<raw>
UNAME = $(shell uname -s)
ifeq ("$(UNAME)","Darwin")
sim.CFLAGS += $(shell if test -d /opt/paparazzi/include; then echo "-I/opt/paparazzi/include"; elif test -d /opt/local/include; then echo "-I/opt/local/include"; fi)
endif
</raw>
<file_arch name="sim_ap.c" dir="."/>
<file_arch name="sim_gps.c" dir="."/>
<file_arch name="sim_adc_generics.c" dir="."/>
<file_arch name="sim_ahrs.c" dir="."/>
<file_arch name="sim_ir.c" dir="."/>
</makefile>
</module>
+11
View File
@@ -21,5 +21,16 @@
<file name="telemetry.c" dir="subsystems/datalink"/>
<file name="ivy_transport.c" dir="pprzlink/src"/>
</makefile>
<makefile target="ap" firmware="fixedwing">
<file name="fixedwing_datalink.c" dir="$(SRC_FIRMWARE)"/>
<file name="ap_downlink.c" dir="$(SRC_FIRMWARE)"/>
</makefile>
<makefile target="ap|fbw" firmware="fixedwing">
<file name="fbw_downlink.c" dir="$(SRC_FIRMWARE)"/>
</makefile>
<makefile target="ap" firmware="rotorcraft">
<file name="rotorcraft_datalink.c" dir="$(SRC_FIRMWARE)"/>
<file name="rotorcraft_telemetry.c" dir="$(SRC_FIRMWARE)"/>
</makefile>
</module>
+3
View File
@@ -22,6 +22,9 @@
<file name="datalink.c" dir="subsystems/datalink"/>
<file name="telemetry.c" dir="subsystems/datalink"/>
<file name="ivy_transport.c" dir="pprzlink/src"/>
<file name="fixedwing_datalink.c" dir="$(SRC_FIRMWARE)"/>
<file name="ap_downlink.c" dir="$(SRC_FIRMWARE)"/>
<file name="fbw_downlink.c" dir="$(SRC_FIRMWARE)"/>
</makefile>
</module>