[sim] moving the old ocaml simulator to NPS (#3167)

- the exact same basic model is now a NPS FDM
- sim target still woks, it is just an alias to NPS with the proper FDM
- the old ocaml files are removed
- AHRS and INS are bypassed, since the accelerations are not well calculated by the model
This commit is contained in:
Gautier Hattenberger
2023-11-07 10:21:12 +01:00
committed by GitHub
parent dfb08fa733
commit 41451d5422
52 changed files with 376 additions and 2304 deletions
+1 -1
View File
@@ -10,7 +10,7 @@
<depends>actuators</depends>
<provides>actuators</provides>
</dep>
<makefile target="nps">
<makefile target="sim|nps">
<file_arch name="actuators_pwm_arch.c"/>
</makefile>
</module>
+19
View File
@@ -0,0 +1,19 @@
<!DOCTYPE module SYSTEM "module.dtd">
<module name="fdm_fixedwing_sim" dir="fdm">
<doc>
<description>
Basic fixedwing FDM for NPS simulator
This flight dynamic model is the copy of the legacy simulator that was written in OCaml.
Its only purpose is to allow to test the flight plans with a very simple airplane model.
</description>
</doc>
<header/>
<makefile target="sim|nps|hitl">
<define name="NPS_BYPASS_AHRS" value="TRUE"/>
<define name="NPS_BYPASS_INS" value="TRUE"/>
<file name="nps_fdm_fixedwing_sim.c" dir="nps"/>
</makefile>
</module>
+1 -1
View File
@@ -28,7 +28,7 @@
<makefile target="!fbw">
<file name="main_ap.c" dir="."/>
</makefile>
<makefile target="nps">
<makefile target="sim|nps">
<define name="AP"/>
<file name="nps_autopilot_fixedwing.c" dir="nps"/>
</makefile>
+1 -1
View File
@@ -17,7 +17,7 @@
</header>
<init fun="gps_nps_init()"/>
<periodic fun="gps_nps_periodic_check()" freq="1." autorun="TRUE"/>
<makefile target="nps">
<makefile target="sim|nps">
<file name="gps_sim_nps.c"/>
<define name="GPS_TYPE_H" value="modules/gps/gps_sim_nps.h" type="string"/>
<test>
+1 -1
View File
@@ -40,7 +40,7 @@
</header>
<init fun="imu_init()"/>
<makefile target="!sim|fbw">
<makefile target="!fbw">
<define name="USE_IMU"/>
<file name="imu.c"/>
<test/>
+1 -1
View File
@@ -16,7 +16,7 @@
<init fun="imu_nps_init()"/>
<event fun="imu_nps_event()"/>
<makefile target="nps">
<makefile target="sim|nps">
<file name="imu_nps.c"/>
</makefile>
</module>
-3
View File
@@ -17,8 +17,5 @@
<makefile target="ap">
<file name="ins_arduimu.c"/>
</makefile>
<makefile target="sim">
<file_arch name="ins_arduimu.c"/>
</makefile>
</module>
-3
View File
@@ -29,8 +29,5 @@
<makefile target="ap">
<file name="ins_arduimu_basic.c"/>
</makefile>
<makefile target="sim">
<file_arch name="ins_arduimu_basic.c"/>
</makefile>
</module>
+2 -2
View File
@@ -14,7 +14,7 @@
<file name="ins_gps_passthrough.h"/>
</header>
<init fun="ins_gps_passthrough_init()"/>
<makefile target="nps">
<makefile target="sim|nps">
<file name="imu.c" dir="modules/imu"/>
<file name="imu_nps.c" dir="modules/imu"/>
<define name="USE_IMU"/>
@@ -34,7 +34,7 @@
<file name="ins.c"/>
<file name="ins_gps_passthrough.c"/>
</makefile>
<makefile target="nps" firmware="fixedwing">
<makefile target="sim|nps" firmware="fixedwing">
<define name="INS_TYPE_H" value="modules/ins/ins_gps_passthrough.h" type="string"/>
<file name="ins.c"/>
<file name="ins_gps_passthrough_utm.c"/>
-1
View File
@@ -31,7 +31,6 @@
<define name="USE_COMMANDS"/>
<file_arch name="sys_time_arch.c" dir="mcu_periph"/>
<file_arch name="led_hw.c" dir="." cond="ifeq ($(ARCH), stm32)"/>
<file_arch name="led_hw.c" dir="." cond="ifeq ($(TARGET), sim)"/>
<flag name="LDFLAGS" value="lrt" cond="ifeq ($(ARCH), linux)"/>
<raw>
VPATH += $(PAPARAZZI_HOME)/var/share
+1 -1
View File
@@ -15,7 +15,7 @@
<provides>baro,airspeed,sonar,incidence,temperature</provides>
<suggests>gps_nps,imu_nps,ins_nps,actuators_nps,telemetry_nps</suggests>
</dep>
<makefile target="nps">
<makefile target="sim|nps">
<define name="AP"/>
<define name="SITL"/>
<file name="nps_electrical.c" dir="$(NPS_DIR)"/>
+1 -1
View File
@@ -12,7 +12,7 @@
<dep>
<depends>math</depends>
</dep>
<makefile target="nps|hitl">
<makefile target="sim|nps|hitl">
<configure name="BARO_PERIODIC_FREQUENCY" default="50"/>
<configure name="NPS_DIR" value="nps"/>
<raw>
+1 -18
View File
@@ -11,26 +11,9 @@
</description>
</doc>
<dep>
<depends>system_core,electrical,settings,actuators_dummy,@gps,@ins,@ahrs</depends>
<suggests>gps_sim,imu_sim,ins_sim,ahrs_sim,baro_sim,telemetry_sim</suggests>
<depends>targets/nps,fdm_fixedwing_sim</depends>
</dep>
<makefile target="sim">
<define name="SITL"/>
<define name="AP"/>
<file name="main_bare.c" dir="."/>
<file_arch name="sim_ap.c" dir="."/>
<file_arch name="sim_gps.c" dir="."/>
<file_arch name="sim_adc_generic.c" dir="."/>
<file_arch name="sim_ahrs.c" dir="."/>
<file_arch name="sim_airspeed.c" dir="."/>
<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
sim.CFLAGS += $(CPPFLAGS)
</raw>
</makefile>
</module>
+1 -1
View File
@@ -22,7 +22,7 @@
</header>
<init fun="pprz_dl_init()"/>
<event fun="pprz_dl_event()"/>
<makefile target="nps">
<makefile target="sim|nps">
<configure name="MODEM_DEV" default="UDP0" case="upper|lower"/>
<configure name="MODEM_PORT_OUT" default="4242"/>
<configure name="MODEM_PORT_IN" default="4243"/>
+1 -1
View File
@@ -19,7 +19,7 @@
<file_arch name="udp_arch.c" dir="mcu_periph"/>
<file name="udp_socket.c" dir="arch/linux" cond="ifeq ($(ARCH), linux)"/>
</makefile>
<makefile target="nps">
<makefile target="sim|nps">
<include name="arch/linux"/>
<file name="udp_socket.c" dir="arch/linux"/>
</makefile>