diff --git a/Makefile.ac b/Makefile.ac index 4acd281c5b..93e3c50fc1 100644 --- a/Makefile.ac +++ b/Makefile.ac @@ -31,27 +31,28 @@ AIRBORNE=sw/airborne MESSAGES_XML = $(CONF)/messages.xml ACINCLUDE = $(PAPARAZZI_HOME)/var/$(AIRCRAFT) AIRCRAFT_CONF_DIR = $(ACINCLUDE)/conf -AIRFRAME_H=$(ACINCLUDE)/airframe.h +AC_GENERATED = $(ACINCLUDE)/generated ifndef PERIODIC_FREQ PERIODIC_FREQ = 60 endif -PERIODIC_H=$(ACINCLUDE)/periodic.h -RADIO_H=$(ACINCLUDE)/radio.h -FLIGHT_PLAN_H=$(ACINCLUDE)/flight_plan.h +AIRFRAME_H=$(AC_GENERATED)/airframe.h +PERIODIC_H=$(AC_GENERATED)/periodic.h +RADIO_H=$(AC_GENERATED)/radio.h +FLIGHT_PLAN_H=$(AC_GENERATED)/flight_plan.h FLIGHT_PLAN_XML=$(ACINCLUDE)/flight_plan.xml -SETTINGS_H=$(ACINCLUDE)/settings.h +SETTINGS_H=$(AC_GENERATED)/settings.h SETTINGS_XMLS=$(patsubst %,$(CONF)/%,$(SETTINGS)) SETTINGS_XML=$(ACINCLUDE)/settings.xml SETTINGS_MODULES=$(ACINCLUDE)/settings_modules.xml MAKEFILE_AC=$(ACINCLUDE)/Makefile.ac SETTINGS_FILE=$(SETTINGS:settings%=%) #TUNING_FILE=$(subst ,_,$(SETTINGS:settings/%.xml=%)).h -TUNING_H=$(ACINCLUDE)/tuning.h +TUNING_H=$(AC_GENERATED)/tuning.h SUPERVISION=./paparazzi MAKE=make PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) -MODULES_H=$(ACINCLUDE)/modules.h +MODULES_H=$(AC_GENERATED)/modules.h MODULES_DIR=$(PAPARAZZI_HOME)/conf/modules/ AIRCRAFT_MD5=$(AIRCRAFT_CONF_DIR)/aircraft.md5 @@ -82,18 +83,21 @@ flight_plan_ac_h : $(FLIGHT_PLAN_H) $(FLIGHT_PLAN_XML) makefile_ac: $(MAKEFILE_AC) $(AIRFRAME_H) : $(CONF)/$(AIRFRAME_XML) $(CONF_XML) $(AIRCRAFT_MD5) + $(Q)test -d $(AC_GENERATED) || mkdir -p $(AC_GENERATED) @echo BUILD $@ $(Q)$(TOOLS)/gen_airframe.out $(AC_ID) $(AIRCRAFT) $(MD5SUM) $< > /tmp/airframe.h $(Q)mv /tmp/airframe.h $@ $(Q)cp $(CONF)/airframes/airframe.dtd $(AIRCRAFT_CONF_DIR)/airframes $(RADIO_H) : $(CONF)/$(RADIO) $(CONF_XML) $(TOOLS)/gen_radio.out + $(Q)test -d $(AC_GENERATED) || mkdir -p $(AC_GENERATED) @echo BUILD $@ $(Q)$(TOOLS)/gen_radio.out $< > /tmp/radio.h $(Q)mv /tmp/radio.h $@ $(Q)cp $< $(AIRCRAFT_CONF_DIR)/radios $(PERIODIC_H) : $(CONF)/$(AIRFRAME_XML) $(MESSAGES_XML) $(CONF_XML) $(CONF)/$(TELEMETRY) $(MAKEFILE_AC) + $(Q)test -d $(AC_GENERATED) || mkdir -p $(AC_GENERATED) @echo BUILD $@ $(Q)$(TOOLS)/gen_periodic.out $(CONF)/$(AIRFRAME_XML) $(MESSAGES_XML) $(CONF)/$(TELEMETRY) $(PERIODIC_FREQ) > $@ $(Q)chmod a+r $@ @@ -101,6 +105,7 @@ $(PERIODIC_H) : $(CONF)/$(AIRFRAME_XML) $(MESSAGES_XML) $(CONF_XML) $(CONF)/$(TE $(Q)cp $(CONF)/$(TELEMETRY) $(AIRCRAFT_CONF_DIR)/telemetry $(FLIGHT_PLAN_H) : $(CONF)/$(FLIGHT_PLAN) $(CONF_XML) $(TOOLS)/gen_flight_plan.out + $(Q)test -d $(AC_GENERATED) || mkdir -p $(AC_GENERATED) @echo BUILD $@ $(Q)$(TOOLS)/gen_flight_plan.out $< > /tmp/$(AC_ID)_fp.h $(Q)mv /tmp/$(AC_ID)_fp.h $@ @@ -113,16 +118,19 @@ $(FLIGHT_PLAN_XML) : $(CONF)/$(FLIGHT_PLAN) $(CONF_XML) $(TOOLS)/gen_flight_plan $(Q)chmod a+r $@ $(SETTINGS_H) : $(SETTINGS_XMLS) $(CONF_XML) $(SETTINGS_MODULES) $(TOOLS)/gen_settings.out + $(Q)test -d $(AC_GENERATED) || mkdir -p $(AC_GENERATED) @echo BUILD $@ $(Q)$(TOOLS)/gen_settings.out $(SETTINGS_XML) $(SETTINGS_XMLS) $(SETTINGS_MODULES) > $@ $(Q)chmod a+r $@ $(Q)cp $(SETTINGS_XMLS) $(AIRCRAFT_CONF_DIR)/settings $(TUNING_H) : $(SETTINGS_XMLS) $(CONF_XML) $(TOOLS)/gen_tuning.out + $(Q)test -d $(AC_GENERATED) || mkdir -p $(AC_GENERATED) @echo BUILD $@ $(Q)$(TOOLS)/gen_tuning.out $(SETTINGS_XMLS) > $@ $(MODULES_H) : $(CONF)/$(AIRFRAME_XML) $(TOOLS)/gen_modules.out $(CONF)/modules/*.xml + $(Q)test -d $(AC_GENERATED) || mkdir -p $(AC_GENERATED) @echo BUILD $@ $(Q)$(TOOLS)/gen_modules.out $(MODULES_DIR) $(SETTINGS_MODULES) $< > $@ $(Q)chmod a+r $@ diff --git a/conf/airframes/ENAC/fixed-wing/drops.xml b/conf/airframes/ENAC/fixed-wing/drops.xml index ddb2e42609..cf7359cc92 100644 --- a/conf/airframes/ENAC/fixed-wing/drops.xml +++ b/conf/airframes/ENAC/fixed-wing/drops.xml @@ -1,4 +1,4 @@ - +on diff --git a/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_mkk_example.xml b/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_mkk_example.xml index 3acd5c171a..7c4c1e8e8a 100644 --- a/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_mkk_example.xml +++ b/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_mkk_example.xml @@ -3,7 +3,7 @@ diff --git a/conf/airframes/Paul/minimag1.xml b/conf/airframes/Paul/minimag1.xml index 14690e7d74..f16f2aca5f 100644 --- a/conf/airframes/Paul/minimag1.xml +++ b/conf/airframes/Paul/minimag1.xml @@ -196,10 +196,10 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_3 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DWIND_INFO diff --git a/conf/airframes/Poine/antenna.xml b/conf/airframes/Poine/antenna.xml index 2f4f58f660..19a339e347 100644 --- a/conf/airframes/Poine/antenna.xml +++ b/conf/airframes/Poine/antenna.xml @@ -36,7 +36,7 @@ ant.CFLAGS += -DDATALINK=PPRZ -DPPRZ_UART=Uart0 ant.srcs += datalink.c ant.srcs += subsystems/navigation/traffic_info.c -ant.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B9600 +ant.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B9600 ant.srcs += estimator.c gps_ubx.c gps.c ant.srcs += avr/ant_tracker.c diff --git a/conf/airframes/Poine/beth.xml b/conf/airframes/Poine/beth.xml index 808669cb93..ed7388ddb1 100644 --- a/conf/airframes/Poine/beth.xml +++ b/conf/airframes/Poine/beth.xml @@ -256,9 +256,9 @@ overo_test_uart.srcs += $(SRC_FMS)/udp_transport2.c downlink.c overo_test_uart.srcs += $(SRC_FMS)/fms_network.c overo_test_uart.LDFLAGS += -levent -lm overo_test_uart.srcs += $(SRC_BETH)/overo_gcs_com.c -#overo_test_uart.CFLAGS += -DUBX -DGPS -DUSE_UART0 -DUART0_BAUD=B9600 -DGPS_CONFIGURE -DUSER_GPS_CONFIGURE=\"modules/gps_i2c/runtime_configure.h\" -DGPS_BAUD=B38400 -DGPS_LINK=Uart0 -DGPS_USE_LATLONG -#overo_test_uart.CFLAGS += -DUBX -DGPS -DUSE_UART0 -DUART0_BAUD=B9600 -DGPS_CONFIGURE -DGPS_BAUD=B38400 -DGPS_LINK=Uart0 -DGPS_USE_LATLONG -overo_test_uart.CFLAGS += -DUBX -DGPS -DUSE_UART0 -DUART0_BAUD=B38400 -DGPS_LINK=Uart0 -DGPS_USE_LATLONG +#overo_test_uart.CFLAGS += -DUBX -DUSE_GPS -DUSE_UART0 -DUART0_BAUD=B9600 -DGPS_CONFIGURE -DUSER_GPS_CONFIGURE=\"modules/gps_i2c/runtime_configure.h\" -DGPS_BAUD=B38400 -DGPS_LINK=Uart0 -DGPS_USE_LATLONG +#overo_test_uart.CFLAGS += -DUBX -DUSE_GPS -DUSE_UART0 -DUART0_BAUD=B9600 -DGPS_CONFIGURE -DGPS_BAUD=B38400 -DGPS_LINK=Uart0 -DGPS_USE_LATLONG +overo_test_uart.CFLAGS += -DUBX -DUSE_GPS -DUSE_UART0 -DUART0_BAUD=B38400 -DGPS_LINK=Uart0 -DGPS_USE_LATLONG overo_test_uart.srcs += gps_ubx.c gps.c latlong.c $(SRC_BETH)/uart_hw.c overo_test_uart.CFLAGS +=-DUSE_UART1 -DUART1_BAUD=B57600 -DDOWNLINK_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ overo_test_uart.srcs += pprz_transport.c $(SRC_BETH)/rcv_telemetry.c diff --git a/conf/airframes/Poine/easy_glider1.xml b/conf/airframes/Poine/easy_glider1.xml index 3c166ec895..44394d52a2 100644 --- a/conf/airframes/Poine/easy_glider1.xml +++ b/conf/airframes/Poine/easy_glider1.xml @@ -185,12 +185,12 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 ap.CFLAGS += -DGPS_CONFIGURE -DGPS_BAUD=38400 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO diff --git a/conf/airframes/Poine/pt_ant.xml b/conf/airframes/Poine/pt_ant.xml index 7f6164df25..93ade9c70e 100644 --- a/conf/airframes/Poine/pt_ant.xml +++ b/conf/airframes/Poine/pt_ant.xml @@ -47,7 +47,7 @@ main.srcs += AMI601.c i2c.c $(SRC_ARCH)/i2c_hw.c #main.srcs += pt_ant_estimator.c main.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B9600 -#main.CFLAGS += -DGPS -DUBX -DGPS_LINK=Uart1 +#main.CFLAGS += -DUSE_GPS -DUBX -DGPS_LINK=Uart1 #main.CFLAGS += -DGPS_USER_CALLBACK=pt_ant_estimator_update_self_gps -DGPS_USER_CALLBACK_HEADER=\"pt_ant_estimator.h\" #main.CFLAGS += -DGPS_CONFIGURE -DGPS_BAUD=38400 #main.srcs += gps_ubx.c gps.c diff --git a/conf/airframes/TUDelft/Trip50A.xml b/conf/airframes/TUDelft/Trip50A.xml index 3f3643a9a0..0a681fbb23 100644 --- a/conf/airframes/TUDelft/Trip50A.xml +++ b/conf/airframes/TUDelft/Trip50A.xml @@ -274,13 +274,13 @@ ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c -ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_4 -DUSE_ADC_5 -DGYRO -DIDG300 +ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_4 -DUSE_ADC_5 -DUSE_GYRO -DIDG300 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET -DSTRONG_WIND +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET -DSTRONG_WIND ap.srcs += infrared.c estimator.c gyro.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM diff --git a/conf/airframes/TUDelft/Trip50B.xml b/conf/airframes/TUDelft/Trip50B.xml index a49154fe6a..af557a6d57 100644 --- a/conf/airframes/TUDelft/Trip50B.xml +++ b/conf/airframes/TUDelft/Trip50B.xml @@ -279,13 +279,13 @@ ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c -ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_4 -DUSE_ADC_5 -DGYRO -DIDG300 +ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_4 -DUSE_ADC_5 -DUSE_GYRO -DIDG300 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET -DSTRONG_WIND +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET -DSTRONG_WIND ap.srcs += infrared.c estimator.c gyro.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM diff --git a/conf/airframes/TUDelft/holiday50.xml b/conf/airframes/TUDelft/holiday50.xml index 80283838a7..3a1745e964 100644 --- a/conf/airframes/TUDelft/holiday50.xml +++ b/conf/airframes/TUDelft/holiday50.xml @@ -274,19 +274,19 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_4 -DUSE_ADC_5 ap.srcs += $(SRC_ARCH)/adc_hw.c -# GPS on UART1 -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 +# USE_GPS on UART1 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 #ap.CFLAGS += -DGPS_CONFIGURE -DGPS_BAUD=38400 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c ap.CFLAGS += -DTUNE_AGRESSIVE_CLIMB -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c ap.CFLAGS += -DUSE_MODULES diff --git a/conf/airframes/UofAdelaide/A1000_BOOZ.xml b/conf/airframes/UofAdelaide/A1000_BOOZ.xml index bee3a3fa4a..3bd37f4813 100644 --- a/conf/airframes/UofAdelaide/A1000_BOOZ.xml +++ b/conf/airframes/UofAdelaide/A1000_BOOZ.xml @@ -343,7 +343,7 @@ include $(CFG_BOOZ)/subsystems/booz2_ahrs_cmpl.makefile ap.CFLAGS += -DFAILSAFE_GROUND_DETECT include $(CFG_BOOZ)/subsystems/ins_hff.makefile -#set GPS lag for horizontal filter +#set USE_GPS lag for horizontal filter ap.CFLAGS += -DGPS_LAG=0.8 -DUSE_GPS_ACC4R ap.CFLAGS += -DGPS_USE_LATLONG diff --git a/conf/airframes/UofAdelaide/A1000_NOVA.xml b/conf/airframes/UofAdelaide/A1000_NOVA.xml index b1862dacc0..fe7204faf8 100644 --- a/conf/airframes/UofAdelaide/A1000_NOVA.xml +++ b/conf/airframes/UofAdelaide/A1000_NOVA.xml @@ -292,7 +292,7 @@ include $(CFG_BOOZ)/subsystems/booz2_ahrs_cmpl.makefile include $(CFG_BOOZ)/subsystems/ins_hff.makefile -#set GPS lag for horizontal filter +#set USE_GPS lag for horizontal filter ap.CFLAGS += -DGPS_LAG=0.8 #-DUSE_GPS_ACC4R ap.CFLAGS += -DGPS_USE_LATLONG diff --git a/conf/airframes/UofAdelaide/booz2_NoVa_001_1000.xml b/conf/airframes/UofAdelaide/booz2_NoVa_001_1000.xml index 195bde6754..e2189844cc 100644 --- a/conf/airframes/UofAdelaide/booz2_NoVa_001_1000.xml +++ b/conf/airframes/UofAdelaide/booz2_NoVa_001_1000.xml @@ -248,7 +248,7 @@ include $(CFG_BOOZ)/subsystems/booz2_ahrs_cmpl.makefile include $(CFG_BOOZ)/subsystems/ins_hff.makefile -#set GPS lag for horizontal filter +#set USE_GPS lag for horizontal filter ap.CFLAGS += -DGPS_LAG=0.8 #-DUSE_GPS_ACC4R ap.CFLAGS += -DGPS_USE_LATLONG diff --git a/conf/airframes/UofAdelaide/booz2_a1000.xml b/conf/airframes/UofAdelaide/booz2_a1000.xml index 82afe762c7..a1d966b225 100755 --- a/conf/airframes/UofAdelaide/booz2_a1000.xml +++ b/conf/airframes/UofAdelaide/booz2_a1000.xml @@ -304,7 +304,7 @@ include $(CFG_BOOZ)/subsystems/booz2_ahrs_cmpl.makefile ap.CFLAGS += -DFAILSAFE_GROUND_DETECT include $(CFG_BOOZ)/subsystems/ins_hff.makefile -#set GPS lag for horizontal filter +#set USE_GPS lag for horizontal filter ap.CFLAGS += -DGPS_LAG=0.8 -DUSE_GPS_ACC4R ap.CFLAGS += -DGPS_USE_LATLONG diff --git a/conf/airframes/booz2_NoVa.xml b/conf/airframes/booz2_NoVa.xml index 0a81b294fc..5a050ecd98 100644 --- a/conf/airframes/booz2_NoVa.xml +++ b/conf/airframes/booz2_NoVa.xml @@ -244,7 +244,7 @@ include $(CFG_BOOZ)/subsystems/booz2_ahrs_cmpl.makefile include $(CFG_BOOZ)/subsystems/ins_hff.makefile -#set GPS lag for horizontal filter +#set USE_GPS lag for horizontal filter ap.CFLAGS += -DGPS_LAG=0.8 -DUSE_GPS_ACC4R ap.CFLAGS += -DGPS_USE_LATLONG diff --git a/conf/airframes/booz2_NoVa_001.xml b/conf/airframes/booz2_NoVa_001.xml index ff0fd70a5f..3962ee5378 100644 --- a/conf/airframes/booz2_NoVa_001.xml +++ b/conf/airframes/booz2_NoVa_001.xml @@ -244,7 +244,7 @@ include $(CFG_BOOZ)/subsystems/booz2_ahrs_cmpl.makefile include $(CFG_BOOZ)/subsystems/ins_hff.makefile -#set GPS lag for horizontal filter +#set USE_GPS lag for horizontal filter ap.CFLAGS += -DGPS_LAG=0.8 -DUSE_GPS_ACC4R ap.CFLAGS += -DGPS_USE_LATLONG diff --git a/conf/airframes/booz2_NoVa_002.xml b/conf/airframes/booz2_NoVa_002.xml index 878d3347fa..198745a46e 100644 --- a/conf/airframes/booz2_NoVa_002.xml +++ b/conf/airframes/booz2_NoVa_002.xml @@ -245,7 +245,7 @@ include $(CFG_BOOZ)/subsystems/booz2_ahrs_cmpl.makefile include $(CFG_BOOZ)/subsystems/ins_hff.makefile -#set GPS lag for horizontal filter +#set USE_GPS lag for horizontal filter ap.CFLAGS += -DGPS_LAG=0.8 -DUSE_GPS_ACC4R ap.CFLAGS += -DGPS_USE_LATLONG diff --git a/conf/airframes/demo_module.xml b/conf/airframes/demo_module.xml index ef487d2141..f8e4223226 100644 --- a/conf/airframes/demo_module.xml +++ b/conf/airframes/demo_module.xml @@ -188,11 +188,11 @@ ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 ap.srcs += $(SRC_ARCH)/adc_hw.c ########## GPS -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG ap.srcs += gps_ubx.c gps.c latlong.c ########## IR sensors -ap.CFLAGS += -DINFRARED -DALT_KALMAN +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN ap.srcs += infrared.c estimator.c ########## Nav diff --git a/conf/airframes/hitl_usb.xml b/conf/airframes/hitl_usb.xml index e06cd6123c..7108d6acf2 100644 --- a/conf/airframes/hitl_usb.xml +++ b/conf/airframes/hitl_usb.xml @@ -136,11 +136,11 @@ ap.srcs += $(SRC_ARCH)/lpcusb/usbstdreq.c $(SRC_ARCH)/lpcusb/usbinit.c ap.CFLAGS += -DINTER_MCU ap.srcs += inter_mcu.c -ap.CFLAGS += -DGPS -DUBX +ap.CFLAGS += -DUSE_GPS -DUBX ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO @@ -154,7 +154,7 @@ ap.CFLAGS += -DGPS_USE_LATLONG # simulating LEA 5H # Config for SITL simulation sim.ARCHDIR = $(ARCH) -sim.CFLAGS += -DSITL -DAP -DFBW -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DINFRARED -DNAV -DLED +sim.CFLAGS += -DSITL -DAP -DFBW -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED sim.srcs = latlong.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c subsystems/navigation/traffic_info.c diff --git a/conf/airframes/microjet_raw_makefile.xml b/conf/airframes/microjet_raw_makefile.xml index 87edd60f7a..050277440c 100644 --- a/conf/airframes/microjet_raw_makefile.xml +++ b/conf/airframes/microjet_raw_makefile.xml @@ -194,10 +194,10 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 ap.srcs += $(SRC_ARCH)/adc_hw.c - ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 + ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 ap.CFLAGS += -DGPS_CONFIGURE -DGPS_BAUD=38400 ap.srcs += gps_ubx.c gps.c latlong.c - ap.CFLAGS += -DINFRARED + ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c diff --git a/conf/airframes/mm/extra/press_t.xml b/conf/airframes/mm/extra/press_t.xml index 989089a3e3..38dfec588a 100755 --- a/conf/airframes/mm/extra/press_t.xml +++ b/conf/airframes/mm/extra/press_t.xml @@ -252,11 +252,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_4 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM diff --git a/conf/airframes/mm/fixed-wing/drops.xml b/conf/airframes/mm/fixed-wing/drops.xml index 9286295c6b..69dc6e5362 100644 --- a/conf/airframes/mm/fixed-wing/drops.xml +++ b/conf/airframes/mm/fixed-wing/drops.xml @@ -267,14 +267,14 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM @@ -293,7 +293,7 @@ sim.ARCHDIR = $(ARCHI) sim.ARCH = sitl sim.TARGET = autopilot sim.TARGETDIR = autopilot -sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DINFRARED -DNAV -DLED -DWIND_INFO +sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl_a.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN diff --git a/conf/airframes/mm/fixed-wing/funjeteth1.xml b/conf/airframes/mm/fixed-wing/funjeteth1.xml index 3467396748..a0130847fa 100644 --- a/conf/airframes/mm/fixed-wing/funjeteth1.xml +++ b/conf/airframes/mm/fixed-wing/funjeteth1.xml @@ -228,12 +228,12 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_6 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 # -DGPS_USE_LATLONG # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM diff --git a/conf/airframes/mm/fixed-wing/funjeteth2.xml b/conf/airframes/mm/fixed-wing/funjeteth2.xml index dc97aa16a3..6c092bac67 100644 --- a/conf/airframes/mm/fixed-wing/funjeteth2.xml +++ b/conf/airframes/mm/fixed-wing/funjeteth2.xml @@ -229,12 +229,12 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_6 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 # -DGPS_USE_LATLONG # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM diff --git a/conf/airframes/mm/fixed-wing/funjetfmi1.xml b/conf/airframes/mm/fixed-wing/funjetfmi1.xml index 9aa572236b..190f934f62 100644 --- a/conf/airframes/mm/fixed-wing/funjetfmi1.xml +++ b/conf/airframes/mm/fixed-wing/funjetfmi1.xml @@ -232,11 +232,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM diff --git a/conf/airframes/mm/fixed-wing/funjetfmi2.xml b/conf/airframes/mm/fixed-wing/funjetfmi2.xml index 8e9ea7839e..4147a894e9 100644 --- a/conf/airframes/mm/fixed-wing/funjetfmi2.xml +++ b/conf/airframes/mm/fixed-wing/funjetfmi2.xml @@ -231,11 +231,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM diff --git a/conf/airframes/mm/fixed-wing/funjetfmi3.xml b/conf/airframes/mm/fixed-wing/funjetfmi3.xml index d82714eeb7..2f89ac7e7d 100644 --- a/conf/airframes/mm/fixed-wing/funjetfmi3.xml +++ b/conf/airframes/mm/fixed-wing/funjetfmi3.xml @@ -231,11 +231,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM diff --git a/conf/airframes/mm/fixed-wing/funjetgfi1.xml b/conf/airframes/mm/fixed-wing/funjetgfi1.xml index c45f44c29c..8f0fdbb206 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi1.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi1.xml @@ -209,11 +209,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM diff --git a/conf/airframes/mm/fixed-wing/funjetgfi3.xml b/conf/airframes/mm/fixed-wing/funjetgfi3.xml index 409be7fbfb..f5d33639e7 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi3.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi3.xml @@ -220,11 +220,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DGPS_LED=2 -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 +ap.CFLAGS += -DUSE_GPS -DGPS_LED=2 -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 ap.srcs += gps_ubx.c gps.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED # -DALT_KALMAN ap.srcs += infrared.c estimator.c @@ -232,7 +232,7 @@ ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c latlong.c subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c -#ap.CFLAGS += -DGYRO -DADXRS150 +#ap.CFLAGS += -DUSE_GYRO -DADXRS150 #ap.srcs += gyro.c #ap.srcs += subsystems/navigation/bomb.c diff --git a/conf/airframes/mm/fixed-wing/funjetgfi4.xml b/conf/airframes/mm/fixed-wing/funjetgfi4.xml index 77b15bb9a1..a4bbe25fa9 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi4.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi4.xml @@ -210,11 +210,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM diff --git a/conf/airframes/mm/fixed-wing/funjetgfi5.xml b/conf/airframes/mm/fixed-wing/funjetgfi5.xml index 204a42c03e..a849c6653a 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi5.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi5.xml @@ -211,11 +211,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM diff --git a/conf/airframes/mm/fixed-wing/funjetgfi6.xml b/conf/airframes/mm/fixed-wing/funjetgfi6.xml index 7bd7954f10..233c49573c 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi6.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi6.xml @@ -211,11 +211,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM diff --git a/conf/airframes/mm/fixed-wing/funjetgfi7.xml b/conf/airframes/mm/fixed-wing/funjetgfi7.xml index 7f6a0752b2..3e7abb3574 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi7.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi7.xml @@ -211,11 +211,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM diff --git a/conf/airframes/mm/fixed-wing/funjetgfi8.xml b/conf/airframes/mm/fixed-wing/funjetgfi8.xml index 21f6ff329f..cb284e816e 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi8.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi8.xml @@ -211,11 +211,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM diff --git a/conf/airframes/mm/fixed-wing/funjetgfi9.xml b/conf/airframes/mm/fixed-wing/funjetgfi9.xml index 4275921d65..2a4de16260 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi9.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi9.xml @@ -211,11 +211,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM diff --git a/conf/airframes/mm/fixed-wing/funjetmm2.xml b/conf/airframes/mm/fixed-wing/funjetmm2.xml index 90b63fb2e4..4485d2195a 100644 --- a/conf/airframes/mm/fixed-wing/funjetmm2.xml +++ b/conf/airframes/mm/fixed-wing/funjetmm2.xml @@ -237,12 +237,12 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_4 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 # -DGPS_USE_LATLONG # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM diff --git a/conf/airframes/mm/fixed-wing/merlin.xml b/conf/airframes/mm/fixed-wing/merlin.xml index d310b210fd..d59cad1053 100644 --- a/conf/airframes/mm/fixed-wing/merlin.xml +++ b/conf/airframes/mm/fixed-wing/merlin.xml @@ -206,11 +206,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 # -DGPS_USE_LATLONG ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM @@ -224,7 +224,7 @@ ap.srcs += subsystems/navigation/snav.c # Config for SITL simulation # include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile sim.ARCHDIR = $(ARCH) -sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DINFRARED -DNAV -DLED -DWIND_INFO +sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN diff --git a/conf/airframes/mm/fixed-wing/miniwing.xml b/conf/airframes/mm/fixed-wing/miniwing.xml index 9a2f1afc3d..3e9f7d9597 100644 --- a/conf/airframes/mm/fixed-wing/miniwing.xml +++ b/conf/airframes/mm/fixed-wing/miniwing.xml @@ -200,11 +200,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM diff --git a/conf/airframes/mm/fixed-wing/slowfast.xml b/conf/airframes/mm/fixed-wing/slowfast.xml index dde1afbbce..ddf00fbd9a 100644 --- a/conf/airframes/mm/fixed-wing/slowfast.xml +++ b/conf/airframes/mm/fixed-wing/slowfast.xml @@ -252,11 +252,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM @@ -266,7 +266,7 @@ ap.srcs += subsystems/navigation/nav_line.c ap.srcs += subsystems/navigation/nav_survey_rectangle.c ap.srcs += subsystems/navigation/snav.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c # Config for SITL simulation diff --git a/conf/airframes/mm/fixed-wing/slowfast2.xml b/conf/airframes/mm/fixed-wing/slowfast2.xml index 75083c1a7b..708cf98ac2 100644 --- a/conf/airframes/mm/fixed-wing/slowfast2.xml +++ b/conf/airframes/mm/fixed-wing/slowfast2.xml @@ -266,11 +266,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM @@ -280,7 +280,7 @@ ap.srcs += subsystems/navigation/nav_line.c ap.srcs += subsystems/navigation/nav_survey_rectangle.c ap.srcs += subsystems/navigation/snav.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c # Config for SITL simulation diff --git a/conf/airframes/mm/fixed-wing/twinstarmm.xml b/conf/airframes/mm/fixed-wing/twinstarmm.xml index 73e30a3384..92db7ebddb 100644 --- a/conf/airframes/mm/fixed-wing/twinstarmm.xml +++ b/conf/airframes/mm/fixed-wing/twinstarmm.xml @@ -228,10 +228,10 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM @@ -247,7 +247,7 @@ ap.srcs += subsystems/navigation/snav.c # Config for SITL simulation # include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile sim.ARCHDIR = $(ARCHI) -sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DINFRARED -DNAV -DLED -DWIND_INFO +sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl_a.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN diff --git a/conf/airframes/mm/hangar/black_one.xml b/conf/airframes/mm/hangar/black_one.xml index 8cde8d64db..fcb1f0398f 100644 --- a/conf/airframes/mm/hangar/black_one.xml +++ b/conf/airframes/mm/hangar/black_one.xml @@ -239,17 +239,17 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_AD0 -DUSE_AD0_1 -DUSE_AD0_2 -DUSE_AD0_3 -DUSE_AD1 -DUSE_AD1_7 -DUSE_AD1_3 -DUSE_AD1_2 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 -DGPS_CONFIGURE -DZ_CONTRAST_DEFAULT=1 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 -DGPS_CONFIGURE -DZ_CONTRAST_DEFAULT=1 ap.srcs += gps_ubx.c gps.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DIR_360 +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DIR_360 ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c ap.srcs += subsystems/navigation/bomb.c diff --git a/conf/airframes/mm/hangar/glass_one1.xml b/conf/airframes/mm/hangar/glass_one1.xml index 6a8cbf38c5..c87a0f442c 100644 --- a/conf/airframes/mm/hangar/glass_one1.xml +++ b/conf/airframes/mm/hangar/glass_one1.xml @@ -229,19 +229,19 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_4 -DUSE_ADC_5 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 -DGPS_CONFIGURE -DZ_CONTRAST_DEFAULT=1 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 -DGPS_CONFIGURE -DZ_CONTRAST_DEFAULT=1 ap.CFLAGS += -DGPS_BAUD=38400 ap.srcs += gps_ubx.c gps.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c # -DALT_KALMAN ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c latlong.c subsystems/navigation/nav_survey_rectangle.c -#ap.CFLAGS += -DGYRO -DADXRS150 +#ap.CFLAGS += -DUSE_GYRO -DADXRS150 #ap.srcs += gyro.c #ap.CFLAGS += -DCAM -DMOBILE_CAM -DPOINT_CAM -DPOINT_CAM_PITCH diff --git a/conf/airframes/mm/hangar/glass_one2.xml b/conf/airframes/mm/hangar/glass_one2.xml index 6929e54467..d1b53ac34e 100644 --- a/conf/airframes/mm/hangar/glass_one2.xml +++ b/conf/airframes/mm/hangar/glass_one2.xml @@ -203,12 +203,12 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_4 -DUSE_ADC_5 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 -DGPS_CONFIGURE -DZ_CONTRAST_DEFAULT=1 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 -DGPS_CONFIGURE -DZ_CONTRAST_DEFAULT=1 ap.CFLAGS += -DGPS_BAUD=38400 ap.srcs += gps_ubx.c gps.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c # -DALT_KALMAN diff --git a/conf/airframes/mm/hangar/glass_one3.xml b/conf/airframes/mm/hangar/glass_one3.xml index 9fb1832a7e..8eb4e8755e 100644 --- a/conf/airframes/mm/hangar/glass_one3.xml +++ b/conf/airframes/mm/hangar/glass_one3.xml @@ -230,12 +230,12 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_4 -DUSE_ADC_5 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 -DGPS_CONFIGURE -DZ_CONTRAST_DEFAULT=1 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 -DGPS_CONFIGURE -DZ_CONTRAST_DEFAULT=1 ap.CFLAGS += -DGPS_BAUD=38400 ap.srcs += gps_ubx.c gps.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c # -DALT_KALMAN diff --git a/conf/airframes/mm/hangar/lila.xml b/conf/airframes/mm/hangar/lila.xml index cb836c647b..c93cca0366 100644 --- a/conf/airframes/mm/hangar/lila.xml +++ b/conf/airframes/mm/hangar/lila.xml @@ -227,14 +227,14 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO -DWIND_INFO_RET ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM @@ -247,7 +247,7 @@ ap.srcs += subsystems/navigation/snav.c # Config for SITL simulation sim.ARCHDIR = $(ARCHI) -sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DINFRARED -DNAV -DLED -DWIND_INFO +sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO sim.srcs = latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl_a.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/ivy_transport.c $(SRC_ARCH)/sim_adc_generic.c $(SRC_ARCH)/led_hw.c sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN diff --git a/conf/airframes/mm/hangar/mac06a.xml b/conf/airframes/mm/hangar/mac06a.xml index 6b8481861b..e7e2240692 100644 --- a/conf/airframes/mm/hangar/mac06a.xml +++ b/conf/airframes/mm/hangar/mac06a.xml @@ -224,18 +224,18 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_4 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 ap.srcs += gps_ubx.c gps.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DIR_360 +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DIR_360 ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c ap.srcs += subsystems/navigation/bomb.c diff --git a/conf/airframes/mm/hangar/red_one.xml b/conf/airframes/mm/hangar/red_one.xml index 0d22be87d4..e2aca5ec54 100644 --- a/conf/airframes/mm/hangar/red_one.xml +++ b/conf/airframes/mm/hangar/red_one.xml @@ -250,19 +250,19 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_4 -DUSE_ADC_5 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 -DGPS_CONFIGURE -DZ_CONTRAST_DEFAULT=1 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 -DGPS_CONFIGURE -DZ_CONTRAST_DEFAULT=1 ap.CFLAGS += -DGPS_BAUD=38400 ap.srcs += gps_ubx.c gps.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c # -DALT_KALMAN ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c latlong.c subsystems/navigation/nav_survey_rectangle.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c ap.srcs += subsystems/navigation/bomb.c diff --git a/conf/airframes/obsolete/easystar2.xml b/conf/airframes/obsolete/easystar2.xml index 8fafa850b8..2ebf40831f 100644 --- a/conf/airframes/obsolete/easystar2.xml +++ b/conf/airframes/obsolete/easystar2.xml @@ -202,11 +202,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 ap.srcs += $(SRC_ARCH)/adc_hw.c -# GPS configuration -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG -DGPS_LED=2 +# USE_GPS configuration +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN ap.srcs += infrared.c estimator.c # Control loops diff --git a/conf/airframes/obsolete/example.xml b/conf/airframes/obsolete/example.xml index fc36b7c49b..81bd9b7c2b 100644 --- a/conf/airframes/obsolete/example.xml +++ b/conf/airframes/obsolete/example.xml @@ -9,7 +9,7 @@ FLASH_MODE = IAP # -# GPS : +# USE_GPS : # # example_gps.ARCHDIR = $(ARCHI) @@ -31,7 +31,7 @@ example_gps.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_D example_gps.srcs += downlink.c pprz_transport.c example_gps.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B38400 -example_gps.CFLAGS += -DGPS -DUBX -DGPS_LINK=Uart0 -DDOWNLINK_GPS_DEVICE=Uart0 -DGPS_BAUD=38400 +example_gps.CFLAGS += -DUSE_GPS -DUBX -DGPS_LINK=Uart0 -DDOWNLINK_GPS_DEVICE=Uart0 -DGPS_BAUD=38400 example_gps.srcs += gps_ubx.c gps.c latlong.c diff --git a/conf/airframes/obsolete/kalscott_easystar.xml b/conf/airframes/obsolete/kalscott_easystar.xml index 042d7ed190..6f5519ba87 100644 --- a/conf/airframes/obsolete/kalscott_easystar.xml +++ b/conf/airframes/obsolete/kalscott_easystar.xml @@ -182,11 +182,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 ap.srcs += $(SRC_ARCH)/adc_hw.c -# GPS configuration -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG -DGPS_LED=2 +# USE_GPS configuration +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -DGPS_USE_LATLONG -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN ap.srcs += infrared.c estimator.c # Control loops diff --git a/conf/airframes/obsolete/malolo_sim.xml b/conf/airframes/obsolete/malolo_sim.xml index 0eceb1953d..bed7e4dce1 100644 --- a/conf/airframes/obsolete/malolo_sim.xml +++ b/conf/airframes/obsolete/malolo_sim.xml @@ -230,7 +230,7 @@ sim.LDFLAGS += `pkg-config glib-2.0 --libs` -lm -lpcre -lglibivy -L/home/cocoleo sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DINFRARED -DNAV +sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV sim.srcs = $(SRC_ARCH)/jsbsim_hw.c $(SRC_ARCH)/jsbsim_gps.c $(SRC_ARCH)/jsbsim_ir.c $(SRC_ARCH)/ivy_transport.c sim.srcs += latlong.c radio_control.c downlink.c commands.c gps.c inter_mcu.c infrared.c fw_h_ctl.c fw_v_ctl.c subsystems/nav.c estimator.c sys_time.c main_fbw.c main_ap.c datalink.c diff --git a/conf/airframes/obsolete/microjet5.xml b/conf/airframes/obsolete/microjet5.xml index 39d92dbe9e..418d2ba25f 100644 --- a/conf/airframes/obsolete/microjet5.xml +++ b/conf/airframes/obsolete/microjet5.xml @@ -195,16 +195,16 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c ap.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c diff --git a/conf/airframes/obsolete/microjet5_tp_auto.xml b/conf/airframes/obsolete/microjet5_tp_auto.xml index 936e26c13c..2202e38386 100644 --- a/conf/airframes/obsolete/microjet5_tp_auto.xml +++ b/conf/airframes/obsolete/microjet5_tp_auto.xml @@ -205,18 +205,18 @@ ap.CFLAGS += -DADC -DUSE_AD0 -DUSE_AD0_2 -DUSE_AD0_3 -DUSE_AD1 -DUSE_AD1_5 -DUSE #ap.CFLAGS += -DADC -DUSE_AD0 -DUSE_AD0_1 -DUSE_AD0_2 -DUSE_AD0_3 -DUSE_AD1 -DUSE_AD1_5 -DUSE_AD1_7 -DUSE_AD1_3 -DUSE_AD1_5 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 ap.srcs += gps_ubx.c gps.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c # Harware In The Loop @@ -228,7 +228,7 @@ ap.srcs += gyro.c include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" sim.srcs += subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/traffic_info.c subsystems/navigation/nav_line.c -sim.CFLAGS += -DGYRO -DADXRS150 +sim.CFLAGS += -DUSE_GYRO -DADXRS150 sim.srcs += gyro.c diff --git a/conf/airframes/obsolete/microjet6.xml b/conf/airframes/obsolete/microjet6.xml index 49da53b858..b253366e0c 100644 --- a/conf/airframes/obsolete/microjet6.xml +++ b/conf/airframes/obsolete/microjet6.xml @@ -227,18 +227,18 @@ ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_4 -DUSE_ADC_6 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DWIND_INFO +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DWIND_INFO ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c subsystems/navigation/nav_survey_rectangle.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c ap.CFLAGS += -DUSE_SPI -DSPI_MASTER -DUSE_SPI_SLAVE0 -DUSE_BARO_MS5534A diff --git a/conf/airframes/obsolete/microjetI.xml b/conf/airframes/obsolete/microjetI.xml index ddb8aca1e6..ed08e55f50 100644 --- a/conf/airframes/obsolete/microjetI.xml +++ b/conf/airframes/obsolete/microjetI.xml @@ -213,18 +213,18 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 #ap.CFLAGS += -DGPS_CONFIGURE -DGPS_BAUD=38400 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c ap.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c diff --git a/conf/airframes/obsolete/microjetII.xml b/conf/airframes/obsolete/microjetII.xml index d8d67e13fa..1948c1959d 100644 --- a/conf/airframes/obsolete/microjetII.xml +++ b/conf/airframes/obsolete/microjetII.xml @@ -213,17 +213,17 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c ap.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c diff --git a/conf/airframes/obsolete/microjetIII.xml b/conf/airframes/obsolete/microjetIII.xml index 1bc30e9624..36df078b8c 100644 --- a/conf/airframes/obsolete/microjetIII.xml +++ b/conf/airframes/obsolete/microjetIII.xml @@ -202,18 +202,18 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 #ap.CFLAGS += -DGPS_CONFIGURE -DGPS_BAUD=38400 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 # -DESTIMATOR_COMP_FILTER ap.srcs += gyro.c diff --git a/conf/airframes/obsolete/minimag_fs.xml b/conf/airframes/obsolete/minimag_fs.xml index 0f354f8c1c..4e5aa431e1 100644 --- a/conf/airframes/obsolete/minimag_fs.xml +++ b/conf/airframes/obsolete/minimag_fs.xml @@ -204,11 +204,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN diff --git a/conf/airframes/obsolete/slayer1.xml b/conf/airframes/obsolete/slayer1.xml index c502088175..086cbd8421 100644 --- a/conf/airframes/obsolete/slayer1.xml +++ b/conf/airframes/obsolete/slayer1.xml @@ -216,11 +216,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_4 -DUSE_ADC_5 -DUSE_ADC_6 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 ap.srcs += gps_ubx.c gps.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM @@ -228,7 +228,7 @@ ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c ap.srcs += subsystems/navigation/nav_line.c subsystems/navigation/nav_survey_rectangle.c -ap.CFLAGS += -DGYRO -DIDG300 +ap.CFLAGS += -DUSE_GYRO -DIDG300 ap.srcs += gyro.c subsystems/navigation/bomb.c # Video switch diff --git a/conf/airframes/obsolete/slayer3.xml b/conf/airframes/obsolete/slayer3.xml index 95d84a30c5..928b3c88d8 100644 --- a/conf/airframes/obsolete/slayer3.xml +++ b/conf/airframes/obsolete/slayer3.xml @@ -218,18 +218,18 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_AD0 -DUSE_AD0_2 -DUSE_AD0_3 -DUSE_AD1 -DUSE_AD1_3 -DUSE_AD1_5 -DUSE_AD1_2 -DUSE_AD1_4 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 ap.srcs += gps_ubx.c gps.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DIR_360 +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DIR_360 ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c # Hack to use the same tuning file than slayer1 diff --git a/conf/airframes/obsolete/slayerJH.xml b/conf/airframes/obsolete/slayerJH.xml index e6ddd46957..48b830b90b 100644 --- a/conf/airframes/obsolete/slayerJH.xml +++ b/conf/airframes/obsolete/slayerJH.xml @@ -201,18 +201,18 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_4 -DUSE_ADC_5 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B57600 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B57600 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c subsystems/navigation/nav_survey_rectangle.c subsystems/navigation/nav_line.c subsystems/navigation/snav.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c diff --git a/conf/airframes/obsolete/slicer1.xml b/conf/airframes/obsolete/slicer1.xml index 75a80869a0..3cd8b34397 100644 --- a/conf/airframes/obsolete/slicer1.xml +++ b/conf/airframes/obsolete/slicer1.xml @@ -2,7 +2,7 @@ @@ -208,15 +208,15 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B9600 -DGPS_LED=2 -DDOWNLINK_GPS_1Hz +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B9600 -DGPS_LED=2 -DDOWNLINK_GPS_1Hz ap.CFLAGS += -DGPS_CONFIGURE -DGPS_BAUD=38400 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO diff --git a/conf/airframes/obsolete/slicer2.xml b/conf/airframes/obsolete/slicer2.xml index 9d69041e18..0311507969 100644 --- a/conf/airframes/obsolete/slicer2.xml +++ b/conf/airframes/obsolete/slicer2.xml @@ -2,7 +2,7 @@ @@ -190,15 +190,15 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B9600 -DGPS_LED=2 -DDOWNLINK_GPS_1Hz +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B9600 -DGPS_LED=2 -DDOWNLINK_GPS_1Hz ap.CFLAGS += -DGPS_CONFIGURE -DGPS_BAUD=38400 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO diff --git a/conf/airframes/obsolete/spirit.xml b/conf/airframes/obsolete/spirit.xml index 2fb6f0a1a5..53c1dc9c9e 100644 --- a/conf/airframes/obsolete/spirit.xml +++ b/conf/airframes/obsolete/spirit.xml @@ -207,15 +207,15 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_6 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B9600 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B9600 ap.CFLAGS += -DGPS_CONFIGURE -DGPS_BAUD=38400 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c -ap.CFLAGS += -DGYRO -DADXRS150 -DPID_RATE_LOOP +ap.CFLAGS += -DUSE_GYRO -DADXRS150 -DPID_RATE_LOOP ap.srcs += gyro.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO diff --git a/conf/airframes/obsolete/spirit_proto.xml b/conf/airframes/obsolete/spirit_proto.xml index 0eaad158af..257a656625 100644 --- a/conf/airframes/obsolete/spirit_proto.xml +++ b/conf/airframes/obsolete/spirit_proto.xml @@ -195,12 +195,12 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B9600 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B9600 ap.CFLAGS += -DGPS_CONFIGURE -DGPS_BAUD=38400 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO diff --git a/conf/airframes/obsolete/storm1.xml b/conf/airframes/obsolete/storm1.xml index f87f77b41f..99dc34336d 100644 --- a/conf/airframes/obsolete/storm1.xml +++ b/conf/airframes/obsolete/storm1.xml @@ -260,18 +260,18 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B19200 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DIR_360 +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DIR_360 ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c -# ap.CFLAGS += -DGYRO -DADXRS150 +# ap.CFLAGS += -DUSE_GYRO -DADXRS150 # ap.srcs += gyro.c ap.srcs += subsystems/navigation/traffic_info.c subsystems/navigation/nav_survey_rectangle.c diff --git a/conf/airframes/obsolete/tiny2.xml b/conf/airframes/obsolete/tiny2.xml index 0290393fa8..4220672e22 100644 --- a/conf/airframes/obsolete/tiny2.xml +++ b/conf/airframes/obsolete/tiny2.xml @@ -223,11 +223,11 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_4 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM diff --git a/conf/airframes/obsolete/tl.xml b/conf/airframes/obsolete/tl.xml index aa52bc22c4..0787729120 100644 --- a/conf/airframes/obsolete/tl.xml +++ b/conf/airframes/obsolete/tl.xml @@ -106,7 +106,7 @@ ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c pprz_transport.c $(TL)/tl_telemetry. ap.CFLAGS += -DTL_AP_MODE_AUTO=TL_AP_MODE_NAV -DDT_VFILTER="(1./60.)" ap.srcs += $(TL)/tl_autopilot.c $(TL)/tl_control.c $(TL)/tl_estimator.c $(TL)/tl_vfilter.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 -DDOWNLINK_GPS_DEVICE=DOWNLINK_AP_DEVICE -DGPS_CONFIGURE -DUSER_GPS_CONFIGURE=\"$(TL)/tl_gps_configure.h\" -DGPS_BAUD=38400 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 -DDOWNLINK_GPS_DEVICE=DOWNLINK_AP_DEVICE -DGPS_CONFIGURE -DUSER_GPS_CONFIGURE=\"$(TL)/tl_gps_configure.h\" -DGPS_BAUD=38400 ap.srcs += gps_ubx.c gps.c latlong.c ap.srcs += $(TL)/tl_imu.c diff --git a/conf/airframes/obsolete/twinjet1.xml b/conf/airframes/obsolete/twinjet1.xml index ffeba4a951..0721f67e8b 100644 --- a/conf/airframes/obsolete/twinjet1.xml +++ b/conf/airframes/obsolete/twinjet1.xml @@ -205,7 +205,7 @@ ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c ap.CFLAGS += -DINTER_MCU -DMCU_SPI_LINK -DUSE_SPI -DSPI_MASTER -DUSE_SPI_SLAVE0 ap.srcs += inter_mcu.c link_mcu.c spi.c $(SRC_ARCH)/spi_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 ap.srcs += gps_ubx.c gps.c latlong.c # ADCs for infrared @@ -215,10 +215,10 @@ ap.CFLAGS += -DUSE_AD1 -DUSE_AD1_2 -DUSE_AD1_3 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DWIND_INFO diff --git a/conf/airframes/obsolete/twinstar6.xml b/conf/airframes/obsolete/twinstar6.xml index 5c758e1ba8..a7a381a4eb 100644 --- a/conf/airframes/obsolete/twinstar6.xml +++ b/conf/airframes/obsolete/twinstar6.xml @@ -210,14 +210,14 @@ ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c subsystems/navigation/tra ap.CFLAGS += -DINTER_MCU -DMCU_SPI_LINK -DUSE_SPI -DSPI_MASTER ap.srcs += inter_mcu.c link_mcu.c spi.c $(SRC_ARCH)/spi_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 ap.srcs += gps_ubx.c gps.c latlong.c # ADCs for infrared ap.CFLAGS += -DADC -DUSE_AD1 -DUSE_AD1_5 -DUSE_AD1_6 -DUSE_AD1_7 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM diff --git a/conf/airframes/obsolete/tyto1.xml b/conf/airframes/obsolete/tyto1.xml index 50ce23c3b5..15feae9864 100644 --- a/conf/airframes/obsolete/tyto1.xml +++ b/conf/airframes/obsolete/tyto1.xml @@ -228,18 +228,18 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DGPS_CONFIGURE -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B9600 +ap.CFLAGS += -DUSE_GPS -DGPS_CONFIGURE -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B9600 ap.CFLAGS += -DGPS_CONFIGURE -DGPS_BAUD=38400 # -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c subsystems/navigation/nav_line.c ap.srcs += subsystems/navigation/nav_survey_rectangle.c diff --git a/conf/airframes/obsolete/xxx1.xml b/conf/airframes/obsolete/xxx1.xml index e92d2fa543..7c967182fa 100644 --- a/conf/airframes/obsolete/xxx1.xml +++ b/conf/airframes/obsolete/xxx1.xml @@ -234,21 +234,20 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_4 -DUSE_ADC_5 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 -DGPS_LED=2 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 -DGPS_LED=2 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED -DALT_KALMAN -DIR_360 +ap.CFLAGS += -DUSE_INFRARED -DALT_KALMAN -DIR_360 ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DH_CTL_RATE_LOOP -DAGR_CLIMB -DLOITER_TRIM ap.srcs += subsystems/nav.c fw_h_ctl.c fw_v_ctl.c -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += gyro.c subsystems/navigation/nav_line.c ap.srcs += subsystems/navigation/nav_survey_rectangle.c - # Hack to use the same tuning file than slayer1 ap.CFLAGS += -DUSE_GPIO ap.srcs += $(SRC_ARCH)/gpio.c diff --git a/conf/airframes/tiny_hitl.xml b/conf/airframes/tiny_hitl.xml index cdb99224b1..ac97fa1fc3 100644 --- a/conf/airframes/tiny_hitl.xml +++ b/conf/airframes/tiny_hitl.xml @@ -187,12 +187,12 @@ ap.srcs += inter_mcu.c ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 ap.srcs += $(SRC_ARCH)/adc_hw.c -ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 +ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 ap.CFLAGS += -DGPS_CONFIGURE -DGPS_BAUD=38400 ap.srcs += gps_ubx.c gps.c latlong.c -ap.CFLAGS += -DINFRARED +ap.CFLAGS += -DUSE_INFRARED ap.srcs += infrared.c estimator.c ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO diff --git a/conf/autopilot/sitl.makefile b/conf/autopilot/sitl.makefile index fe5ba96b29..d0d1f39582 100644 --- a/conf/autopilot/sitl.makefile +++ b/conf/autopilot/sitl.makefile @@ -1,5 +1,5 @@ sim.ARCHDIR = $(ARCH) -sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DINFRARED -DNAV -DLED -DWIND_INFO +sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO sim.srcs += latlong.c\ radio_control.c\ downlink.c\ diff --git a/conf/autopilot/sitl_jsbsim.makefile b/conf/autopilot/sitl_jsbsim.makefile index 9065bdead5..ea7153f87b 100644 --- a/conf/autopilot/sitl_jsbsim.makefile +++ b/conf/autopilot/sitl_jsbsim.makefile @@ -24,7 +24,7 @@ else jsbsim.LDFLAGS += -L$(JSBSIM_LIB) -lJSBSim endif -jsbsim.CFLAGS += -DSITL -DAP -DFBW -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DINFRARED -DNAV -DLED -DWIND_INFO -Ifirmwares/fixedwing +jsbsim.CFLAGS += -DSITL -DAP -DFBW -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport -DUSE_INFRARED -DNAV -DLED -DWIND_INFO -Ifirmwares/fixedwing jsbsim.srcs = $(SRC_ARCH)/jsbsim_hw.c $(SRC_ARCH)/jsbsim_gps.c $(SRC_ARCH)/jsbsim_ir.c $(SRC_ARCH)/jsbsim_transport.c $(SRC_ARCH)/ivy_transport.c jsbsim.srcs += latlong.c downlink.c commands.c gps.c inter_mcu.c infrared.c \ $(SRC_FIXEDWING)/stabilization/stabilization_attitude.c \ diff --git a/conf/autopilot/sitl_link_pprz.makefile b/conf/autopilot/sitl_link_pprz.makefile index 791f264ce1..41ba561388 100644 --- a/conf/autopilot/sitl_link_pprz.makefile +++ b/conf/autopilot/sitl_link_pprz.makefile @@ -1,3 +1,3 @@ sim.ARCHDIR = $(ARCH) -sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DINFRARED -DRADIO_CONTROL_SETTINGS -DSIM_UART -DDOWNLINK_AP_DEVICE=SimUart -DDOWNLINK_FBW_DEVICE=SimUart -DDATALINK=PPRZ +sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DUSE_INFRARED -DRADIO_CONTROL_SETTINGS -DSIM_UART -DDOWNLINK_AP_DEVICE=SimUart -DDOWNLINK_FBW_DEVICE=SimUart -DDATALINK=PPRZ sim.srcs = radio_control.c downlink.c pprz_transport.c commands.c gps.c inter_mcu.c infrared.c $(SRC_FIRMWARE)/stabilization/stabilization_attitude.c $(SRC_FIRMWARE)/guidance/guidance_v.c subsystems/nav.c estimator.c cam.c sys_time.c $(SRC_FIRMWARE)/main_fbw.c $(SRC_FIRMWARE)/main_ap.c rc_settings.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/sim_uart.c datalink.c diff --git a/conf/autopilot/sitl_link_xbee.makefile b/conf/autopilot/sitl_link_xbee.makefile index 162d1e60ef..ee5d37a179 100644 --- a/conf/autopilot/sitl_link_xbee.makefile +++ b/conf/autopilot/sitl_link_xbee.makefile @@ -1,3 +1,3 @@ sim.ARCHDIR = $(ARCH) -sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=XBeeTransport -DINFRARED -DRADIO_CONTROL_SETTINGS -DSIM_UART -DSIM_XBEE -DXBEE_UART=SimUart +sim.CFLAGS += -DSITL -DAP -DFBW -DRADIO_CONTROL -DINTER_MCU -DDOWNLINK -DDOWNLINK_TRANSPORT=XBeeTransport -DUSE_INFRARED -DRADIO_CONTROL_SETTINGS -DSIM_UART -DSIM_XBEE -DXBEE_UART=SimUart sim.srcs = radio_control.c downlink.c xbee.c commands.c gps.c inter_mcu.c infrared.c $(SRC_FIXEDWING)/stabilization/stabilization_attitude.c $(SRC_FIXEDWING)/guidance/guidance_v.c subsystems/nav.c estimator.c cam.c sys_time.c $(SRC_FIRMWARE)/main_fbw.c $(SRC_FIRMWARE)/main_ap.c rc_settings.c $(SRC_ARCH)/ppm_hw.c $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_ir.c $(SRC_ARCH)/sim_ap.c $(SRC_ARCH)/sim_uart.c diff --git a/conf/autopilot/subsystems/fixedwing/attitude_infrared.makefile b/conf/autopilot/subsystems/fixedwing/attitude_infrared.makefile index e1b366642a..cf762bf1ff 100644 --- a/conf/autopilot/subsystems/fixedwing/attitude_infrared.makefile +++ b/conf/autopilot/subsystems/fixedwing/attitude_infrared.makefile @@ -31,7 +31,7 @@ endif ap.CFLAGS += -DADC_CHANNEL_IR_NB_SAMPLES=$(ADC_IR_NB_SAMPLES) -$(TARGET).CFLAGS += -DINFRARED +$(TARGET).CFLAGS += -DUSE_INFRARED $(TARGET).srcs += $(SRC_FIXEDWING)/infrared.c sim.srcs += $(SRC_ARCH)/sim_ir.c diff --git a/conf/autopilot/subsystems/fixedwing/gps_ublox_lea4p.makefile b/conf/autopilot/subsystems/fixedwing/gps_ublox_lea4p.makefile index 1ed43507c7..d4fab5b815 100644 --- a/conf/autopilot/subsystems/fixedwing/gps_ublox_lea4p.makefile +++ b/conf/autopilot/subsystems/fixedwing/gps_ublox_lea4p.makefile @@ -1,7 +1,7 @@ # UBlox LEA 4P -ap.CFLAGS += -DGPS -DUBX +ap.CFLAGS += -DUSE_GPS -DUBX ap.CFLAGS += -DGPS_LINK=Uart$(GPS_UART_NR) ap.CFLAGS += -DUSE_UART$(GPS_UART_NR) ap.CFLAGS += -DUART$(GPS_UART_NR)_BAUD=$(GPS_BAUD) diff --git a/conf/autopilot/subsystems/fixedwing/gps_ublox_lea5h.makefile b/conf/autopilot/subsystems/fixedwing/gps_ublox_lea5h.makefile index 58c60f8ef6..27f46bc630 100644 --- a/conf/autopilot/subsystems/fixedwing/gps_ublox_lea5h.makefile +++ b/conf/autopilot/subsystems/fixedwing/gps_ublox_lea5h.makefile @@ -1,7 +1,7 @@ # UBlox LEA 5H -ap.CFLAGS += -DGPS -DUBX -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DGPS_USE_LATLONG ap.CFLAGS += -DGPS_LINK=Uart$(GPS_UART_NR) ap.CFLAGS += -DUSE_UART$(GPS_UART_NR) ap.CFLAGS += -DUART$(GPS_UART_NR)_BAUD=$(GPS_BAUD) diff --git a/conf/autopilot/subsystems/fixedwing/gps_ublox_lea5h_hitl.makefile b/conf/autopilot/subsystems/fixedwing/gps_ublox_lea5h_hitl.makefile index 5667e809cc..4cde327f95 100755 --- a/conf/autopilot/subsystems/fixedwing/gps_ublox_lea5h_hitl.makefile +++ b/conf/autopilot/subsystems/fixedwing/gps_ublox_lea5h_hitl.makefile @@ -1,6 +1,6 @@ # UBlox LEA 5H -ap.CFLAGS += -DGPS -DUBX -DGPS_USE_LATLONG +ap.CFLAGS += -DUSE_GPS -DUBX -DGPS_USE_LATLONG ap.srcs += $(SRC_FIXEDWING)/gps_ubx.c $(SRC_FIXEDWING)/gps.c $(SRC_FIXEDWING)/latlong.c diff --git a/conf/autopilot/subsystems/fixedwing/gyro_roll.makefile b/conf/autopilot/subsystems/fixedwing/gyro_roll.makefile index 50968fa0ed..9f4dc97352 100644 --- a/conf/autopilot/subsystems/fixedwing/gyro_roll.makefile +++ b/conf/autopilot/subsystems/fixedwing/gyro_roll.makefile @@ -11,5 +11,5 @@ ap.CFLAGS += -DADC_CHANNEL_GYRO_ROLL=$(ADC_GYRO_ROLL) -DUSE_$(ADC_GYRO_ROLL) ap.CFLAGS += -DADC_CHANNEL_GYRO_NB_SAMPLES=$(ADC_GYRO_NB_SAMPLES) -ap.CFLAGS += -DGYRO -DADXRS150 +ap.CFLAGS += -DUSE_GYRO -DADXRS150 ap.srcs += $(SRC_FIXEDWING)/gyro.c diff --git a/conf/autopilot/twin_mcu.makefile b/conf/autopilot/twin_mcu.makefile index 18dc9c0a93..690f741285 100644 --- a/conf/autopilot/twin_mcu.makefile +++ b/conf/autopilot/twin_mcu.makefile @@ -1,5 +1,5 @@ ap.srcs += $(SRC_FIRMWARE)/main_ap.c sys_time.c $(SRC_FIRMWARE)/main.c inter_mcu.c link_mcu.c gps_ubx.c gps.c infrared.c fw_h_ctl.c fw_v_ctl.c subsystems/nav.c estimator.c cam.c spi.c rc_settings.c latlong.c subsystems/navigation/nav_survey_rectangle.c -ap.CFLAGS += -DMCU_SPI_LINK -DGPS -DUBX -DINFRARED -DRADIO_CONTROL -DINTER_MCU -DSPI_MASTER -DUSE_SPI -DNAV -DRADIO_CONTROL_SETTINGS +ap.CFLAGS += -DMCU_SPI_LINK -DUSE_GPS -DUBX -DUSE_INFRARED -DRADIO_CONTROL -DINTER_MCU -DSPI_MASTER -DUSE_SPI -DNAV -DRADIO_CONTROL_SETTINGS fbw.srcs += sys_time.c $(SRC_FIRMWARE)/main_fbw.c $(SRC_FIRMWARE)/main.c commands.c radio_control.c pprz_transport.c downlink.c inter_mcu.c spi.c link_mcu.c fbw.CFLAGS += -DRADIO_CONTROL -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DINTER_MCU -DMCU_SPI_LINK -DUART0_BAUD=B38400 -DSPI_SLAVE -DUSE_SPI diff --git a/conf/flight_plans/demo_module.xml b/conf/flight_plans/demo_module.xml index 107abf5d45..66e7c7c131 100644 --- a/conf/flight_plans/demo_module.xml +++ b/conf/flight_plans/demo_module.xml @@ -2,7 +2,7 @@
-#include "modules.h" +#include "generated/modules.h"
diff --git a/conf/messages.xml b/conf/messages.xml index 1e13a74278..3a69a1fb30 100644 --- a/conf/messages.xml +++ b/conf/messages.xml @@ -1615,7 +1615,6 @@ - diff --git a/conf/modules/gps_i2c.xml b/conf/modules/gps_i2c.xml index aa8116495d..dabbd3176c 100644 --- a/conf/modules/gps_i2c.xml +++ b/conf/modules/gps_i2c.xml @@ -1,7 +1,7 @@ diff --git a/conf/simulator/nps/nps_sensors_params_booz2_a1.h b/conf/simulator/nps/nps_sensors_params_booz2_a1.h index db7b561ba6..89e9f07124 100644 --- a/conf/simulator/nps/nps_sensors_params_booz2_a1.h +++ b/conf/simulator/nps/nps_sensors_params_booz2_a1.h @@ -25,7 +25,7 @@ #ifndef NPS_SENSORS_PARAMS_H #define NPS_SENSORS_PARAMS_H -#include "airframe.h" +#include "generated/airframe.h" #if 1 #define NPS_BODY_TO_IMU_PHI IMU_BODY_TO_IMU_PHI diff --git a/conf/simulator/nps/nps_sensors_params_booz2_a1p.h b/conf/simulator/nps/nps_sensors_params_booz2_a1p.h index d78c10f695..6d5ca25dd1 100644 --- a/conf/simulator/nps/nps_sensors_params_booz2_a1p.h +++ b/conf/simulator/nps/nps_sensors_params_booz2_a1p.h @@ -25,7 +25,7 @@ #ifndef NPS_SENSORS_PARAMS_H #define NPS_SENSORS_PARAMS_H -#include "airframe.h" +#include "generated/airframe.h" #if 1 #define NPS_BODY_TO_IMU_PHI IMU_BODY_TO_IMU_PHI diff --git a/sw/airborne/3dmg.c b/sw/airborne/3dmg.c index 6715e86cf6..eaaa3c6917 100644 --- a/sw/airborne/3dmg.c +++ b/sw/airborne/3dmg.c @@ -22,7 +22,7 @@ * */ -#include "airframe.h" +#include "generated/airframe.h" #include "std.h" #include "3dmg.h" diff --git a/sw/airborne/Makefile b/sw/airborne/Makefile index 89d7df0b73..adb2189087 100644 --- a/sw/airborne/Makefile +++ b/sw/airborne/Makefile @@ -28,8 +28,6 @@ ACINCLUDE = $(PAPARAZZI_HOME)/var/$(AIRCRAFT) INCLUDES = -I $(PAPARAZZI_SRC)/sw/include -I $(PAPARAZZI_SRC)/sw/airborne -I $(PAPARAZZI_SRC)/conf/autopilot -I $(PAPARAZZI_SRC)/sw/airborne/arch/$($(TARGET).ARCHDIR) -I $(VARINCLUDE) -I $(ACINCLUDE) -# doesn't seem to be used/needed -#SRC_ARCH = $(PAPARAZZI_SRC)/sw/airborne/$(ARCHDIR) ifneq ($(MAKECMDGOALS),clean) include $(PAPARAZZI_HOME)/var/$(AIRCRAFT)/Makefile.ac @@ -49,9 +47,9 @@ $(TARGET).install : warn_conf warn_conf : @echo @echo '###########################################################' - @grep AIRFRAME_NAME $(ACINCLUDE)/airframe.h - @grep RADIO_NAME $(ACINCLUDE)/radio.h - @grep FLIGHT_PLAN_NAME $(ACINCLUDE)/flight_plan.h + @grep AIRFRAME_NAME $(ACINCLUDE)/generated/airframe.h + @grep RADIO_NAME $(ACINCLUDE)/generated/radio.h + @grep FLIGHT_PLAN_NAME $(ACINCLUDE)/generated/flight_plan.h @echo '###########################################################' @echo diff --git a/sw/airborne/agl_vfilter.c b/sw/airborne/agl_vfilter.c index e0573771e3..1d95b91e84 100644 --- a/sw/airborne/agl_vfilter.c +++ b/sw/airborne/agl_vfilter.c @@ -1,7 +1,7 @@ #include "agl_vfilter.h" #include BOARD_CONFIG -#include "airframe.h" +#include "generated/airframe.h" #include "std.h" /* diff --git a/sw/airborne/anemotaxis.c b/sw/airborne/anemotaxis.c index 139e8fba2a..562b02b7e1 100644 --- a/sw/airborne/anemotaxis.c +++ b/sw/airborne/anemotaxis.c @@ -1,9 +1,9 @@ #include "anemotaxis.h" -#include "airframe.h" +#include "generated/airframe.h" #include "estimator.h" #include "std.h" #include "subsystems/nav.h" -#include "flight_plan.h" +#include "generated/flight_plan.h" #include "ap_downlink.h" #include "chemo_detect.h" diff --git a/sw/airborne/ap_downlink.h b/sw/airborne/ap_downlink.h index b18ebc4eab..da90c9f3c6 100644 --- a/sw/airborne/ap_downlink.h +++ b/sw/airborne/ap_downlink.h @@ -37,15 +37,15 @@ #include -#include "airframe.h" +#include "generated/airframe.h" #define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE #include "downlink.h" #include "messages.h" -#include "periodic.h" +#include "generated/periodic.h" -//#include "modules.h" +//#include "generated/modules.h" #if defined DOWNLINK #define Downlink(x) x @@ -115,7 +115,7 @@ #define PERIODIC_SEND_SETTINGS(_chan) {} #endif -#if defined INFRARED || INFRARED_I2C +#if defined USE_INFRARED || USE_INFRARED_I2C #define PERIODIC_SEND_IR_SENSORS(_chan) DOWNLINK_SEND_IR_SENSORS(_chan, &ir_ir1, &ir_ir2, &ir_pitch, &ir_roll, &ir_top); #else #define PERIODIC_SEND_IR_SENSORS(_chan) ; @@ -167,7 +167,7 @@ #define PERIODIC_SEND_TUNE_ROLL(_chan) DOWNLINK_SEND_TUNE_ROLL(_chan, &estimator_p,&estimator_phi, &h_ctl_roll_setpoint); -#if defined GPS || defined SITL || defined USE_GPS_XSENS +#if defined USE_GPS || defined SITL || defined USE_GPS_XSENS #define PERIODIC_SEND_GPS_SOL(_chan) DOWNLINK_SEND_GPS_SOL(_chan, &gps_Pacc, &gps_Sacc, &gps_PDOP, &gps_numSV) #endif diff --git a/sw/airborne/arch/avr/servos_direct_hw.c b/sw/airborne/arch/avr/servos_direct_hw.c index 4e308d2eea..b29844f12d 100644 --- a/sw/airborne/arch/avr/servos_direct_hw.c +++ b/sw/airborne/arch/avr/servos_direct_hw.c @@ -7,7 +7,7 @@ #include "servos_direct_hw.h" #include "std.h" #include "actuators.h" -#include "airframe.h" +#include "generated/airframe.h" void actuators_init ( void ) { /* OC3A, OC3B, OC3C outputs */ diff --git a/sw/airborne/arch/lpc21/micromag_hw.h b/sw/airborne/arch/lpc21/micromag_hw.h index edbb7fdb36..ab43af16a8 100644 --- a/sw/airborne/arch/lpc21/micromag_hw.h +++ b/sw/airborne/arch/lpc21/micromag_hw.h @@ -10,7 +10,7 @@ #include "ssp_hw.h" #include BOARD_CONFIG -#include "airframe.h" +#include "generated/airframe.h" #define MM_DIVISOR_128 2 #define MM_DIVISOR_256 3 diff --git a/sw/airborne/arch/lpc21/modules/adcs/max11040_hw.h b/sw/airborne/arch/lpc21/modules/adcs/max11040_hw.h index 1fc96b72d3..76466f3946 100644 --- a/sw/airborne/arch/lpc21/modules/adcs/max11040_hw.h +++ b/sw/airborne/arch/lpc21/modules/adcs/max11040_hw.h @@ -6,7 +6,7 @@ #include "LPC21xx.h" #include "interrupt_hw.h" #include "ssp_hw.h" -#include "airframe.h" +#include "generated/airframe.h" #include BOARD_CONFIG diff --git a/sw/airborne/arch/lpc21/modules/sensors/mag_micromag_fw_hw.h b/sw/airborne/arch/lpc21/modules/sensors/mag_micromag_fw_hw.h index 5ab746fb06..9f9b38e6ae 100644 --- a/sw/airborne/arch/lpc21/modules/sensors/mag_micromag_fw_hw.h +++ b/sw/airborne/arch/lpc21/modules/sensors/mag_micromag_fw_hw.h @@ -10,7 +10,7 @@ #include "spi_hw.h" #include BOARD_CONFIG -#include "airframe.h" +#include "generated/airframe.h" #define MM_DIVISOR_128 2 #define MM_DIVISOR_256 3 diff --git a/sw/airborne/arch/lpc21/peripherals/ms2001_arch.h b/sw/airborne/arch/lpc21/peripherals/ms2001_arch.h index b6fd335e45..5e04b88317 100644 --- a/sw/airborne/arch/lpc21/peripherals/ms2001_arch.h +++ b/sw/airborne/arch/lpc21/peripherals/ms2001_arch.h @@ -10,7 +10,7 @@ #include "ssp_hw.h" #include BOARD_CONFIG -#include "airframe.h" +#include "generated/airframe.h" diff --git a/sw/airborne/arch/lpc21/servos_4015_MAT_hw.c b/sw/airborne/arch/lpc21/servos_4015_MAT_hw.c index a528f014c1..cf254ffc59 100644 --- a/sw/airborne/arch/lpc21/servos_4015_MAT_hw.c +++ b/sw/airborne/arch/lpc21/servos_4015_MAT_hw.c @@ -29,7 +29,7 @@ #include "actuators.h" #include "paparazzi.h" -#include "airframe.h" +#include "generated/airframe.h" uint8_t servos_4015_idx; uint32_t servos_delay = SERVO_REFRESH_TICS; diff --git a/sw/airborne/arch/lpc21/servos_4015_hw.c b/sw/airborne/arch/lpc21/servos_4015_hw.c index b52704f162..f36b5e358f 100644 --- a/sw/airborne/arch/lpc21/servos_4015_hw.c +++ b/sw/airborne/arch/lpc21/servos_4015_hw.c @@ -1,7 +1,7 @@ #include "actuators.h" #include "armVIC.h" -#include "airframe.h" +#include "generated/airframe.h" #include "sys_time.h" diff --git a/sw/airborne/arch/lpc21/servos_4015_hw_new.c b/sw/airborne/arch/lpc21/servos_4015_hw_new.c index 4dbd241838..7c25687e9a 100644 --- a/sw/airborne/arch/lpc21/servos_4015_hw_new.c +++ b/sw/airborne/arch/lpc21/servos_4015_hw_new.c @@ -1,7 +1,7 @@ #include "actuators.h" #include "armVIC.h" -#include "airframe.h" +#include "generated/airframe.h" #include "sys_time.h" diff --git a/sw/airborne/arch/lpc21/servos_4017_hw.c b/sw/airborne/arch/lpc21/servos_4017_hw.c index 01574e3437..72022c414e 100644 --- a/sw/airborne/arch/lpc21/servos_4017_hw.c +++ b/sw/airborne/arch/lpc21/servos_4017_hw.c @@ -1,7 +1,7 @@ #include "actuators.h" #include "paparazzi.h" -#include "airframe.h" +#include "generated/airframe.h" uint8_t servos_4017_idx; diff --git a/sw/airborne/arch/lpc21/servos_csc.h b/sw/airborne/arch/lpc21/servos_csc.h index 166ee9333b..f0842a2f2c 100644 --- a/sw/airborne/arch/lpc21/servos_csc.h +++ b/sw/airborne/arch/lpc21/servos_csc.h @@ -2,7 +2,7 @@ #define SERVOS_CSC_H #include "LPC21xx.h" -#include "airframe.h" +#include "generated/airframe.h" #include "actuators.h" #include "sys_time.h" diff --git a/sw/airborne/arch/lpc21/servos_ppm_hw.c b/sw/airborne/arch/lpc21/servos_ppm_hw.c index 5ed58e3460..6162f48f9f 100644 --- a/sw/airborne/arch/lpc21/servos_ppm_hw.c +++ b/sw/airborne/arch/lpc21/servos_ppm_hw.c @@ -28,7 +28,7 @@ */ #include "actuators.h" #include "paparazzi.h" -#include "airframe.h" +#include "generated/airframe.h" uint8_t servos_PPM_idx; uint8_t ppm_pulse; diff --git a/sw/airborne/arch/sim/jsbsim_gps.c b/sw/airborne/arch/sim/jsbsim_gps.c index cbd66cd49c..1df8a10cd9 100644 --- a/sw/airborne/arch/sim/jsbsim_gps.c +++ b/sw/airborne/arch/sim/jsbsim_gps.c @@ -5,8 +5,8 @@ #include /** From airborne/autopilot/ */ -#include "airframe.h" -#include "flight_plan.h" +#include "generated/airframe.h" +#include "generated/flight_plan.h" #include "autopilot.h" #include "gps.h" #include "estimator.h" diff --git a/sw/airborne/arch/sim/jsbsim_hw.h b/sw/airborne/arch/sim/jsbsim_hw.h index 6f1cbb89df..96cd553b47 100644 --- a/sw/airborne/arch/sim/jsbsim_hw.h +++ b/sw/airborne/arch/sim/jsbsim_hw.h @@ -34,9 +34,9 @@ #include "estimator.h" #include "gps.h" #include "subsystems/navigation/traffic_info.h" -#include "flight_plan.h" -#include "airframe.h" -#include "settings.h" +#include "generated/flight_plan.h" +#include "generated/airframe.h" +#include "generated/settings.h" #include "subsystems/nav.h" #include "firmwares/fixedwing/stabilization/stabilization_attitude.h" #include "firmwares/fixedwing/guidance/guidance_v.h" diff --git a/sw/airborne/arch/sim/jsbsim_ir.c b/sw/airborne/arch/sim/jsbsim_ir.c index cfa02235ab..c05b9a67d9 100644 --- a/sw/airborne/arch/sim/jsbsim_ir.c +++ b/sw/airborne/arch/sim/jsbsim_ir.c @@ -20,7 +20,7 @@ void set_ir(double roll, double pitch) { double ir_contrast = 150; //FIXME double roll_sensor = roll + JSBSIM_IR_ROLL_NEUTRAL; // ir_roll_neutral; double pitch_sensor = pitch + JSBSIM_IR_PITCH_NEUTRAL; // ir_pitch_neutral; -#ifdef INFRARED +#ifdef USE_INFRARED ir_roll = sin(roll_sensor) * ir_contrast; ir_pitch = sin(pitch_sensor) * ir_contrast; ir_top = cos(roll_sensor) * cos(pitch_sensor) * ir_contrast; diff --git a/sw/airborne/arch/sim/sim_ap.c b/sw/airborne/arch/sim/sim_ap.c index 9d1e748fdb..d1beea54bf 100644 --- a/sw/airborne/arch/sim/sim_ap.c +++ b/sw/airborne/arch/sim/sim_ap.c @@ -13,8 +13,8 @@ #include "estimator.h" #include "gps.h" #include "subsystems/navigation/traffic_info.h" -#include "flight_plan.h" -#include "settings.h" +#include "generated/flight_plan.h" +#include "generated/settings.h" #include "subsystems/nav.h" #include "firmwares/fixedwing/stabilization/stabilization_attitude.h" #include "firmwares/fixedwing/guidance/guidance_v.h" diff --git a/sw/airborne/arch/sim/sim_gps.c b/sw/airborne/arch/sim/sim_gps.c index bacaf4c190..6bfe4c9058 100644 --- a/sw/airborne/arch/sim/sim_gps.c +++ b/sw/airborne/arch/sim/sim_gps.c @@ -5,8 +5,8 @@ #include /** From airborne/autopilot/ */ -#include "airframe.h" -#include "flight_plan.h" +#include "generated/airframe.h" +#include "generated/flight_plan.h" #include "autopilot.h" #include "gps.h" #include "estimator.h" diff --git a/sw/airborne/arch/sim/sim_ir.c b/sw/airborne/arch/sim/sim_ir.c index 5005294a94..ffc1cac2e5 100644 --- a/sw/airborne/arch/sim/sim_ir.c +++ b/sw/airborne/arch/sim/sim_ir.c @@ -7,7 +7,7 @@ #include #include "infrared.h" -#include "airframe.h" +#include "generated/airframe.h" #include @@ -21,7 +21,7 @@ value set_ir(value roll __attribute__ ((unused)), value top __attribute__ ((unused)), value air_speed ) { -#if defined INFRARED || INFRARED_I2C +#if defined USE_INFRARED || USE_INFRARED_I2C ir_roll = Int_val(roll); ir_pitch = Int_val(front); ir_top = Int_val(top); diff --git a/sw/airborne/arch/sim/sim_jsbsim.c b/sw/airborne/arch/sim/sim_jsbsim.c index 5601be836e..963f750d0c 100644 --- a/sw/airborne/arch/sim/sim_jsbsim.c +++ b/sw/airborne/arch/sim/sim_jsbsim.c @@ -13,8 +13,8 @@ #include "estimator.h" #include "gps.h" #include "subsystems/navigation/traffic_info.h" -#include "flight_plan.h" -#include "settings.h" +#include "generated/flight_plan.h" +#include "generated/settings.h" #include "subsystems/nav.h" #include "firmwares/fixedwing/stabilization/stabilization_attitude.h" #include "ffirmwares/fixedwing/guidance/guidance_v.h" diff --git a/sw/airborne/arch/sim/subsystems/imu/imu_b2_arch.c b/sw/airborne/arch/sim/subsystems/imu/imu_b2_arch.c index 2da7089a8a..f583072488 100644 --- a/sw/airborne/arch/sim/subsystems/imu/imu_b2_arch.c +++ b/sw/airborne/arch/sim/subsystems/imu/imu_b2_arch.c @@ -23,7 +23,7 @@ #include "subsystems/imu.h" -#include "airframe.h" +#include "generated/airframe.h" void imu_b2_arch_init(void) { diff --git a/sw/airborne/arch/sim/subsystems/imu/imu_crista_arch.c b/sw/airborne/arch/sim/subsystems/imu/imu_crista_arch.c index 6adb6271f2..ee07d78462 100644 --- a/sw/airborne/arch/sim/subsystems/imu/imu_crista_arch.c +++ b/sw/airborne/arch/sim/subsystems/imu/imu_crista_arch.c @@ -4,7 +4,7 @@ #include "subsystems/imu.h" -#include "airframe.h" +#include "generated/airframe.h" void imu_crista_arch_init(void) { diff --git a/sw/airborne/boards/booz/baro_board.c b/sw/airborne/boards/booz/baro_board.c index 84bb346c0f..cc92db4224 100644 --- a/sw/airborne/boards/booz/baro_board.c +++ b/sw/airborne/boards/booz/baro_board.c @@ -23,7 +23,7 @@ #include "firmwares/rotorcraft/baro.h" -#include "airframe.h" +#include "generated/airframe.h" #include "led.h" /* threshold >0 && <1023 */ diff --git a/sw/airborne/booz/booz2_commands.h b/sw/airborne/booz/booz2_commands.h index fdc574a3aa..1681eb298b 100644 --- a/sw/airborne/booz/booz2_commands.h +++ b/sw/airborne/booz/booz2_commands.h @@ -25,7 +25,7 @@ #define BOOZ2_COMMANDS_H #include "paparazzi.h" -#include "airframe.h" +#include "generated/airframe.h" extern int32_t booz2_commands[COMMANDS_NB]; extern const int32_t booz2_commands_failsafe[COMMANDS_NB]; diff --git a/sw/airborne/booz/booz2_datalink.c b/sw/airborne/booz/booz2_datalink.c index c567bcff52..2fae20a594 100644 --- a/sw/airborne/booz/booz2_datalink.c +++ b/sw/airborne/booz/booz2_datalink.c @@ -26,9 +26,9 @@ #include "datalink.h" -#include "modules.h" +#include "generated/modules.h" -#include "settings.h" +#include "generated/settings.h" #include "downlink.h" #include "messages.h" #include "dl_protocol.h" diff --git a/sw/airborne/booz/booz_gps.h b/sw/airborne/booz/booz_gps.h index 4839ecaf3a..addeb62043 100644 --- a/sw/airborne/booz/booz_gps.h +++ b/sw/airborne/booz/booz_gps.h @@ -74,7 +74,7 @@ extern bool_t booz_gps_available; #define GPS_LINKChAvailable() (FALSE) #define GPS_LINKGetch() (TRUE) #include "nps_sensors.h" -#include "flight_plan.h" +#include "generated/flight_plan.h" static inline void booz_gps_feed_value() { booz_gps_state.ecef_pos.x = sensors.gps.ecef_pos.x * 100.; diff --git a/sw/airborne/chemotaxis.c b/sw/airborne/chemotaxis.c index 39219fcee6..6bc9514c92 100644 --- a/sw/airborne/chemotaxis.c +++ b/sw/airborne/chemotaxis.c @@ -1,9 +1,9 @@ #include "chemotaxis.h" -#include "airframe.h" +#include "generated/airframe.h" #include "estimator.h" #include "std.h" #include "subsystems/nav.h" -#include "flight_plan.h" +#include "generated/flight_plan.h" #include "ap_downlink.h" #include "chemo_detect.h" diff --git a/sw/airborne/commands.h b/sw/airborne/commands.h index 7618ac6caa..a824de01c9 100644 --- a/sw/airborne/commands.h +++ b/sw/airborne/commands.h @@ -30,7 +30,7 @@ #define COMMANDS_H #include "paparazzi.h" -#include "airframe.h" +#include "generated/airframe.h" extern pprz_t commands[COMMANDS_NB]; diff --git a/sw/airborne/csc/arm7/buss_twi_blmc_hw.h b/sw/airborne/csc/arm7/buss_twi_blmc_hw.h index f92766294a..1b7c3d8282 100644 --- a/sw/airborne/csc/arm7/buss_twi_blmc_hw.h +++ b/sw/airborne/csc/arm7/buss_twi_blmc_hw.h @@ -5,7 +5,7 @@ #include "std.h" #include "i2c.h" -#include "airframe.h" +#include "generated/airframe.h" #define BUSS_TWI_BLMC_STATUS_IDLE 0 #define BUSS_TWI_BLMC_STATUS_BUSY 1 diff --git a/sw/airborne/csc/arm7/props_csc.c b/sw/airborne/csc/arm7/props_csc.c index 6666ec7adc..38263555c7 100644 --- a/sw/airborne/csc/arm7/props_csc.c +++ b/sw/airborne/csc/arm7/props_csc.c @@ -1,5 +1,5 @@ #include "props_csc.h" -#include "airframe.h" +#include "generated/airframe.h" #include "csc_ap_link.h" #include "csc_msg_def.h" diff --git a/sw/airborne/csc/arm7/props_csc.h b/sw/airborne/csc/arm7/props_csc.h index 6e32079f10..3fafdef242 100644 --- a/sw/airborne/csc/arm7/props_csc.h +++ b/sw/airborne/csc/arm7/props_csc.h @@ -1,7 +1,7 @@ #ifndef PROPS_CSC_H #define PROPS_CSC_H -#include "airframe.h" +#include "generated/airframe.h" #include "firmwares/rotorcraft/actuators.h" #include "sys_time.h" #include "csc_ap_link.h" diff --git a/sw/airborne/csc/csc_ap_main.c b/sw/airborne/csc/csc_ap_main.c index 6ad125ded3..55273d6d65 100644 --- a/sw/airborne/csc/csc_ap_main.c +++ b/sw/airborne/csc/csc_ap_main.c @@ -34,8 +34,8 @@ #include "interrupt_hw.h" #include "uart.h" #include "downlink.h" -#include "periodic.h" -#include "airframe.h" +#include "generated/periodic.h" +#include "generated/airframe.h" #include "commands.h" #include "subsystems/radio_control.h" #include "booz/booz2_gps.h" diff --git a/sw/airborne/csc/csc_baro.c b/sw/airborne/csc/csc_baro.c old mode 100755 new mode 100644 diff --git a/sw/airborne/csc/csc_baro.h b/sw/airborne/csc/csc_baro.h old mode 100755 new mode 100644 diff --git a/sw/airborne/csc/csc_datalink.c b/sw/airborne/csc/csc_datalink.c index d4fd108bcd..04362db411 100644 --- a/sw/airborne/csc/csc_datalink.c +++ b/sw/airborne/csc/csc_datalink.c @@ -1,7 +1,7 @@ #define DATALINK_C #include "datalink.h" -#include "settings.h" +#include "generated/settings.h" #include "downlink.h" #include "messages.h" #include "dl_protocol.h" diff --git a/sw/airborne/csc/csc_main.c b/sw/airborne/csc/csc_main.c index 3036b32c27..1bae760ee7 100644 --- a/sw/airborne/csc/csc_main.c +++ b/sw/airborne/csc/csc_main.c @@ -34,7 +34,7 @@ #include "interrupt_hw.h" #include "uart.h" #include "csc_telemetry.h" -#include "periodic.h" +#include "generated/periodic.h" #include "downlink.h" #include "i2c.h" diff --git a/sw/airborne/csc/csc_servos.c b/sw/airborne/csc/csc_servos.c index bbe4c3cd2a..1c26a5c95d 100644 --- a/sw/airborne/csc/csc_servos.c +++ b/sw/airborne/csc/csc_servos.c @@ -4,7 +4,7 @@ #include "std.h" #include "sys_time.h" #include "firmwares/rotorcraft/actuators.h" -#include "airframe.h" +#include "generated/airframe.h" #include ACTUATORS #define CSC_SERVOS_NB 4 diff --git a/sw/airborne/csc/csc_telemetry.h b/sw/airborne/csc/csc_telemetry.h index c0b6f987cf..592c0754fd 100644 --- a/sw/airborne/csc/csc_telemetry.h +++ b/sw/airborne/csc/csc_telemetry.h @@ -31,7 +31,7 @@ extern uint8_t telemetry_mode_Ap_DefaultChannel; #include "downlink.h" -#include "settings.h" +#include "generated/settings.h" #define PERIODIC_SEND_DL_VALUE(_chan) PeriodicSendDlValue(_chan) diff --git a/sw/airborne/csc/mercury_ap.h b/sw/airborne/csc/mercury_ap.h index 324fbb5025..de0ef82d3d 100644 --- a/sw/airborne/csc/mercury_ap.h +++ b/sw/airborne/csc/mercury_ap.h @@ -25,7 +25,7 @@ #ifndef __MERCURY_AP_H__ #define __MERCURY_AP_H__ -#include "airframe.h" +#include "generated/airframe.h" extern pprz_t mixed_commands[PROPS_NB]; extern uint8_t props_enable[PROPS_NB]; diff --git a/sw/airborne/csc/mercury_csc_main.c b/sw/airborne/csc/mercury_csc_main.c index ea1fcd70bb..18f81b3197 100644 --- a/sw/airborne/csc/mercury_csc_main.c +++ b/sw/airborne/csc/mercury_csc_main.c @@ -50,7 +50,7 @@ #include "uart.h" #include "csc_telemetry.h" -#include "periodic.h" +#include "generated/periodic.h" #include "downlink.h" #include "pwm_input.h" diff --git a/sw/airborne/csc/mercury_main.c b/sw/airborne/csc/mercury_main.c index 8325a4c81f..637b5bf7c7 100644 --- a/sw/airborne/csc/mercury_main.c +++ b/sw/airborne/csc/mercury_main.c @@ -34,8 +34,8 @@ #include "interrupt_hw.h" #include "uart.h" #include "downlink.h" -#include "periodic.h" -#include "airframe.h" +#include "generated/periodic.h" +#include "generated/airframe.h" #include "commands.h" #include "csc_msg_def.h" diff --git a/sw/airborne/csc/mercury_supervision.h b/sw/airborne/csc/mercury_supervision.h index e4f86babd9..abb4691514 100644 --- a/sw/airborne/csc/mercury_supervision.h +++ b/sw/airborne/csc/mercury_supervision.h @@ -1,7 +1,7 @@ #ifndef BOOZ2_SUPERVISION_H #define BOOZ2_SUPERVISION_H -#include "airframe.h" +#include "generated/airframe.h" extern pprz_t mercury_supervision_yaw_servo_gain; extern pprz_t mercury_supervision_pitch_servo_gain; diff --git a/sw/airborne/csc/ppm_bridge_main.c b/sw/airborne/csc/ppm_bridge_main.c index 01e829a75b..b2e1bcff8a 100644 --- a/sw/airborne/csc/ppm_bridge_main.c +++ b/sw/airborne/csc/ppm_bridge_main.c @@ -34,8 +34,8 @@ #include "interrupt_hw.h" #include "uart.h" #include "downlink.h" -#include "periodic.h" -#include "airframe.h" +#include "generated/periodic.h" +#include "generated/airframe.h" #include "commands.h" #include "subsystems/radio_control.h" diff --git a/sw/airborne/datalink.c b/sw/airborne/datalink.c index 67fe01fa25..ef990bfc77 100644 --- a/sw/airborne/datalink.c +++ b/sw/airborne/datalink.c @@ -33,7 +33,7 @@ #include #include "datalink.h" -#include "modules.h" +#include "generated/modules.h" #ifdef TRAFFIC_INFO #include "subsystems/navigation/traffic_info.h" @@ -53,7 +53,7 @@ #include "subsystems/navigation/common_nav.h" -#include "settings.h" +#include "generated/settings.h" #include "latlong.h" diff --git a/sw/airborne/downlink.h b/sw/airborne/downlink.h index 553bc84691..17052669ed 100644 --- a/sw/airborne/downlink.h +++ b/sw/airborne/downlink.h @@ -32,9 +32,9 @@ #include -#include "modules.h" +#include "generated/modules.h" #include "messages.h" -#include "airframe.h" // AC_ID is required +#include "generated/airframe.h" // AC_ID is required #if defined SITL diff --git a/sw/airborne/fbw_downlink.h b/sw/airborne/fbw_downlink.h index 1de2e23513..d4280f8e4d 100644 --- a/sw/airborne/fbw_downlink.h +++ b/sw/airborne/fbw_downlink.h @@ -37,8 +37,8 @@ #include #include "messages.h" -#include "periodic.h" -#include "airframe.h" +#include "generated/periodic.h" +#include "generated/airframe.h" #include "commands.h" #include "actuators.h" diff --git a/sw/airborne/firmwares/beth/gps_c.patch b/sw/airborne/firmwares/beth/gps_c.patch index fafa1a52d5..8fcbf9d486 100644 --- a/sw/airborne/firmwares/beth/gps_c.patch +++ b/sw/airborne/firmwares/beth/gps_c.patch @@ -7,8 +7,8 @@ +#ifndef FMS_PERIODIC_FREQ #include "sys_time.h" +#endif - #include "airframe.h" - #include "periodic.h" + #include "generated/airframe.h" + #include "generated/periodic.h" @@ -46,8 +48,15 @@ #endif diff --git a/sw/airborne/firmwares/beth/main_overo.c b/sw/airborne/firmwares/beth/main_overo.c index 82758ef092..6a52bc090a 100644 --- a/sw/airborne/firmwares/beth/main_overo.c +++ b/sw/airborne/firmwares/beth/main_overo.c @@ -31,7 +31,7 @@ #include #include "messages2.h" -#include "airframe.h" +#include "generated/airframe.h" #include "fms_periodic.h" #include "fms_debug.h" diff --git a/sw/airborne/firmwares/beth/overo_gcs_com.c b/sw/airborne/firmwares/beth/overo_gcs_com.c index 854a778db5..edd87f0fca 100644 --- a/sw/airborne/firmwares/beth/overo_gcs_com.c +++ b/sw/airborne/firmwares/beth/overo_gcs_com.c @@ -7,7 +7,7 @@ #include "messages2.h" #include "udp_transport2.h" #include "dl_protocol.h" -#include "settings.h" +#include "generated/settings.h" //bill laptop //#define GCS_HOST "10.31.4.5" diff --git a/sw/airborne/firmwares/beth/overo_test_uart.c b/sw/airborne/firmwares/beth/overo_test_uart.c index b3c78bbdc2..4b9b584a2a 100644 --- a/sw/airborne/firmwares/beth/overo_test_uart.c +++ b/sw/airborne/firmwares/beth/overo_test_uart.c @@ -35,7 +35,7 @@ #include "messages2.h" //#include "dl_protocol2.h" -#include "airframe.h" +#include "generated/airframe.h" #include "fms_periodic.h" #include "fms_debug.h" diff --git a/sw/airborne/firmwares/beth/rcv_telemetry.c b/sw/airborne/firmwares/beth/rcv_telemetry.c index 23f41b531a..904932f7de 100755 --- a/sw/airborne/firmwares/beth/rcv_telemetry.c +++ b/sw/airborne/firmwares/beth/rcv_telemetry.c @@ -33,11 +33,11 @@ #include #include "datalink.h" -#include "modules.h" +#include "generated/modules.h" #include #include "subsystems/navigation/common_nav.h" -#include "settings.h" +#include "generated/settings.h" #include "latlong.h" diff --git a/sw/airborne/firmwares/fixedwing/actuators.h b/sw/airborne/firmwares/fixedwing/actuators.h index 9485d8191a..50b8069d58 100644 --- a/sw/airborne/firmwares/fixedwing/actuators.h +++ b/sw/airborne/firmwares/fixedwing/actuators.h @@ -33,7 +33,7 @@ #include "paparazzi.h" /** Defines SetActuatorsFromCommands() macro */ -#include "airframe.h" +#include "generated/airframe.h" /** Must be defined by specific hardware implementation */ extern void actuators_init( void ); diff --git a/sw/airborne/firmwares/fixedwing/autopilot.h b/sw/airborne/firmwares/fixedwing/autopilot.h index 204146f373..a506f6a29e 100644 --- a/sw/airborne/firmwares/fixedwing/autopilot.h +++ b/sw/airborne/firmwares/fixedwing/autopilot.h @@ -116,7 +116,7 @@ extern bool_t power_switch; /* For backward compatibility with old airframe files */ -#include "airframe.h" +#include "generated/airframe.h" #ifndef CONTROL_RATE #define CONTROL_RATE 20 #endif diff --git a/sw/airborne/firmwares/fixedwing/guidance/guidance_v.c b/sw/airborne/firmwares/fixedwing/guidance/guidance_v.c index 0823cc0910..6d27c606a0 100644 --- a/sw/airborne/firmwares/fixedwing/guidance/guidance_v.c +++ b/sw/airborne/firmwares/fixedwing/guidance/guidance_v.c @@ -31,7 +31,7 @@ #include "firmwares/fixedwing/guidance/guidance_v.h" #include "estimator.h" #include "subsystems/nav.h" -#include "airframe.h" +#include "generated/airframe.h" #include "firmwares/fixedwing/autopilot.h" /* mode */ diff --git a/sw/airborne/firmwares/fixedwing/guidance/guidance_v_n.c b/sw/airborne/firmwares/fixedwing/guidance/guidance_v_n.c index 74dddfa954..247fd9cd34 100644 --- a/sw/airborne/firmwares/fixedwing/guidance/guidance_v_n.c +++ b/sw/airborne/firmwares/fixedwing/guidance/guidance_v_n.c @@ -32,7 +32,7 @@ #include "firmwares/fixedwing/guidance/guidance_v_n.h" #include "estimator.h" #include "subsystems/nav.h" -#include "airframe.h" +#include "generated/airframe.h" #include "autopilot.h" /* mode */ diff --git a/sw/airborne/firmwares/fixedwing/main_ap.c b/sw/airborne/firmwares/fixedwing/main_ap.c index 993bb30718..60f214351b 100644 --- a/sw/airborne/firmwares/fixedwing/main_ap.c +++ b/sw/airborne/firmwares/fixedwing/main_ap.c @@ -47,10 +47,10 @@ #include "subsystems/nav.h" #include "autopilot.h" #include "estimator.h" -#include "settings.h" +#include "generated/settings.h" #include "link_mcu.h" #include "sys_time.h" -#include "flight_plan.h" +#include "generated/flight_plan.h" #include "datalink.h" #include "xbee.h" @@ -87,7 +87,7 @@ #define LOW_BATTERY_DECIVOLT (CATASTROPHIC_BAT_LEVEL*10) -#include "modules.h" +#include "generated/modules.h" /** FIXME: should be in rc_settings but required by telemetry (ap_downlink.h)*/ uint8_t rc_settings_mode = 0; @@ -451,14 +451,14 @@ void periodic_task_ap( void ) { #endif { -#if defined GYRO +#ifdef USE_GYRO gyro_update(); #endif -#ifdef INFRARED +#ifdef USE_INFRARED ir_update(); estimator_update_state_infrared(); -#endif /* INFRARED */ +#endif /* USE_INFRARED */ h_ctl_attitude_loop(); /* Set h_ctl_aileron_setpoint & h_ctl_elevator_setpoint */ v_ctl_throttle_slew(); ap_state->commands[COMMAND_THROTTLE] = v_ctl_throttle_slewed; @@ -493,13 +493,13 @@ void init_ap( void ) { #endif /* SINGLE_MCU */ /************* Sensors initialization ***************/ -#ifdef INFRARED +#ifdef USE_INFRARED ir_init(); #endif -#ifdef GYRO +#ifdef USE_GYRO gyro_init(); #endif -#ifdef GPS +#ifdef USE_GPS gps_init(); #endif #ifdef USE_UART0 @@ -590,7 +590,7 @@ void init_ap( void ) { /*********** EVENT ***********************************************************/ void event_task_ap( void ) { -#ifdef GPS +#ifdef USE_GPS #if !(defined HITL) && !(defined UBX_EXTERNAL) /** else comes through the datalink */ if (GpsBuffer()) { ReadGpsBuffer(); @@ -617,7 +617,7 @@ void event_task_ap( void ) { gps_pos_available = FALSE; } } -#endif /** GPS */ +#endif /** USE_GPS */ #if defined DATALINK diff --git a/sw/airborne/firmwares/fixedwing/main_fbw.c b/sw/airborne/firmwares/fixedwing/main_fbw.c index 4528638f9c..d3954ce44d 100644 --- a/sw/airborne/firmwares/fixedwing/main_fbw.c +++ b/sw/airborne/firmwares/fixedwing/main_fbw.c @@ -32,7 +32,7 @@ */ #include "firmwares/fixedwing/main_fbw.h" -#include "airframe.h" +#include "generated/airframe.h" #include "init_hw.h" #include "interrupt_hw.h" diff --git a/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.c b/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.c index 8a02a919d2..8344339847 100644 --- a/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.c +++ b/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.c @@ -34,7 +34,7 @@ #include "firmwares/fixedwing/stabilization/stabilization_adaptive.h" #include "estimator.h" #include "subsystems/nav.h" -#include "airframe.h" +#include "generated/airframe.h" #include "firmwares/fixedwing/guidance/guidance_v.h" #include "autopilot.h" diff --git a/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.h b/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.h index c4915364cd..eb084c9811 100644 --- a/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.h +++ b/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.h @@ -34,7 +34,7 @@ #include #include "std.h" #include "paparazzi.h" -#include "airframe.h" +#include "generated/airframe.h" extern float h_ctl_roll_sum_err; extern float h_ctl_pitch_sum_err; diff --git a/sw/airborne/firmwares/fixedwing/stabilization/stabilization_attitude.c b/sw/airborne/firmwares/fixedwing/stabilization/stabilization_attitude.c index 900b422c25..d779ed7cf5 100644 --- a/sw/airborne/firmwares/fixedwing/stabilization/stabilization_attitude.c +++ b/sw/airborne/firmwares/fixedwing/stabilization/stabilization_attitude.c @@ -33,7 +33,7 @@ #include "led.h" #include "estimator.h" #include "subsystems/nav.h" -#include "airframe.h" +#include "generated/airframe.h" #include "firmwares/fixedwing/guidance/guidance_v.h" #include "firmwares/fixedwing/autopilot.h" diff --git a/sw/airborne/firmwares/fixedwing/stabilization/stabilization_attitude.h b/sw/airborne/firmwares/fixedwing/stabilization/stabilization_attitude.h index 59850f5a06..0c68e7bd64 100644 --- a/sw/airborne/firmwares/fixedwing/stabilization/stabilization_attitude.h +++ b/sw/airborne/firmwares/fixedwing/stabilization/stabilization_attitude.h @@ -34,7 +34,7 @@ #include #include "std.h" #include "paparazzi.h" -#include "airframe.h" +#include "generated/airframe.h" /* outer loop parameters */ extern float h_ctl_course_setpoint; /* rad, CW/north */ diff --git a/sw/airborne/firmwares/motor_bench/main_motor_bench.c b/sw/airborne/firmwares/motor_bench/main_motor_bench.c index 2e274a1a9d..152fc6f1d3 100644 --- a/sw/airborne/firmwares/motor_bench/main_motor_bench.c +++ b/sw/airborne/firmwares/motor_bench/main_motor_bench.c @@ -17,7 +17,7 @@ #include "messages.h" #include "downlink.h" -#include "settings.h" +#include "generated/settings.h" #include "adc.h" diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_heli.c b/sw/airborne/firmwares/rotorcraft/actuators/actuators_heli.c index f3b6ccc1a7..59b3f9538e 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_heli.c +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_heli.c @@ -29,7 +29,7 @@ #include "firmwares/rotorcraft/actuators/actuators_pwm.h" /* get SetActuatorsFromCommands() macro */ -#include "airframe.h" +#include "generated/airframe.h" /* define the glue between control and SetActuatorsFromCommands */ #define actuators actuators_pwm_values diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.h b/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.h index 409cd83c44..8b6d821098 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.h +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.h @@ -27,7 +27,7 @@ #include "std.h" #include "i2c.h" -#include "airframe.h" +#include "generated/airframe.h" struct ActuatorsMkk { diff --git a/sw/airborne/firmwares/rotorcraft/actuators/supervision.h b/sw/airborne/firmwares/rotorcraft/actuators/supervision.h index 7c48609d3f..e8aa343c0b 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/supervision.h +++ b/sw/airborne/firmwares/rotorcraft/actuators/supervision.h @@ -2,7 +2,7 @@ #define SUPERVISION_H #include "std.h" -#include "airframe.h" +#include "generated/airframe.h" struct Supervision { int32_t commands[SUPERVISION_NB_MOTOR]; diff --git a/sw/airborne/firmwares/rotorcraft/autopilot.h b/sw/airborne/firmwares/rotorcraft/autopilot.h index cb8698ff30..10defb26d0 100644 --- a/sw/airborne/firmwares/rotorcraft/autopilot.h +++ b/sw/airborne/firmwares/rotorcraft/autopilot.h @@ -29,7 +29,7 @@ #include "led.h" -#include "airframe.h" +#include "generated/airframe.h" #include "subsystems/ins.h" #define AP_MODE_FAILSAFE 0 diff --git a/sw/airborne/firmwares/rotorcraft/battery.h b/sw/airborne/firmwares/rotorcraft/battery.h index b53a4796d3..41aa171692 100644 --- a/sw/airborne/firmwares/rotorcraft/battery.h +++ b/sw/airborne/firmwares/rotorcraft/battery.h @@ -26,7 +26,7 @@ #include "std.h" -#include "airframe.h" +#include "generated/airframe.h" /* decivolts */ extern uint8_t battery_voltage; diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c index d2ff49ef0b..2471d0f3a9 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c @@ -31,7 +31,7 @@ #include "subsystems/ins.h" #include "firmwares/rotorcraft/navigation.h" -#include "airframe.h" +#include "generated/airframe.h" uint8_t guidance_h_mode; diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h_ref.h b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h_ref.h index 6861767740..1536d9c76b 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h_ref.h +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h_ref.h @@ -24,7 +24,7 @@ #ifndef GUIDANCE_H_REF_H #define GUIDANCE_H_REF_H -#include "airframe.h" +#include "generated/airframe.h" #include "inttypes.h" #include "math/pprz_algebra.h" #include "math/pprz_algebra_int.h" diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c index dc4a659cf5..dff5047344 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c @@ -35,7 +35,7 @@ #include "subsystems/ins.h" #include "math/pprz_algebra_int.h" -#include "airframe.h" +#include "generated/airframe.h" uint8_t guidance_v_mode; int32_t guidance_v_ff_cmd; diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_ref.h b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_ref.h index bcdd473413..1b676645c1 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_ref.h +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_ref.h @@ -24,7 +24,7 @@ #ifndef GUIDANCE_V_REF_H #define GUIDANCE_V_REF_H -#include "airframe.h" +#include "generated/airframe.h" #include "inttypes.h" #include "math/pprz_algebra.h" #include "math/pprz_algebra_int.h" diff --git a/sw/airborne/firmwares/rotorcraft/main.c b/sw/airborne/firmwares/rotorcraft/main.c index a9cdf00dde..5f6cd5485d 100644 --- a/sw/airborne/firmwares/rotorcraft/main.c +++ b/sw/airborne/firmwares/rotorcraft/main.c @@ -65,7 +65,7 @@ #include "nps_autopilot_booz.h" #endif -#include "modules.h" +#include "generated/modules.h" static inline void on_gyro_accel_event( void ); static inline void on_baro_abs_event( void ); diff --git a/sw/airborne/firmwares/rotorcraft/navigation.c b/sw/airborne/firmwares/rotorcraft/navigation.c index 84f634ffd5..b742b5da7a 100644 --- a/sw/airborne/firmwares/rotorcraft/navigation.c +++ b/sw/airborne/firmwares/rotorcraft/navigation.c @@ -30,8 +30,8 @@ #include "subsystems/ins.h" #include "firmwares/rotorcraft/autopilot.h" -#include "modules.h" -#include "flight_plan.h" +#include "generated/modules.h" +#include "generated/flight_plan.h" #include "math/pprz_algebra_int.h" diff --git a/sw/airborne/firmwares/rotorcraft/stabilization.h b/sw/airborne/firmwares/rotorcraft/stabilization.h index 5510e02227..b3c2d2d268 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization.h +++ b/sw/airborne/firmwares/rotorcraft/stabilization.h @@ -26,7 +26,7 @@ #include "std.h" -#include "airframe.h" +#include "generated/airframe.h" #include "firmwares/rotorcraft/stabilization/stabilization_rate.h" #include "firmwares/rotorcraft/stabilization/stabilization_attitude.h" diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_euler_float.c b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_euler_float.c index f9b4de4465..daf738ed93 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_euler_float.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_euler_float.c @@ -27,7 +27,7 @@ #include "subsystems/ahrs.h" #include "subsystems/radio_control.h" -#include "airframe.h" +#include "generated/airframe.h" struct FloatAttitudeGains stabilization_gains; diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_euler_int.c b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_euler_int.c index 8a853551d8..6131aebae6 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_euler_int.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_euler_int.c @@ -27,7 +27,7 @@ -#include "airframe.h" +#include "generated/airframe.h" struct Int32AttitudeGains stabilization_gains; diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_float.h b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_float.h index fe8cb92a89..0c78592ae3 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_float.h +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_float.h @@ -26,7 +26,7 @@ #include "math/pprz_algebra_float.h" -#include "airframe.h" +#include "generated/airframe.h" struct FloatAttitudeGains { struct FloatVect3 p; diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_int.h b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_int.h index cd6d1db2a3..3b86387356 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_int.h +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_int.h @@ -26,7 +26,7 @@ #include "math/pprz_algebra_int.h" -#include "airframe.h" +#include "generated/airframe.h" struct Int32AttitudeGains { struct Int32Vect3 p; diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_quat_float.c b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_quat_float.c index 8502f26e2d..2680feef43 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_quat_float.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_quat_float.c @@ -31,7 +31,7 @@ #include "math/pprz_algebra_float.h" #include "math/pprz_algebra_int.h" #include "subsystems/ahrs.h" -#include "airframe.h" +#include "generated/airframe.h" struct FloatAttitudeGains stabilization_gains[STABILIZATION_ATTITUDE_FLOAT_GAIN_NB]; diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_float.h b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_float.h index 305a8e8d0d..36f31cdd97 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_float.h +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_float.h @@ -23,7 +23,7 @@ #ifndef BOOZ_STABILISATION_ATTITUDE_REF_FLOAT_H #define BOOZ_STABILISATION_ATTITUDE_REF_FLOAT_H -#include "airframe.h" +#include "generated/airframe.h" extern struct FloatEulers stab_att_sp_euler; extern struct FloatQuat stab_att_sp_quat; diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_float.c b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_float.c index 9c6f91d894..7799d9995b 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_float.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_float.c @@ -26,7 +26,7 @@ * */ -#include "airframe.h" +#include "generated/airframe.h" #include "firmwares/rotorcraft/stabilization.h" #include "subsystems/ahrs.h" diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.c b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.c index 9c46cbb03b..951eea11bf 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.c @@ -28,7 +28,7 @@ #include "subsystems/imu.h" #include "subsystems/radio_control.h" -#include "airframe.h" +#include "generated/airframe.h" #define F_UPDATE_RES 9 #define REF_DOT_FRAC 11 diff --git a/sw/airborne/firmwares/rotorcraft/telemetry.h b/sw/airborne/firmwares/rotorcraft/telemetry.h index 2349a56655..adca6d09b3 100644 --- a/sw/airborne/firmwares/rotorcraft/telemetry.h +++ b/sw/airborne/firmwares/rotorcraft/telemetry.h @@ -759,10 +759,10 @@ extern uint8_t telemetry_mode_Main_DefaultChannel; #define PERIODIC_SEND_CAM_TRACK(_chan) {} #endif -#include "settings.h" +#include "generated/settings.h" #define PERIODIC_SEND_DL_VALUE(_chan) PeriodicSendDlValue(_chan) -#include "periodic.h" +#include "generated/periodic.h" #define Booz2TelemetryPeriodic() { \ PeriodicSendMain(DefaultChannel); \ } diff --git a/sw/airborne/firmwares/tutorial/main_demo5.c b/sw/airborne/firmwares/tutorial/main_demo5.c index bb9b16fdb6..138fe63b0d 100644 --- a/sw/airborne/firmwares/tutorial/main_demo5.c +++ b/sw/airborne/firmwares/tutorial/main_demo5.c @@ -59,7 +59,7 @@ bool_t dl_msg_available; #define MSG_SIZE 128 uint8_t dl_buffer[MSG_SIZE] __attribute__ ((aligned)); -#include "settings.h" +#include "generated/settings.h" #define IdOfMsg(x) (x[1]) diff --git a/sw/airborne/firmwares/wind_tunnel/main.c b/sw/airborne/firmwares/wind_tunnel/main.c index 319621e99c..a8f779296a 100644 --- a/sw/airborne/firmwares/wind_tunnel/main.c +++ b/sw/airborne/firmwares/wind_tunnel/main.c @@ -9,7 +9,7 @@ #include "downlink.h" #include "datalink.h" -#include "settings.h" +#include "generated/settings.h" #include "dl_protocol.h" #include "wt_servo.h" diff --git a/sw/airborne/firmwares/wind_tunnel/main_mb.c b/sw/airborne/firmwares/wind_tunnel/main_mb.c index 2be7af41e2..48e0403f44 100644 --- a/sw/airborne/firmwares/wind_tunnel/main_mb.c +++ b/sw/airborne/firmwares/wind_tunnel/main_mb.c @@ -9,7 +9,7 @@ #include "downlink.h" #include "datalink.h" -#include "settings.h" +#include "generated/settings.h" #include "dl_protocol.h" #include "i2c.h" diff --git a/sw/airborne/fms/fms_autopilot_msg.h b/sw/airborne/fms/fms_autopilot_msg.h index b075926e43..03943029ca 100644 --- a/sw/airborne/fms/fms_autopilot_msg.h +++ b/sw/airborne/fms/fms_autopilot_msg.h @@ -5,7 +5,7 @@ #include "math/pprz_algebra_int.h" #include "math/pprz_geodetic_int.h" // FIXME: why is including airframe.h needed ? -//#include "airframe.h" +//#include "generated/airframe.h" //#include "adc.h" #define NB_ADC 8 diff --git a/sw/airborne/fms/fms_gs_com.c b/sw/airborne/fms/fms_gs_com.c index d3fca2ae57..10579bcb2b 100644 --- a/sw/airborne/fms/fms_gs_com.c +++ b/sw/airborne/fms/fms_gs_com.c @@ -5,7 +5,7 @@ #include "udp_transport2.h" /* generated : holds PeriodicSendMain */ -#include "periodic.h" +#include "generated/periodic.h" /* holds the definitions of PERIODIC_SEND_XXX */ #include "overo_test_passthrough_telemetry.h" /* holds the definitions of DOWNLINK_SEND_XXX */ @@ -13,7 +13,7 @@ #include "dl_protocol.h" /* generated : holds DlSetting() and PeriodicSendDlValue() */ -#include "settings.h" +#include "generated/settings.h" struct FmsGsCom fms_gs_com; uint8_t telemetry_mode_Main_DefaultChannel; diff --git a/sw/airborne/fms/fms_spi_autopilot_msg.c b/sw/airborne/fms/fms_spi_autopilot_msg.c index e75900ec54..33c0a53ee1 100644 --- a/sw/airborne/fms/fms_spi_autopilot_msg.c +++ b/sw/airborne/fms/fms_spi_autopilot_msg.c @@ -40,7 +40,7 @@ #include "fms/fms_network.h" #include "ready_main.h" -#include "airframe.h" +#include "generated/airframe.h" /* sort of a hack, we're not really fixed wing here but we need their declarations */ #include "firmwares/fixedwing/actuators.h" #include "rdyb_booz_imu.h" diff --git a/sw/airborne/fms/onboard_transport.h b/sw/airborne/fms/onboard_transport.h index 6c38c861ee..dab9ee2d56 100644 --- a/sw/airborne/fms/onboard_transport.h +++ b/sw/airborne/fms/onboard_transport.h @@ -2,7 +2,7 @@ #define ONBOARD_TRANSPORT_H #include "std.h" -#include "airframe.h" +#include "generated/airframe.h" #ifndef MSG_TIMESTAMP #define MSG_TIMESTAMP 0 diff --git a/sw/airborne/fms/overo_test_periodic.c b/sw/airborne/fms/overo_test_periodic.c index 7f71f00ed4..3ce6637739 100644 --- a/sw/airborne/fms/overo_test_periodic.c +++ b/sw/airborne/fms/overo_test_periodic.c @@ -12,7 +12,7 @@ #define DATALINK_PORT 4243 #define FMS_NETWORK_BROADCAST TRUE -#include "airframe.h" +#include "generated/airframe.h" #include "fms_periodic.h" #include "downlink.h" diff --git a/sw/airborne/fms/udp_transport2.h b/sw/airborne/fms/udp_transport2.h index 9500b6023a..d3501e2aa4 100644 --- a/sw/airborne/fms/udp_transport2.h +++ b/sw/airborne/fms/udp_transport2.h @@ -4,7 +4,7 @@ #include "fms_network.h" #include "fms_debug.h" #include "std.h" -#include "airframe.h" +#include "generated/airframe.h" #define STX_UDP_TX 0x98 #define STX_UDP_RX 0x99 diff --git a/sw/airborne/gps.c b/sw/airborne/gps.c index ba189dff39..1f196f9a66 100644 --- a/sw/airborne/gps.c +++ b/sw/airborne/gps.c @@ -34,8 +34,8 @@ #ifndef FMS_PERIODIC_FREQ #include "sys_time.h" #endif -#include "airframe.h" -#include "periodic.h" +#include "generated/airframe.h" +#include "generated/periodic.h" #ifdef USE_USB_SERIAL #include "usb_serial.h" diff --git a/sw/airborne/gps_nmea.c b/sw/airborne/gps_nmea.c index 675840f64a..a110425dcf 100644 --- a/sw/airborne/gps_nmea.c +++ b/sw/airborne/gps_nmea.c @@ -42,7 +42,7 @@ #endif -#include "flight_plan.h" +#include "generated/flight_plan.h" #include "uart.h" #include "gps.h" //include "gps_ubx.h" diff --git a/sw/airborne/gps_ubx.c b/sw/airborne/gps_ubx.c index f719046d18..15777dece9 100644 --- a/sw/airborne/gps_ubx.c +++ b/sw/airborne/gps_ubx.c @@ -37,7 +37,7 @@ #include "fms_serial_port.h" #endif -#include "flight_plan.h" +#include "generated/flight_plan.h" #include "uart.h" #include "gps.h" #include "gps_ubx.h" diff --git a/sw/airborne/gps_xsens.c b/sw/airborne/gps_xsens.c index b08f114268..3aae822ad6 100644 --- a/sw/airborne/gps_xsens.c +++ b/sw/airborne/gps_xsens.c @@ -31,7 +31,7 @@ #include "gps.h" #include "sys_time.h" -#include "airframe.h" +#include "generated/airframe.h" #include "uart.h" #include "messages.h" diff --git a/sw/airborne/gyro.c b/sw/airborne/gyro.c index 3eff353cd1..4982ef69cc 100644 --- a/sw/airborne/gyro.c +++ b/sw/airborne/gyro.c @@ -31,7 +31,7 @@ #include "gyro.h" #include "std.h" #include "adc.h" -#include "airframe.h" +#include "generated/airframe.h" #include "estimator.h" int16_t roll_rate_adc; diff --git a/sw/airborne/infrared.c b/sw/airborne/infrared.c index bbd8f733a2..584ae04aad 100644 --- a/sw/airborne/infrared.c +++ b/sw/airborne/infrared.c @@ -37,7 +37,7 @@ #include "estimator.h" #include "ap_downlink.h" #include "sys_time.h" -#include "airframe.h" +#include "generated/airframe.h" #if defined IR_ESTIMATED_PHI_PI_4 || defined IR_ESTIMATED_PHI_MINUS_PI_4 || defined IR_ESTIMATED_THETA_PI_4 #error "IR_ESTIMATED_PHI_PI_4 correction has been deprecated. Please remove the definition from your airframe config file" diff --git a/sw/airborne/infrared.h b/sw/airborne/infrared.h index 80c4bb4d00..298a70b0cf 100644 --- a/sw/airborne/infrared.h +++ b/sw/airborne/infrared.h @@ -26,7 +26,7 @@ #define INFRARED_H #include "std.h" -#include "airframe.h" +#include "generated/airframe.h" extern float ir_roll_neutral; /* Rad */ extern float ir_pitch_neutral; /* Rad */ diff --git a/sw/airborne/inter_mcu.h b/sw/airborne/inter_mcu.h index 666f67a3d9..2ed669266d 100644 --- a/sw/airborne/inter_mcu.h +++ b/sw/airborne/inter_mcu.h @@ -40,12 +40,12 @@ #include "std.h" #include "paparazzi.h" -#include "airframe.h" +#include "generated/airframe.h" #include "subsystems/radio_control.h" #include "firmwares/fixedwing/main_fbw.h" #ifndef SINGLE_MCU -#include "radio.h" +#include "generated/radio.h" #define RADIO_CONTROL_NB_CHANNEL RADIO_CTL_NB #endif diff --git a/sw/airborne/lisa/lisa_stm_gps_passthrough_main.c b/sw/airborne/lisa/lisa_stm_gps_passthrough_main.c index c4398f7163..a8fc59c643 100644 --- a/sw/airborne/lisa/lisa_stm_gps_passthrough_main.c +++ b/sw/airborne/lisa/lisa_stm_gps_passthrough_main.c @@ -26,7 +26,7 @@ #include "sys_time.h" #include "lisa/lisa_overo_link.h" #include "lisa/lisa_spistream.h" -#include "airframe.h" +#include "generated/airframe.h" #include "uart.h" static inline void main_init(void); diff --git a/sw/airborne/lisa/lisa_stm_passthrough_main.c b/sw/airborne/lisa/lisa_stm_passthrough_main.c index e92f1ba5e3..bc468456df 100644 --- a/sw/airborne/lisa/lisa_stm_passthrough_main.c +++ b/sw/airborne/lisa/lisa_stm_passthrough_main.c @@ -35,7 +35,7 @@ #include "guidance.h" #include "navigation.h" #include "lisa/lisa_overo_link.h" -#include "airframe.h" +#include "generated/airframe.h" #include "ahrs.h" #ifdef PASSTHROUGH_CYGNUS #include "stabilization.h" diff --git a/sw/airborne/lisa/test/test_board.c b/sw/airborne/lisa/test/test_board.c index dca59b6f99..efb4088ff1 100644 --- a/sw/airborne/lisa/test/test_board.c +++ b/sw/airborne/lisa/test/test_board.c @@ -36,7 +36,7 @@ #include "uart.h" #include "datalink.h" -#include "settings.h" +#include "generated/settings.h" #include "lisa/lisa_baro.h" #include "actuators/actuators_pwm.h" diff --git a/sw/airborne/modem.h b/sw/airborne/modem.h index e0401c51fc..ff76baf053 100644 --- a/sw/airborne/modem.h +++ b/sw/airborne/modem.h @@ -33,7 +33,7 @@ extern uint8_t modem_nb_ovrn; #ifdef MODEM -#include "airframe.h" +#include "generated/airframe.h" #include "modem_hw.h" diff --git a/sw/airborne/modules/cam_control/booz_cam.c b/sw/airborne/modules/cam_control/booz_cam.c index 34461ccb3f..80f509db57 100644 --- a/sw/airborne/modules/cam_control/booz_cam.c +++ b/sw/airborne/modules/cam_control/booz_cam.c @@ -27,7 +27,7 @@ #include "subsystems/ahrs.h" #include "firmwares/rotorcraft/navigation.h" #include "subsystems/ins.h" -#include "flight_plan.h" +#include "generated/flight_plan.h" uint8_t booz_cam_mode; diff --git a/sw/airborne/modules/cam_control/booz_cam.h b/sw/airborne/modules/cam_control/booz_cam.h index 8e656d24b6..4e97b33bf8 100644 --- a/sw/airborne/modules/cam_control/booz_cam.h +++ b/sw/airborne/modules/cam_control/booz_cam.h @@ -25,7 +25,7 @@ #ifndef BOOZ_CAM_H #define BOOZ_CAM_H -#include "airframe.h" +#include "generated/airframe.h" #include "std.h" #include "led.h" diff --git a/sw/airborne/modules/cam_control/cam.c b/sw/airborne/modules/cam_control/cam.c index 8c845e4fe0..94fd11d943 100644 --- a/sw/airborne/modules/cam_control/cam.c +++ b/sw/airborne/modules/cam_control/cam.c @@ -30,7 +30,7 @@ #include "cam.h" #include "subsystems/navigation/common_nav.h" #include "autopilot.h" -#include "flight_plan.h" +#include "generated/flight_plan.h" #include "estimator.h" #include "subsystems/navigation/traffic_info.h" #ifdef POINT_CAM diff --git a/sw/airborne/modules/cam_control/cam_roll.c b/sw/airborne/modules/cam_control/cam_roll.c index 93b6f3ff8c..60c0beae7c 100644 --- a/sw/airborne/modules/cam_control/cam_roll.c +++ b/sw/airborne/modules/cam_control/cam_roll.c @@ -30,7 +30,7 @@ #include "cam.h" #include "subsystems/nav.h" #include "autopilot.h" -#include "flight_plan.h" +#include "generated/flight_plan.h" #include "estimator.h" #include "inter_mcu.h" #include "subsystems/nav.h" diff --git a/sw/airborne/modules/deploy_sonar_buoy/deploy_sonar_buoy.c b/sw/airborne/modules/deploy_sonar_buoy/deploy_sonar_buoy.c index 4e0b788c64..df41a426b7 100644 --- a/sw/airborne/modules/deploy_sonar_buoy/deploy_sonar_buoy.c +++ b/sw/airborne/modules/deploy_sonar_buoy/deploy_sonar_buoy.c @@ -23,7 +23,7 @@ #include #include #include "deploy_sonar_buoy.h" -#include "airframe.h" +#include "generated/airframe.h" /* simple module to toggle two gpio pins on Lisa. * The application in this was written for drops diff --git a/sw/airborne/modules/digital_cam/dc.h b/sw/airborne/modules/digital_cam/dc.h index 95e50be693..9d5bb6e063 100644 --- a/sw/airborne/modules/digital_cam/dc.h +++ b/sw/airborne/modules/digital_cam/dc.h @@ -52,7 +52,7 @@ #include "std.h" #include "led.h" -#include "airframe.h" +#include "generated/airframe.h" #include "estimator.h" #include "gps.h" diff --git a/sw/airborne/modules/drop/booz_drop.c b/sw/airborne/modules/drop/booz_drop.c index 005601b627..2e2ba6c4d8 100644 --- a/sw/airborne/modules/drop/booz_drop.c +++ b/sw/airborne/modules/drop/booz_drop.c @@ -23,7 +23,7 @@ #include "booz_drop.h" #include "booz2_pwm_hw.h" -#include "airframe.h" +#include "generated/airframe.h" bool_t booz_drop_ball; int16_t booz_drop_servo; diff --git a/sw/airborne/modules/gsm/gsm.c b/sw/airborne/modules/gsm/gsm.c index 0d99085d17..44acfd941a 100644 --- a/sw/airborne/modules/gsm/gsm.c +++ b/sw/airborne/modules/gsm/gsm.c @@ -73,7 +73,7 @@ Receiving: #include "autopilot.h" #include "estimator.h" #include "subsystems/navigation/common_nav.h" -#include "settings.h" +#include "generated/settings.h" #ifndef GSM_LINK #define GSM_LINK Uart3100 diff --git a/sw/airborne/modules/ins/ins_osam_ugear.c b/sw/airborne/modules/ins/ins_osam_ugear.c index 88d46a2493..adc3bdd00c 100644 --- a/sw/airborne/modules/ins/ins_osam_ugear.c +++ b/sw/airborne/modules/ins/ins_osam_ugear.c @@ -36,7 +36,7 @@ #include "latlong.h" #include "sys_time.h" #include "airframe.h" -#include "subsystems/nav.h" +#include "generated/subsystems/nav.h" #include "estimator.h" #include "xsens_protocol.h" @@ -265,7 +265,7 @@ void parse_ugear_msg( void ){ ins_phi = (float)ugear_phi/10000 - ins_roll_neutral; ins_psi = 0; ins_theta = (float)ugear_theta/10000 - ins_pitch_neutral; -#ifndef INFRARED +#ifndef USE_INFRARED EstimatorSetAtt(ins_phi, ins_psi, ins_theta); #endif break; diff --git a/sw/airborne/modules/ins/ins_vn100.c b/sw/airborne/modules/ins/ins_vn100.c index ba7963db1f..ba36debbdd 100644 --- a/sw/airborne/modules/ins/ins_vn100.c +++ b/sw/airborne/modules/ins/ins_vn100.c @@ -28,7 +28,7 @@ #include "ins_vn100.h" -#include "airframe.h" +#include "generated/airframe.h" #include "led.h" #include "downlink.h" diff --git a/sw/airborne/modules/ins/ins_xsens.c b/sw/airborne/modules/ins/ins_xsens.c index 9c87e2eaf5..49a053b314 100644 --- a/sw/airborne/modules/ins/ins_xsens.c +++ b/sw/airborne/modules/ins/ins_xsens.c @@ -30,7 +30,7 @@ #include -#include "airframe.h" +#include "generated/airframe.h" #include "downlink.h" #include "messages.h" diff --git a/sw/airborne/modules/multi/formation.c b/sw/airborne/modules/multi/formation.c index 1f74b59de7..1bce893c59 100644 --- a/sw/airborne/modules/multi/formation.c +++ b/sw/airborne/modules/multi/formation.c @@ -17,8 +17,8 @@ #include "firmwares/fixedwing/guidance/guidance_v.h" #include "autopilot.h" #include "gps.h" -#include "flight_plan.h" -#include "airframe.h" +#include "generated/flight_plan.h" +#include "generated/airframe.h" #include "dl_protocol.h" #include diff --git a/sw/airborne/modules/multi/potential.c b/sw/airborne/modules/multi/potential.c index c7a3f1eea8..cd6ae6a8b6 100644 --- a/sw/airborne/modules/multi/potential.c +++ b/sw/airborne/modules/multi/potential.c @@ -17,7 +17,7 @@ #include "firmwares/fixedwing/guidance/guidance_v.h" #include "autopilot.h" #include "gps.h" -#include "airframe.h" +#include "generated/airframe.h" //#include diff --git a/sw/airborne/modules/multi/tcas.c b/sw/airborne/modules/multi/tcas.c index 406ec0f790..6030bb3f7d 100644 --- a/sw/airborne/modules/multi/tcas.c +++ b/sw/airborne/modules/multi/tcas.c @@ -28,11 +28,11 @@ */ #include "multi/tcas.h" -#include "airframe.h" +#include "generated/airframe.h" #include "estimator.h" #include "subsystems/nav.h" #include "gps.h" -#include "flight_plan.h" +#include "generated/flight_plan.h" #include "messages.h" #include "downlink.h" diff --git a/sw/airborne/modules/sensors/airspeed_adc.c b/sw/airborne/modules/sensors/airspeed_adc.c index 276274ca3a..d554246d24 100644 --- a/sw/airborne/modules/sensors/airspeed_adc.c +++ b/sw/airborne/modules/sensors/airspeed_adc.c @@ -23,7 +23,7 @@ #include "sensors/airspeed_adc.h" #include "adc.h" #include BOARD_CONFIG -#include "airframe.h" +#include "generated/airframe.h" #include "estimator.h" uint16_t adc_airspeed_val; diff --git a/sw/airborne/modules/sensors/infrared_i2c.h b/sw/airborne/modules/sensors/infrared_i2c.h index 034ac5752a..2b91acfb22 100644 --- a/sw/airborne/modules/sensors/infrared_i2c.h +++ b/sw/airborne/modules/sensors/infrared_i2c.h @@ -28,7 +28,7 @@ #define INFRARED_I2C_H #include "std.h" -#include "airframe.h" +#include "generated/airframe.h" #include "infrared.h" #include "i2c.h" diff --git a/sw/airborne/modules/servo_switch/servo_switch.c b/sw/airborne/modules/servo_switch/servo_switch.c index cb63232846..2d90ae53e6 100644 --- a/sw/airborne/modules/servo_switch/servo_switch.c +++ b/sw/airborne/modules/servo_switch/servo_switch.c @@ -22,7 +22,7 @@ */ #include "servo_switch/servo_switch.h" -#include "airframe.h" +#include "generated/airframe.h" #include "actuators.h" bool_t servo_switch_on; diff --git a/sw/airborne/modules/vehicle_interface/vi.c b/sw/airborne/modules/vehicle_interface/vi.c index 8a0e6ccf34..94c53cf09a 100644 --- a/sw/airborne/modules/vehicle_interface/vi.c +++ b/sw/airborne/modules/vehicle_interface/vi.c @@ -27,7 +27,7 @@ #include "subsystems/ahrs.h" #include "booz/booz_gps.h" -#include "airframe.h" +#include "generated/airframe.h" struct VehicleInterface vi; diff --git a/sw/airborne/rc_settings.c b/sw/airborne/rc_settings.c index 82be227638..35eb8b1a2a 100644 --- a/sw/airborne/rc_settings.c +++ b/sw/airborne/rc_settings.c @@ -26,7 +26,7 @@ #include #include "rc_settings.h" -#include "radio.h" +#include "generated/radio.h" #include "autopilot.h" #include "infrared.h" #include "subsystems/nav.h" @@ -44,7 +44,7 @@ #define RcChannel(x) (fbw_state->channels[x]) /** Includes generated code from tuning_rc.xml */ -#include "settings.h" +#include "generated/settings.h" void rc_settings(bool_t mode_changed __attribute__ ((unused))) { diff --git a/sw/airborne/rc_settings.h b/sw/airborne/rc_settings.h index b8680e6665..0cbd78de78 100644 --- a/sw/airborne/rc_settings.h +++ b/sw/airborne/rc_settings.h @@ -40,7 +40,7 @@ #if defined RADIO_CALIB && defined RADIO_CONTROL_SETTINGS #include "std.h" -#include "radio.h" +#include "generated/radio.h" #define RC_SETTINGS_MODE_NONE 0 #define RC_SETTINGS_MODE_DOWN 1 diff --git a/sw/airborne/sd_card/main.c b/sw/airborne/sd_card/main.c index 7335abe956..5be480f5f7 100644 --- a/sw/airborne/sd_card/main.c +++ b/sw/airborne/sd_card/main.c @@ -9,7 +9,7 @@ #include "downlink.h" #include "datalink.h" -#include "settings.h" +#include "generated/settings.h" #include "dl_protocol.h" #include "spi.h" diff --git a/sw/airborne/setup_actuators.c b/sw/airborne/setup_actuators.c index c4c091b1ce..9c8afa4f32 100644 --- a/sw/airborne/setup_actuators.c +++ b/sw/airborne/setup_actuators.c @@ -5,14 +5,14 @@ #include "led.h" #include "firmwares/fixedwing/actuators.h" //#include "actuators.h" -#include "airframe.h" +#include "generated/airframe.h" #define DATALINK_C #include "datalink.h" #include "uart.h" #include "pprz_transport.h" #include "firmwares/fixedwing/main_fbw.h" #include "downlink.h" -#include "settings.h" +#include "generated/settings.h" #define IdOfMsg(x) (x[1]) diff --git a/sw/airborne/subsystems/ahrs/ahrs_float_cmpl_rmat.c b/sw/airborne/subsystems/ahrs/ahrs_float_cmpl_rmat.c index 90e8823e4a..1b03e931f9 100644 --- a/sw/airborne/subsystems/ahrs/ahrs_float_cmpl_rmat.c +++ b/sw/airborne/subsystems/ahrs/ahrs_float_cmpl_rmat.c @@ -29,7 +29,7 @@ #include "math/pprz_algebra_float.h" #include "math/pprz_algebra_int.h" #include "math/pprz_simple_matrix.h" -#include "airframe.h" +#include "generated/airframe.h" #include diff --git a/sw/airborne/subsystems/ahrs/ahrs_float_lkf.c b/sw/airborne/subsystems/ahrs/ahrs_float_lkf.c index d0bb10a281..50e2c6f6df 100644 --- a/sw/airborne/subsystems/ahrs/ahrs_float_lkf.c +++ b/sw/airborne/subsystems/ahrs/ahrs_float_lkf.c @@ -27,7 +27,7 @@ #include "subsystems/imu.h" #include "subsystems/ahrs/ahrs_aligner.h" -#include "airframe.h" +#include "generated/airframe.h" #include "math/pprz_algebra_float.h" #include diff --git a/sw/airborne/subsystems/ahrs/ahrs_int_cmpl_euler.c b/sw/airborne/subsystems/ahrs/ahrs_int_cmpl_euler.c index 546159d568..222673709e 100644 --- a/sw/airborne/subsystems/ahrs/ahrs_int_cmpl_euler.c +++ b/sw/airborne/subsystems/ahrs/ahrs_int_cmpl_euler.c @@ -28,7 +28,7 @@ #include "math/pprz_trig_int.h" #include "math/pprz_algebra_int.h" -#include "airframe.h" +#include "generated/airframe.h" struct AhrsIntCmplEuler ahrs_impl; diff --git a/sw/airborne/subsystems/imu.c b/sw/airborne/subsystems/imu.c index bca91ac37a..b41aeaa53f 100644 --- a/sw/airborne/subsystems/imu.c +++ b/sw/airborne/subsystems/imu.c @@ -23,7 +23,7 @@ #include "subsystems/imu.h" -#include "airframe.h" +#include "generated/airframe.h" struct Imu imu; diff --git a/sw/airborne/subsystems/imu/imu_aspirin.h b/sw/airborne/subsystems/imu/imu_aspirin.h index d5046c1a3e..ea13d0a6d8 100644 --- a/sw/airborne/subsystems/imu/imu_aspirin.h +++ b/sw/airborne/subsystems/imu/imu_aspirin.h @@ -24,7 +24,7 @@ #ifndef IMU_ASPIRIN_H #define IMU_ASPIRIN_H -#include "airframe.h" +#include "generated/airframe.h" #include "subsystems/imu.h" #include "i2c.h" diff --git a/sw/airborne/subsystems/imu/imu_b2.h b/sw/airborne/subsystems/imu/imu_b2.h index 4406c2b25c..fc9aa8660f 100644 --- a/sw/airborne/subsystems/imu/imu_b2.h +++ b/sw/airborne/subsystems/imu/imu_b2.h @@ -25,7 +25,7 @@ #define IMU_B2_H #include "subsystems/imu.h" -#include "airframe.h" +#include "generated/airframe.h" #include "peripherals/max1168.h" diff --git a/sw/airborne/subsystems/imu/imu_crista.h b/sw/airborne/subsystems/imu/imu_crista.h index a91cbe7d5f..7f19861efa 100644 --- a/sw/airborne/subsystems/imu/imu_crista.h +++ b/sw/airborne/subsystems/imu/imu_crista.h @@ -25,7 +25,7 @@ #define IMU_CRISTA_H #include "subsystems/imu.h" -#include "airframe.h" +#include "generated/airframe.h" #define ADS8344_NB_CHANNELS 8 extern uint16_t ADS8344_values[ADS8344_NB_CHANNELS]; diff --git a/sw/airborne/subsystems/ins.c b/sw/airborne/subsystems/ins.c index 7d7708527d..779fec6f0c 100644 --- a/sw/airborne/subsystems/ins.c +++ b/sw/airborne/subsystems/ins.c @@ -28,7 +28,7 @@ #include "firmwares/rotorcraft/baro.h" #include "booz_gps.h" -#include "airframe.h" +#include "generated/airframe.h" #include "math/pprz_algebra_int.h" #include "math/pprz_algebra_float.h" @@ -43,7 +43,7 @@ #endif #ifdef BOOZ2_SONAR -#include "modules.h" +#include "generated/modules.h" #endif #ifdef SITL @@ -54,7 +54,7 @@ #include "math/pprz_geodetic_int.h" -#include "flight_plan.h" +#include "generated/flight_plan.h" /* gps transformed to LTP-NED */ struct LtpDef_i ins_ltp_def; diff --git a/sw/airborne/subsystems/ins/hf_float.c b/sw/airborne/subsystems/ins/hf_float.c index 9cf76b9cf7..e990dc896d 100644 --- a/sw/airborne/subsystems/ins/hf_float.c +++ b/sw/airborne/subsystems/ins/hf_float.c @@ -29,7 +29,7 @@ #include "booz_gps.h" #include -#include "airframe.h" +#include "generated/airframe.h" #ifdef SITL #include diff --git a/sw/airborne/subsystems/nav.c b/sw/airborne/subsystems/nav.c index 6518501f4f..7e644c2478 100644 --- a/sw/airborne/subsystems/nav.c +++ b/sw/airborne/subsystems/nav.c @@ -257,7 +257,7 @@ static inline bool_t compute_TOD(uint8_t _af, uint8_t _td, uint8_t _tod, float g } -#include "flight_plan.h" +#include "generated/flight_plan.h" #ifndef LINE_START_FUNCTION diff --git a/sw/airborne/subsystems/navigation/OSAMNav.h b/sw/airborne/subsystems/navigation/OSAMNav.h index 5689d3b807..e98813e858 100644 --- a/sw/airborne/subsystems/navigation/OSAMNav.h +++ b/sw/airborne/subsystems/navigation/OSAMNav.h @@ -5,7 +5,7 @@ #include "subsystems/nav.h" #include "estimator.h" #include "autopilot.h" -#include "flight_plan.h" +#include "generated/flight_plan.h" struct Point2D {float x; float y;}; struct Line {float m;float b;float x;}; diff --git a/sw/airborne/subsystems/navigation/bomb.c b/sw/airborne/subsystems/navigation/bomb.c index 82d4655406..733109994c 100644 --- a/sw/airborne/subsystems/navigation/bomb.c +++ b/sw/airborne/subsystems/navigation/bomb.c @@ -25,8 +25,8 @@ #include "estimator.h" #include "subsystems/nav.h" #include "subsystems/navigation/bomb.h" -#include "flight_plan.h" -#include "airframe.h" +#include "generated/flight_plan.h" +#include "generated/airframe.h" #include "inter_mcu.h" diff --git a/sw/airborne/subsystems/navigation/common_nav.c b/sw/airborne/subsystems/navigation/common_nav.c index 0d1acb9b8a..8a6551fa5b 100644 --- a/sw/airborne/subsystems/navigation/common_nav.c +++ b/sw/airborne/subsystems/navigation/common_nav.c @@ -24,7 +24,7 @@ #include "subsystems/navigation/common_nav.h" #include "estimator.h" -#include "flight_plan.h" +#include "generated/flight_plan.h" #include "gps.h" float dist2_to_home; diff --git a/sw/airborne/subsystems/navigation/discsurvey.c b/sw/airborne/subsystems/navigation/discsurvey.c index 643eb406f1..1bd817d43e 100644 --- a/sw/airborne/subsystems/navigation/discsurvey.c +++ b/sw/airborne/subsystems/navigation/discsurvey.c @@ -1,10 +1,10 @@ #include "subsystems/navigation/discsurvey.h" -#include "airframe.h" +#include "generated/airframe.h" #include "estimator.h" #include "std.h" #include "subsystems/nav.h" -#include "flight_plan.h" +#include "generated/flight_plan.h" #include "ap_downlink.h" enum status { UTURN, SEGMENT, DOWNWIND }; diff --git a/sw/airborne/subsystems/navigation/nav_cube.c b/sw/airborne/subsystems/navigation/nav_cube.c index 7be42b7e78..827d94bf99 100644 --- a/sw/airborne/subsystems/navigation/nav_cube.c +++ b/sw/airborne/subsystems/navigation/nav_cube.c @@ -27,10 +27,10 @@ * */ -#include "airframe.h" +#include "generated/airframe.h" #include "subsystems/navigation/nav_cube.h" #include "subsystems/nav.h" -#include "flight_plan.h" +#include "generated/flight_plan.h" int32_t cube_alpha; int32_t cube_size_x, cube_size_y, cube_size_z; diff --git a/sw/airborne/subsystems/navigation/nav_line.c b/sw/airborne/subsystems/navigation/nav_line.c index 7b5a873399..961d39a683 100644 --- a/sw/airborne/subsystems/navigation/nav_line.c +++ b/sw/airborne/subsystems/navigation/nav_line.c @@ -27,7 +27,7 @@ * */ -#include "airframe.h" +#include "generated/airframe.h" #include "subsystems/navigation/nav_line.h" #include "subsystems/nav.h" diff --git a/sw/airborne/subsystems/navigation/nav_survey_rectangle.c b/sw/airborne/subsystems/navigation/nav_survey_rectangle.c index 826d1e1f80..ef50181871 100644 --- a/sw/airborne/subsystems/navigation/nav_survey_rectangle.c +++ b/sw/airborne/subsystems/navigation/nav_survey_rectangle.c @@ -11,7 +11,7 @@ static survey_orientation_t survey_orientation = NS; #define SurveyGoingEast() ((survey_orientation == WE) && (survey_to.x > survey_from.x)) #define SurveyGoingWest() ((survey_orientation == WE) && (survey_to.x < survey_from.x)) -#include "flight_plan.h" +#include "generated/flight_plan.h" #ifndef LINE_START_FUNCTION #define LINE_START_FUNCTION {} diff --git a/sw/airborne/subsystems/navigation/snav.c b/sw/airborne/subsystems/navigation/snav.c index 70f79e2748..1d08b189b7 100644 --- a/sw/airborne/subsystems/navigation/snav.c +++ b/sw/airborne/subsystems/navigation/snav.c @@ -2,7 +2,7 @@ segment (from wp_rd to wp_ta) and a second arc (around wp_ca) */ #include -#include "airframe.h" +#include "generated/airframe.h" #include "subsystems/navigation/snav.h" #include "estimator.h" #include "subsystems/nav.h" diff --git a/sw/airborne/subsystems/navigation/traffic_info.c b/sw/airborne/subsystems/navigation/traffic_info.c index 25f9a5c7e4..f2e396b44f 100644 --- a/sw/airborne/subsystems/navigation/traffic_info.c +++ b/sw/airborne/subsystems/navigation/traffic_info.c @@ -28,7 +28,7 @@ #include #include "subsystems/navigation/traffic_info.h" -#include "airframe.h" +#include "generated/airframe.h" uint8_t acs_idx; uint8_t the_acs_id[NB_ACS_ID]; diff --git a/sw/airborne/subsystems/radio_control.h b/sw/airborne/subsystems/radio_control.h index e647bb4fb1..9651422f20 100644 --- a/sw/airborne/subsystems/radio_control.h +++ b/sw/airborne/subsystems/radio_control.h @@ -28,7 +28,7 @@ #if defined RADIO_CONTROL #include "led.h" -#include "airframe.h" +#include "generated/airframe.h" #include "paparazzi.h" /* underlying hardware */ diff --git a/sw/airborne/subsystems/radio_control/dummy.h b/sw/airborne/subsystems/radio_control/dummy.h index b976b09684..d5f563ab18 100644 --- a/sw/airborne/subsystems/radio_control/dummy.h +++ b/sw/airborne/subsystems/radio_control/dummy.h @@ -25,7 +25,7 @@ #ifndef RADIO_CONTROL_NULL_H #define RADIO_CONTROL_NULL_H -#include "radio.h" +#include "generated/radio.h" #define RadioControlEvent(_received_frame_handler) { } diff --git a/sw/airborne/subsystems/radio_control/ppm.h b/sw/airborne/subsystems/radio_control/ppm.h index 80b246c47a..54c82bc81d 100644 --- a/sw/airborne/subsystems/radio_control/ppm.h +++ b/sw/airborne/subsystems/radio_control/ppm.h @@ -37,7 +37,7 @@ extern void ppm_arch_init(void); * Generated code holding the description of a given * transmitter */ -#include "radio.h" +#include "generated/radio.h" /** * Define number of channels diff --git a/sw/airborne/xbee.h b/sw/airborne/xbee.h index 6e3d1288d0..fa6f3e8870 100644 --- a/sw/airborne/xbee.h +++ b/sw/airborne/xbee.h @@ -28,7 +28,7 @@ #define XBEE_H #include "datalink.h" -#include "airframe.h" +#include "generated/airframe.h" #ifdef XBEE868 #include "xbee868.h" diff --git a/sw/ground_segment/tmtc/booz_server.ml b/sw/ground_segment/tmtc/booz_server.ml index a076cb9d27..98187d7f75 100644 --- a/sw/ground_segment/tmtc/booz_server.ml +++ b/sw/ground_segment/tmtc/booz_server.ml @@ -182,7 +182,6 @@ let log_and_parse = fun ac_name (a:Aircraft.aircraft) msg values -> Wind.update ac_name a.gspeed a.course | "ROTORCRAFT_STATUS" -> a.fbw.rc_status <- get_rc_status (ivalue "rc_status"); - a.fbw.rc_rate <- ivalue "frame_rate"; a.gps_mode <- check_index (ivalue "gps_status") gps_modes "GPS_MODE"; a.ap_mode <- check_index (get_pprz_mode (ivalue "ap_mode")) ap_modes "BOOZ_AP_MODE"; a.kill_mode <- ivalue "ap_motors_on" == 0; diff --git a/sw/ground_segment/tmtc/fw_server.ml b/sw/ground_segment/tmtc/fw_server.ml index ce4a4fe2ba..1375c9dd28 100644 --- a/sw/ground_segment/tmtc/fw_server.ml +++ b/sw/ground_segment/tmtc/fw_server.ml @@ -103,8 +103,6 @@ let log_and_parse = fun ac_name (a:Aircraft.aircraft) msg values -> a.last_msg_date <- U.gettimeofday (); match msg.Pprz.name with "GPS" -> - a.gps_mode <- check_index (ivalue "mode") gps_modes "GPS_MODE"; - if a.gps_mode = _3D then begin let p = { LL.utm_x = fvalue "utm_east" /. 100.; utm_y = fvalue "utm_north" /. 100.; utm_zone = ivalue "utm_zone" } in @@ -116,9 +114,9 @@ let log_and_parse = fun ac_name (a:Aircraft.aircraft) msg values -> if !heading_from_course then a.heading <- a.course; a.agl <- a.alt -. float (try Srtm.of_wgs84 a.pos with _ -> 0); + a.gps_mode <- check_index (ivalue "mode") gps_modes "GPS_MODE"; if a.gspeed > 3. && a.ap_mode = _AUTO2 then Wind.update ac_name a.gspeed a.course - end | "GPS_LLA" -> let lat = ivalue "lat" and lon = ivalue "lon" in @@ -145,6 +143,9 @@ let log_and_parse = fun ac_name (a:Aircraft.aircraft) msg values -> Some nav_ref -> let x = (try fvalue "x" with _ -> fvalue "desired_x") and y = (try fvalue "y" with _ -> fvalue "desired_y") in + (*let target_utm = LL.utm_add (LL.utm_of nav_ref) (x, y) in + let target_geo = LL.of_utm WGS84 target_utm in + a.desired_pos <- target_geo;*) a.desired_pos <- Aircraft.add_pos_to_nav_ref nav_ref (x, y); | None -> () end; diff --git a/sw/ground_segment/tmtc/server.ml b/sw/ground_segment/tmtc/server.ml index a66e209bad..33dd4fd378 100644 --- a/sw/ground_segment/tmtc/server.ml +++ b/sw/ground_segment/tmtc/server.ml @@ -151,7 +151,8 @@ let send_cam_status = fun a -> let alpha = -. a.course in let east = dx *. cos alpha -. dy *. sin alpha and north = dx *. sin alpha +. dy *. cos alpha in - let wgs84 = Aircraft.add_pos_to_nav_ref (Geo a.pos) (east, north) in + let utm = LL.utm_add (LL.utm_of WGS84 a.pos) (east, north) in + let wgs84 = LL.of_utm WGS84 utm in let twgs84 = Aircraft.add_pos_to_nav_ref nav_ref a.cam.target in let values = ["ac_id", Pprz.String a.id; "cam_lat", Pprz.Float ((Rad>>Deg)wgs84.posn_lat); diff --git a/sw/ground_segment/tmtc/server_globals.ml b/sw/ground_segment/tmtc/server_globals.ml index 0255bca0b1..4b6d968488 100644 --- a/sw/ground_segment/tmtc/server_globals.ml +++ b/sw/ground_segment/tmtc/server_globals.ml @@ -8,7 +8,6 @@ let _AUTO2 = 2 let gaz_modes = [|"MANUAL";"GAZ";"CLIMB";"ALT"|] let lat_modes = [|"MANUAL";"ROLL_RATE";"ROLL";"COURSE"|] let gps_modes = [|"NOFIX";"DRO";"2D";"3D";"GPSDRO"|] -let _3D = 3 let gps_hybrid_modes = [|"OFF";"ON"|] let horiz_modes = [|"WAYPOINT";"ROUTE";"CIRCLE";"ATTITUDE"|] diff --git a/sw/simulator/data.ml b/sw/simulator/data.ml index 8c8d281751..64801395b6 100644 --- a/sw/simulator/data.ml +++ b/sw/simulator/data.ml @@ -2,7 +2,7 @@ * $Id$ * * Usefull data for simulation - * + * * Copyright (C) 2004 Pascal Brisset, Antoine Drouin * * This file is part of paparazzi. @@ -20,7 +20,7 @@ * 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. + * Boston, MA 02111-1307, USA. * *) @@ -44,7 +44,7 @@ let messages_ap = type aircraft = { name : string; id : int; - airframe : Xml.xml; + airframe : Xml.xml; flight_plan : Xml.xml; radio: Xml.xml } @@ -55,7 +55,7 @@ let aircraft = fun name -> let rec loop = function [] -> failwith ("Aircraft not found : "^name) | x::_ when Xml.tag x = "aircraft" && Xml.attrib x "name" = name -> - begin + begin try (x, int_of_string (Xml.attrib x "ac_id")) with @@ -64,7 +64,7 @@ let aircraft = fun name -> end | _x::xs -> loop xs in loop (Xml.children conf_xml) in - + let airframe_file = user_conf_path // ExtXml.attrib aircraft_xml "airframe" in { id = id; name = name; diff --git a/sw/simulator/diffusion.ml b/sw/simulator/diffusion.ml index 5e7b7cb7fa..cfe0b76f49 100644 --- a/sw/simulator/diffusion.ml +++ b/sw/simulator/diffusion.ml @@ -14,7 +14,7 @@ let source = fun () -> { utm_x = muret.LL.utm_x -. 300.; utm_y = muret.LL.utm_y let available_ids = ref [] let gen_id = let x = ref 0 in - fun () -> + fun () -> match !available_ids with [] -> incr x; !x @@ -31,7 +31,7 @@ let ivy_bus = ref "127.255.255.255:2010" let plumes = Hashtbl.create 97 -let t = ref 0 +let t = ref 0 let one_step = fun () -> incr t; @@ -39,7 +39,7 @@ let one_step = fun () -> (* New plume *) if !t mod 5 = 0 then Hashtbl.add plumes (gen_id ()) (source ()); - + (* Eddy + wind *) Hashtbl.iter (fun id plume -> let a = Random.float (2.*.LL.pi) in @@ -50,7 +50,7 @@ let one_step = fun () -> Hashtbl.remove plumes id; available_ids := id :: !available_ids; end) - plumes + plumes let my_id = "diffusion" diff --git a/sw/simulator/fg.c b/sw/simulator/fg.c index 77157ee975..63493b2a30 100644 --- a/sw/simulator/fg.c +++ b/sw/simulator/fg.c @@ -34,13 +34,13 @@ value fg_msg_native(value s, value lat, value lon, value z, value phi, value the msg.phi = Double_val(phi); msg.theta = Double_val(theta); msg.psi = - Double_val(psi) + M_PI_2; - + msg.vcas = 0.; msg.climb_rate = 0.; - + msg.num_tanks = 1; msg.fuel_quantity[0] = 10.; - + msg.cur_time = 3213092700ul;//time(NULL); msg.warp = 0; msg.ground_elev = 0.; diff --git a/sw/simulator/flightModel.ml b/sw/simulator/flightModel.ml index e08465df0f..7efae5f85d 100644 --- a/sw/simulator/flightModel.ml +++ b/sw/simulator/flightModel.ml @@ -2,7 +2,7 @@ * $Id$ * * Basic flight model for simulation - * + * * Copyright (C) 2004-2006 Pascal Brisset, Antoine Drouin * * This file is part of paparazzi. @@ -20,7 +20,7 @@ * 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. + * Boston, MA 02111-1307, USA. * *) @@ -97,16 +97,16 @@ module Make(A:Data.MISSION) = struct try float_of_string x with Failure "float_of_string" -> failwith (sprintf "float_of_string: %s" x) - let simu_section = + let simu_section = try section "SIMU" with _ -> Xml.Element("", [], []) - let roll_response_factor = + let roll_response_factor = try float_value simu_section "ROLL_RESPONSE_FACTOR" with _ -> 15. - let yaw_response_factor = + let yaw_response_factor = try float_value simu_section "YAW_RESPONSE_FACTOR" with _ -> 1. - let weight = + let weight = try float_value simu_section "WEIGHT" with _ -> 1. let max_bat_level = @@ -129,10 +129,10 @@ module Make(A:Data.MISSION) = struct Not_found -> failwith (Printf.sprintf "Child 'commands' expected in '%s'\n" (Xml.to_string A.ac.airframe)) - let command = fun n -> + let command = fun n -> try List.assoc n commands with Not_found -> failwith (sprintf "Unknown command '%s'" n) - + let misc_section = section "MISC" let infrared_section = try section "INFRARED" with _ -> Xml.Element("",[],[]) @@ -150,11 +150,11 @@ module Make(A:Data.MISSION) = struct let min_thrust = 0 let max_thrust = max_pprz - + let command_throttle = command "THROTTLE" let command_roll = command "ROLL" let command_pitch = command "PITCH" - + let float_attrib = fun x a -> float_of_string (ExtXml.attrib x a) let int_attrib = fun x a -> int_of_string (ExtXml.attrib x a) @@ -216,7 +216,7 @@ module Make(A:Data.MISSION) = struct let z_dot_dot = lift /. weight *. cos state.theta *. cos state.phi -. g in state.z_dot <- state.z_dot +. z_dot_dot *.dt; state.z <- state.z +. state.z_dot *. dt; - + (* Constant Cx, drag to get expected cruise and maximum throttle *) let drag = cruise_thrust +. (v2 -. vn2)*.(1.-. cruise_thrust)/.(maximum_airspeed ** 2. -. vn2) in let air_speed_dot = max_power /. state.air_speed *. (state.thrust -. drag) /. weight -. g *. sin gamma in diff --git a/sw/simulator/flight_gear.h b/sw/simulator/flight_gear.h index 18cb92db5c..c51349f384 100644 --- a/sw/simulator/flight_gear.h +++ b/sw/simulator/flight_gear.h @@ -2,11 +2,11 @@ #define FLIGHT_GEAR_H #include - + #define FG_NET_CTRLS_VERSION 26 -#define FG_NET_CTRLS_MAX_ENGINES 4 -#define FG_NET_CTRLS_MAX_WHEELS 16 -#define FG_NET_CTRLS_MAX_TANKS 6 +#define FG_NET_CTRLS_MAX_ENGINES 4 +#define FG_NET_CTRLS_MAX_WHEELS 16 +#define FG_NET_CTRLS_MAX_TANKS 6 struct FGNetCtrls { uint32_t version; // increment when data values change @@ -91,9 +91,9 @@ struct FGNetCtrls { #define FG_NET_FDM_VERSION 23 -#define FG_NET_FDM_MAX_ENGINES 4 -#define FG_NET_FDM_MAX_WHEELS 3 -#define FG_NET_FDM_MAX_TANKS 4 +#define FG_NET_FDM_MAX_ENGINES 4 +#define FG_NET_FDM_MAX_WHEELS 3 +#define FG_NET_FDM_MAX_TANKS 4 struct FGNetFDM { @@ -127,7 +127,7 @@ struct FGNetFDM { // relative to local airmass, fps float v_wind_body_down; // down/vertical velocity in local/body // frame relative to local airmass, fps - + // Accelerations float A_X_pilot; // X accel in body frame ft/sec^2 float A_Y_pilot; // Y accel in body frame ft/sec^2 @@ -135,9 +135,9 @@ struct FGNetFDM { // Stall float stall_warning; // 0.0 - 1.0 indicating the amount of stall float slip_deg; // slip ball deflection - + // Pressure - + // Engine status uint32_t num_engines; // Number of valid engines uint32_t eng_state[FG_NET_FDM_MAX_ENGINES];// Engine state (off, cranking, running) @@ -149,24 +149,24 @@ struct FGNetFDM { float tit[FG_NET_FDM_MAX_ENGINES]; // Turbine Inlet Temperature float oil_temp[FG_NET_FDM_MAX_ENGINES]; // Oil temp deg F float oil_px[FG_NET_FDM_MAX_ENGINES]; // Oil pressure psi - + // Consumables uint32_t num_tanks; // Max number of fuel tanks float fuel_quantity[FG_NET_FDM_MAX_TANKS]; - + // Gear status uint32_t num_wheels; uint32_t wow[FG_NET_FDM_MAX_WHEELS]; float gear_pos[FG_NET_FDM_MAX_WHEELS]; float gear_steer[FG_NET_FDM_MAX_WHEELS]; float gear_compression[FG_NET_FDM_MAX_WHEELS]; - + // Environment uint32_t cur_time; // current unix time // FIXME: make this uint64_t before 2038 int32_t warp; // offset in seconds to unix time float visibility; // visibility in meters (for env. effects) - + // Control surface positions (normalized values) float elevator; float elevator_trim_tab; @@ -218,7 +218,7 @@ struct FGNetGUI { float phi; // roll (radians) float theta; // pitch (radians) float psi; // yaw or true heading (radians) - + // Velocities float vcas; float climb_rate; // feet per second diff --git a/sw/simulator/gaia.ml b/sw/simulator/gaia.ml index 2b261518dd..d145f7de84 100644 --- a/sw/simulator/gaia.ml +++ b/sw/simulator/gaia.ml @@ -2,7 +2,7 @@ * $Id$ * * World environment (time, wind, ...) for multi-AC simulation - * + * * Copyright (C) 2004 Pascal Brisset, Antoine Drouin * * This file is part of paparazzi. @@ -20,7 +20,7 @@ * 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. + * Boston, MA 02111-1307, USA. * *) @@ -71,7 +71,7 @@ let _ = let world_send = fun () -> Ground_Pprz.message_send my_id "WORLD_ENV" (world_values []) in - List.iter + List.iter (fun (a:GData.adjustment) -> ignore (a#connect#value_changed world_send)) [time_scale; wind_dir_adj; wind_speed_adj; infrared_contrast_adj]; ignore (gps_sa#connect#toggled world_send); @@ -83,7 +83,7 @@ let _ = let hbox = GPack.hbox ~packing:vbox#pack () in let _ = GMisc.label ~text:"Time scale:" ~packing:hbox#pack () in let _ts = GEdit.spin_button ~adjustment:time_scale ~packing:hbox#add () in - + let hbox = GPack.hbox ~packing:vbox#pack () in ignore (GMisc.label ~text:"Wind dir:" ~packing:hbox#pack ()); ignore (GRange.scale ~digits:0 `HORIZONTAL ~adjustment:wind_dir_adj ~packing:hbox#add ()); @@ -91,7 +91,7 @@ let _ = let hbox = GPack.hbox ~packing:vbox#pack () in ignore (GMisc.label ~text:"Wind speed:" ~packing:hbox#pack ()); ignore (GRange.scale `HORIZONTAL ~adjustment:wind_speed_adj ~packing:hbox#add ()); - + vbox#pack gps_sa#coerce; Ivy.init "Paparazzi gaia" "READY" (fun _ _ -> ()); diff --git a/sw/simulator/gps.ml b/sw/simulator/gps.ml index 1cedda0920..d894e0c22b 100644 --- a/sw/simulator/gps.ml +++ b/sw/simulator/gps.ml @@ -2,7 +2,7 @@ * $Id$ * * Basic GPS parameters simulation - * + * * Copyright (C) 2004 Pascal Brisset, Antoine Drouin * * This file is part of paparazzi. @@ -20,14 +20,14 @@ * 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. + * Boston, MA 02111-1307, USA. * *) open Stdlib open Latlong -type state = { +type state = { mutable availability : bool; wgs84 : Latlong.geographic; alt : float; @@ -58,7 +58,7 @@ let state = fun pos0 alt0 -> last_course := norm_angle (pi/.2. -. atan2 dy dx); last_climb := (z -. !last_z) /. dt end; (** Else use previous derivatives *) - + let utm0 = utm_of WGS84 !pos0 in let utm = utm_add utm0 (x, y) in let wgs84 = of_utm WGS84 utm @@ -70,7 +70,7 @@ let state = fun pos0 alt0 -> last_t := t; let course = if !last_course < 0. then !last_course +. 2. *. pi else !last_course in - + { wgs84 = wgs84; alt = alt; @@ -80,4 +80,4 @@ let state = fun pos0 alt0 -> course = course; availability = true; } - + diff --git a/sw/simulator/hitl.ml b/sw/simulator/hitl.ml index e3cbf95e7a..c7f3d98c60 100644 --- a/sw/simulator/hitl.ml +++ b/sw/simulator/hitl.ml @@ -2,7 +2,7 @@ * $Id$ * * Hardware In The Loop - * + * * Copyright (C) 2004 Pascal Brisset, Antoine Drouin * * This file is part of paparazzi. @@ -20,7 +20,7 @@ * 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. + * Boston, MA 02111-1307, USA. * *) @@ -58,12 +58,12 @@ module Make (A:Data.MISSION) (FM: FlightModel.SIG) = struct "class", Pprz.Int class_id; "id", Pprz.Int msg_id; "ubx_payload", Pprz.String s] in - + try DatalinkPprz.message_send "hitl" "HITL_UBX" vs with exc -> prerr_endline (Printexc.to_string exc) - + let gps = fun gps -> let utm = LL.utm_of LL.WGS84 gps.wgs84 @@ -86,7 +86,7 @@ module Make (A:Data.MISSION) (FM: FlightModel.SIG) = struct "VEL_D", -scale gps.climb 1e2; "GSpeed", scale gps.gspeed 1e2; "Heading", scale (deg_of_rad gps.course) 1e5] - + let infrared = fun ir_left ir_front ir_top _air_speed -> try DatalinkPprz.message_send "hitl" "HITL_INFRARED" @@ -96,7 +96,7 @@ module Make (A:Data.MISSION) (FM: FlightModel.SIG) = struct "pitch", Pprz.Int (truncate ir_front)] with exc -> prerr_endline (Printexc.to_string exc) - + let sep_reg = Str.regexp Pprz.separator let read_commands = fun commands _sender values -> let s = Pprz.string_assoc "values" values in diff --git a/sw/simulator/nps/nps_autopilot.h b/sw/simulator/nps/nps_autopilot.h index 4d0bb29b2d..a6c7101153 100644 --- a/sw/simulator/nps/nps_autopilot.h +++ b/sw/simulator/nps/nps_autopilot.h @@ -1,7 +1,7 @@ #ifndef NPS_AUTOPILOT_H #define NPS_AUTOPILOT_H -#include "airframe.h" +#include "generated/airframe.h" #include "nps_radio_control.h" diff --git a/sw/simulator/nps/nps_fdm_jsbsim.c b/sw/simulator/nps/nps_fdm_jsbsim.c index 6fecb8e085..5d5a726c9a 100644 --- a/sw/simulator/nps/nps_fdm_jsbsim.c +++ b/sw/simulator/nps/nps_fdm_jsbsim.c @@ -5,7 +5,7 @@ #include #include "nps_fdm.h" #include "6dof.h" -#include "airframe.h" +#include "generated/airframe.h" #include "math/pprz_geodetic.h" #include "math/pprz_geodetic_double.h" #include "math/pprz_geodetic_float.h" diff --git a/sw/simulator/nps/nps_ivy.c b/sw/simulator/nps/nps_ivy.c index 699a651096..43a3a5251d 100644 --- a/sw/simulator/nps/nps_ivy.c +++ b/sw/simulator/nps/nps_ivy.c @@ -4,7 +4,7 @@ #include #include -#include "airframe.h" +#include "generated/airframe.h" #include "math/pprz_algebra_double.h" #include "nps_autopilot.h" #include "nps_fdm.h" @@ -49,7 +49,7 @@ void nps_ivy_init(void) { //FIXME currently parsed correctly for booz only -#include "settings.h" +#include "generated/settings.h" #include "dl_protocol.h" #include "downlink.h" static void on_DL_SETTING(IvyClientPtr app __attribute__ ((unused)), diff --git a/sw/simulator/nps/nps_ivy.h b/sw/simulator/nps/nps_ivy.h index 7606a77e39..3961749ebe 100644 --- a/sw/simulator/nps/nps_ivy.h +++ b/sw/simulator/nps/nps_ivy.h @@ -2,6 +2,6 @@ #define NPS_IVY extern void nps_ivy_init(void); -extern void nps_ivy_display(void); +extern void nps_ivy_display(void); #endif /* NPS_IVY */ diff --git a/sw/simulator/nps/nps_radio_control_spektrum.c b/sw/simulator/nps/nps_radio_control_spektrum.c index 07a0295d68..a51f64e6a8 100644 --- a/sw/simulator/nps/nps_radio_control_spektrum.c +++ b/sw/simulator/nps/nps_radio_control_spektrum.c @@ -20,7 +20,7 @@ static void handle_frame(void); int nps_radio_control_spektrum_init(const char* device) { - + if ((sp_fd = open(device, O_RDWR | O_NONBLOCK)) < 0) { printf("opening %s (%s)\n", device, strerror(errno)); return -1; @@ -38,7 +38,7 @@ int nps_radio_control_spektrum_init(const char* device) { termios.c_lflag |= NOFLSH; /* speed */ speed_t speed = B115200; - + if (cfsetispeed(&termios, speed)) { printf("setting term speed (%s)\n", strerror(errno)); return -1; diff --git a/sw/simulator/nps/nps_sensor_accel.c b/sw/simulator/nps/nps_sensor_accel.c index 90857ed03a..9876ed7869 100644 --- a/sw/simulator/nps/nps_sensor_accel.c +++ b/sw/simulator/nps/nps_sensor_accel.c @@ -1,6 +1,6 @@ #include "nps_sensor_accel.h" -#include "airframe.h" /* to get NPS_SENSORS_PARAMS */ +#include "generated/airframe.h" /* to get NPS_SENSORS_PARAMS */ #include "nps_fdm.h" #include "nps_random.h" @@ -10,13 +10,13 @@ void nps_sensor_accel_init(struct NpsSensorAccel* accel, double time) { FLOAT_VECT3_ZERO(accel->value); accel->resolution = NPS_ACCEL_RESOLUTION; - FLOAT_MAT33_DIAG(accel->sensitivity, + FLOAT_MAT33_DIAG(accel->sensitivity, NPS_ACCEL_SENSITIVITY_XX, NPS_ACCEL_SENSITIVITY_YY, NPS_ACCEL_SENSITIVITY_ZZ); - VECT3_ASSIGN(accel->neutral, + VECT3_ASSIGN(accel->neutral, NPS_ACCEL_NEUTRAL_X, NPS_ACCEL_NEUTRAL_Y, NPS_ACCEL_NEUTRAL_Z); - VECT3_ASSIGN(accel->noise_std_dev, + VECT3_ASSIGN(accel->noise_std_dev, NPS_ACCEL_NOISE_STD_DEV_X, NPS_ACCEL_NOISE_STD_DEV_Y, NPS_ACCEL_NOISE_STD_DEV_Z); - VECT3_ASSIGN(accel->bias, + VECT3_ASSIGN(accel->bias, NPS_ACCEL_BIAS_X, NPS_ACCEL_BIAS_Y, NPS_ACCEL_BIAS_Z); accel->next_update = time; accel->data_available = FALSE; @@ -28,12 +28,12 @@ void nps_sensor_accel_run_step(struct NpsSensorAccel* accel, double time, stru if (time < accel->next_update) return; - + /* transform gravity to body frame */ struct DoubleVect3 g_body; FLOAT_QUAT_VMULT(g_body, fdm.ltp_to_body_quat, fdm.ltp_g); // printf(" g_body %f %f %f\n", g_body.x, g_body.y, g_body.z); - + // printf(" accel_fdm %f %f %f\n", fdm.body_ecef_accel.x, fdm.body_ecef_accel.y, fdm.body_ecef_accel.z); /* substract gravity to acceleration in body frame */ @@ -45,7 +45,7 @@ void nps_sensor_accel_run_step(struct NpsSensorAccel* accel, double time, stru /* transform to imu frame */ struct DoubleVect3 accelero_imu; MAT33_VECT3_MUL(accelero_imu, *body_to_imu, accelero_body ); - + /* compute accelero readings */ MAT33_VECT3_MUL(accel->value, accel->sensitivity, accelero_imu); VECT3_ADD(accel->value, accel->neutral); @@ -65,8 +65,8 @@ void nps_sensor_accel_run_step(struct NpsSensorAccel* accel, double time, stru /* round signal to account for adc discretisation */ DOUBLE_VECT3_ROUND(accel->value); /* saturate */ - VECT3_BOUND_CUBE(accel->value, 0, accel->resolution); - + VECT3_BOUND_CUBE(accel->value, 0, accel->resolution); + accel->next_update += NPS_ACCEL_DT; accel->data_available = TRUE; } diff --git a/sw/simulator/nps/nps_sensor_baro.c b/sw/simulator/nps/nps_sensor_baro.c index c55160c3e6..f0fdce2686 100644 --- a/sw/simulator/nps/nps_sensor_baro.c +++ b/sw/simulator/nps/nps_sensor_baro.c @@ -1,6 +1,6 @@ #include "nps_sensor_baro.h" -#include "airframe.h" +#include "generated/airframe.h" #include "std.h" #include "nps_fdm.h" diff --git a/sw/simulator/nps/nps_sensor_gps.c b/sw/simulator/nps/nps_sensor_gps.c index a5667e122f..1ef6abe838 100644 --- a/sw/simulator/nps/nps_sensor_gps.c +++ b/sw/simulator/nps/nps_sensor_gps.c @@ -1,7 +1,7 @@ #include "nps_sensor_gps.h" -#include "airframe.h" +#include "generated/airframe.h" #include "nps_fdm.h" #include "nps_random.h" #include "nps_sensors_utils.h" diff --git a/sw/simulator/nps/nps_sensor_gyro.c b/sw/simulator/nps/nps_sensor_gyro.c index 9cffe9341b..0fe36283ff 100644 --- a/sw/simulator/nps/nps_sensor_gyro.c +++ b/sw/simulator/nps/nps_sensor_gyro.c @@ -1,6 +1,6 @@ #include "nps_sensor_gyro.h" -#include "airframe.h" +#include "generated/airframe.h" #include "nps_fdm.h" #include NPS_SENSORS_PARAMS #include "math/pprz_algebra_int.h" @@ -9,17 +9,17 @@ void nps_sensor_gyro_init(struct NpsSensorGyro* gyro, double time) { FLOAT_VECT3_ZERO(gyro->value); gyro->resolution = NPS_GYRO_RESOLUTION; - FLOAT_MAT33_DIAG(gyro->sensitivity, + FLOAT_MAT33_DIAG(gyro->sensitivity, NPS_GYRO_SENSITIVITY_PP, NPS_GYRO_SENSITIVITY_QQ, NPS_GYRO_SENSITIVITY_RR); - VECT3_ASSIGN(gyro->neutral, + VECT3_ASSIGN(gyro->neutral, NPS_GYRO_NEUTRAL_P, NPS_GYRO_NEUTRAL_Q, NPS_GYRO_NEUTRAL_R); - VECT3_ASSIGN(gyro->noise_std_dev, + VECT3_ASSIGN(gyro->noise_std_dev, NPS_GYRO_NOISE_STD_DEV_P, NPS_GYRO_NOISE_STD_DEV_Q, NPS_GYRO_NOISE_STD_DEV_R); - VECT3_ASSIGN(gyro->bias_initial, + VECT3_ASSIGN(gyro->bias_initial, NPS_GYRO_BIAS_INITIAL_P, NPS_GYRO_BIAS_INITIAL_Q, NPS_GYRO_BIAS_INITIAL_R); - VECT3_ASSIGN(gyro->bias_random_walk_std_dev, - NPS_GYRO_BIAS_RANDOM_WALK_STD_DEV_P, - NPS_GYRO_BIAS_RANDOM_WALK_STD_DEV_Q, + VECT3_ASSIGN(gyro->bias_random_walk_std_dev, + NPS_GYRO_BIAS_RANDOM_WALK_STD_DEV_P, + NPS_GYRO_BIAS_RANDOM_WALK_STD_DEV_Q, NPS_GYRO_BIAS_RANDOM_WALK_STD_DEV_R); FLOAT_VECT3_ZERO(gyro->bias_random_walk_value); gyro->next_update = time; @@ -27,7 +27,7 @@ void nps_sensor_gyro_init(struct NpsSensorGyro* gyro, double time) { } void nps_sensor_gyro_run_step(struct NpsSensorGyro* gyro, double time, struct DoubleRMat* body_to_imu) { - + if (time < gyro->next_update) return; @@ -42,20 +42,20 @@ void nps_sensor_gyro_run_step(struct NpsSensorGyro* gyro, double time, struct Do struct DoubleVect3 gyro_error; VECT3_COPY(gyro_error, gyro->bias_initial); double_vect3_add_gaussian_noise(&gyro_error, &gyro->noise_std_dev); - double_vect3_update_random_walk(&gyro->bias_random_walk_value, &gyro->bias_random_walk_std_dev, + double_vect3_update_random_walk(&gyro->bias_random_walk_value, &gyro->bias_random_walk_std_dev, NPS_GYRO_DT, 5.); VECT3_ADD(gyro_error, gyro->bias_random_walk_value); struct DoubleVect3 gain = {NPS_GYRO_SENSITIVITY_PP, NPS_GYRO_SENSITIVITY_QQ, NPS_GYRO_SENSITIVITY_RR}; VECT3_EW_MUL(gyro_error, gyro_error, gain); - + VECT3_ADD(gyro->value, gyro_error); /* round signal to account for adc discretisation */ DOUBLE_VECT3_ROUND(gyro->value); /* saturate */ - VECT3_BOUND_CUBE(gyro->value, 0, gyro->resolution); - + VECT3_BOUND_CUBE(gyro->value, 0, gyro->resolution); + gyro->next_update += NPS_GYRO_DT; gyro->data_available = TRUE; } diff --git a/sw/simulator/nps/nps_sensor_mag.c b/sw/simulator/nps/nps_sensor_mag.c index 8839f38433..6ab23030a9 100644 --- a/sw/simulator/nps/nps_sensor_mag.c +++ b/sw/simulator/nps/nps_sensor_mag.c @@ -1,6 +1,6 @@ #include "nps_sensor_mag.h" -#include "airframe.h" +#include "generated/airframe.h" #include "nps_fdm.h" #include NPS_SENSORS_PARAMS #include "math/pprz_algebra_int.h" @@ -8,13 +8,13 @@ void nps_sensor_mag_init(struct NpsSensorMag* mag, double time) { VECT3_ASSIGN(mag->value, 0., 0., 0.); // mag->resolution = NPS_MAG_RESOLUTION; - FLOAT_MAT33_DIAG(mag->sensitivity, + FLOAT_MAT33_DIAG(mag->sensitivity, NPS_MAG_SENSITIVITY_XX, NPS_MAG_SENSITIVITY_YY, NPS_MAG_SENSITIVITY_ZZ); - VECT3_ASSIGN(mag->neutral, + VECT3_ASSIGN(mag->neutral, NPS_MAG_NEUTRAL_X, NPS_MAG_NEUTRAL_Y, NPS_MAG_NEUTRAL_Z); - VECT3_ASSIGN(mag->noise_std_dev, + VECT3_ASSIGN(mag->noise_std_dev, NPS_MAG_NOISE_STD_DEV_X, NPS_MAG_NOISE_STD_DEV_Y, NPS_MAG_NOISE_STD_DEV_Z); - struct DoubleEulers imu_to_sensor_eulers = + struct DoubleEulers imu_to_sensor_eulers = { NPS_MAG_IMU_TO_SENSOR_PHI, NPS_MAG_IMU_TO_SENSOR_THETA, NPS_MAG_IMU_TO_SENSOR_PSI }; DOUBLE_RMAT_OF_EULERS(mag->imu_to_sensor_rmat, imu_to_sensor_eulers); mag->next_update = time; @@ -25,15 +25,15 @@ void nps_sensor_mag_run_step(struct NpsSensorMag* mag, double time, struct Doubl if (time < mag->next_update) return; - + /* transform magnetic field to body frame */ struct DoubleVect3 h_body; FLOAT_QUAT_VMULT(h_body, fdm.ltp_to_body_quat, fdm.ltp_h); - + /* transform to imu frame */ struct DoubleVect3 h_imu; MAT33_VECT3_MUL(h_imu, *body_to_imu, h_body ); - + /* transform to sensor frame */ struct DoubleVect3 h_sensor; MAT33_VECT3_MUL(h_sensor, mag->imu_to_sensor_rmat, h_imu ); @@ -42,12 +42,12 @@ void nps_sensor_mag_run_step(struct NpsSensorMag* mag, double time, struct Doubl MAT33_VECT3_MUL(mag->value, mag->sensitivity, h_sensor); VECT3_ADD(mag->value, mag->neutral); /* FIXME: ADD error reading */ - + /* round signal to account for adc discretisation */ DOUBLE_VECT3_ROUND(mag->value); /* saturate */ - // VECT3_BOUND_CUBE(mag->value, 0, mag->resolution); - + // VECT3_BOUND_CUBE(mag->value, 0, mag->resolution); + mag->next_update += NPS_MAG_DT; mag->data_available = TRUE; } diff --git a/sw/simulator/nps/nps_sensors.c b/sw/simulator/nps/nps_sensors.c index be26cc83ad..35e7dc04d6 100644 --- a/sw/simulator/nps/nps_sensors.c +++ b/sw/simulator/nps/nps_sensors.c @@ -1,13 +1,13 @@ #include "nps_sensors.h" -#include "airframe.h" +#include "generated/airframe.h" #include NPS_SENSORS_PARAMS struct NpsSensors sensors; void nps_sensors_init(double time) { - struct DoubleEulers body_to_imu_eulers = + struct DoubleEulers body_to_imu_eulers = { NPS_BODY_TO_IMU_PHI, NPS_BODY_TO_IMU_THETA, NPS_BODY_TO_IMU_PSI }; DOUBLE_RMAT_OF_EULERS(sensors.body_to_imu_rmat, body_to_imu_eulers); diff --git a/sw/simulator/old_booz/booz2_sim_main.c b/sw/simulator/old_booz/booz2_sim_main.c index aa5526c937..f2926eef8d 100644 --- a/sw/simulator/old_booz/booz2_sim_main.c +++ b/sw/simulator/old_booz/booz2_sim_main.c @@ -1,6 +1,6 @@ /* * $Id$ - * + * * Copyright (C) 2008 Antoine Drouin * * This file is part of paparazzi. @@ -18,7 +18,7 @@ * 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. + * Boston, MA 02111-1307, USA. * */ @@ -74,14 +74,14 @@ static void booz2_sim_display(void); static void booz_sim_read_actuators(void); static void ivy_transport_init(void); -static void on_DL_SETTING(IvyClientPtr app __attribute__ ((unused)), - void *user_data __attribute__ ((unused)), +static void on_DL_SETTING(IvyClientPtr app __attribute__ ((unused)), + void *user_data __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[]); -static void on_DL_BLOCK(IvyClientPtr app __attribute__ ((unused)), - void *user_data __attribute__ ((unused)), +static void on_DL_BLOCK(IvyClientPtr app __attribute__ ((unused)), + void *user_data __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[]); -static void on_DL_MOVE_WP(IvyClientPtr app __attribute__ ((unused)), - void *user_data __attribute__ ((unused)), +static void on_DL_MOVE_WP(IvyClientPtr app __attribute__ ((unused)), + void *user_data __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[]); @@ -90,7 +90,7 @@ static void booz2_sim_init(void) { gettimeofday (&host_time_start, NULL); sim_time = 0.; disp_time = 0.; - + booz_flight_model_init(); booz_sensors_model_init(sim_time); @@ -113,17 +113,17 @@ static gboolean booz2_sim_periodic(gpointer data __attribute__ ((unused))) { host_time_elapsed = host_time_factor * ((host_time_now.tv_sec - host_time_start.tv_sec) + (host_time_now.tv_usec - host_time_start.tv_usec)*1e-6); - + while (sim_time <= host_time_elapsed) { sim_run_one_step(); sim_time += SIM_DT; - } - - - + } + + + return TRUE; } - + #include "subsystems/ahrs.h" @@ -131,7 +131,7 @@ static void sim_run_one_step(void) { /* read actuators positions */ booz_sim_read_actuators(); - + /* run our models */ if (sim_time > 13.) bfm.on_ground = FALSE; @@ -142,12 +142,12 @@ static void sim_run_one_step(void) { booz_sensors_model_run(sim_time); battery_voltage = bfm.bat_voltage * 10; - + /* outputs models state */ booz2_sim_display(); /* run the airborne code */ - + // feed a rc frame and signal event BoozRcSimFeed(sim_time); // process it @@ -175,7 +175,7 @@ static void sim_run_one_step(void) { sim_gps_feed_data(); main_event(); } - + if (booz_sensors_model_mag_available()) { sim_mag_feed_data(); main_event(); @@ -183,7 +183,7 @@ static void sim_run_one_step(void) { sim_overwrite_ahrs(); #endif /* BYPASS_AHRS */ } - + main_periodic(); @@ -233,7 +233,7 @@ static void sim_gps_feed_data(void) { // speed? // booz2_gps_vel_n = rint(bsm.gps_speed->ve[AXIS_X] * 100.); // booz2_gps_vel_e = rint(bsm.gps_speed->ve[AXIS_Y] * 100.); - + booz_gps_state.ecef_pos.x = rint(bsm.gps_pos_ecef.x); booz_gps_state.ecef_pos.y = rint(bsm.gps_pos_ecef.y); @@ -260,41 +260,41 @@ static void booz2_sim_display(void) { if (sim_time >= disp_time) { disp_time+= DT_DISPLAY; // booz_flightgear_send(); - IvySendMsg("%d BOOZ_SIM_RPMS %f %f %f %f", + IvySendMsg("%d BOOZ_SIM_RPMS %f %f %f %f", AC_ID, - RPM_OF_RAD_S(bfm.omega->ve[SERVO_FRONT]), - RPM_OF_RAD_S(bfm.omega->ve[SERVO_BACK]), + RPM_OF_RAD_S(bfm.omega->ve[SERVO_FRONT]), + RPM_OF_RAD_S(bfm.omega->ve[SERVO_BACK]), RPM_OF_RAD_S(bfm.omega->ve[SERVO_RIGHT]), RPM_OF_RAD_S(bfm.omega->ve[SERVO_LEFT]) ); - IvySendMsg("%d BOOZ_SIM_RATE_ATTITUDE %f %f %f %f %f %f", + IvySendMsg("%d BOOZ_SIM_RATE_ATTITUDE %f %f %f %f %f %f", AC_ID, - DegOfRad(bfm.ang_rate_body->ve[AXIS_X]), - DegOfRad(bfm.ang_rate_body->ve[AXIS_Y]), + DegOfRad(bfm.ang_rate_body->ve[AXIS_X]), + DegOfRad(bfm.ang_rate_body->ve[AXIS_Y]), DegOfRad(bfm.ang_rate_body->ve[AXIS_Z]), - DegOfRad(bfm.eulers->ve[AXIS_X]), - DegOfRad(bfm.eulers->ve[AXIS_Y]), + DegOfRad(bfm.eulers->ve[AXIS_X]), + DegOfRad(bfm.eulers->ve[AXIS_Y]), DegOfRad(bfm.eulers->ve[AXIS_Z])); - IvySendMsg("%d BOOZ_SIM_SPEED_POS %f %f %f %f %f %f", + IvySendMsg("%d BOOZ_SIM_SPEED_POS %f %f %f %f %f %f", AC_ID, - (bfm.speed_ltp->ve[AXIS_X]), - (bfm.speed_ltp->ve[AXIS_Y]), + (bfm.speed_ltp->ve[AXIS_X]), + (bfm.speed_ltp->ve[AXIS_Y]), (bfm.speed_ltp->ve[AXIS_Z]), - (bfm.pos_ltp->ve[AXIS_X]), - (bfm.pos_ltp->ve[AXIS_Y]), + (bfm.pos_ltp->ve[AXIS_X]), + (bfm.pos_ltp->ve[AXIS_Y]), (bfm.pos_ltp->ve[AXIS_Z])); #if 0 - IvySendMsg("%d BOOZ_SIM_WIND %f %f %f", + IvySendMsg("%d BOOZ_SIM_WIND %f %f %f", AC_ID, - bwm.velocity->ve[AXIS_X], - bwm.velocity->ve[AXIS_Y], + bwm.velocity->ve[AXIS_X], + bwm.velocity->ve[AXIS_Y], bwm.velocity->ve[AXIS_Z]); #endif - IvySendMsg("%d BOOZ_SIM_ACCEL_LTP %f %f %f", + IvySendMsg("%d BOOZ_SIM_ACCEL_LTP %f %f %f", AC_ID, - bfm.accel_ltp->ve[AXIS_X], - bfm.accel_ltp->ve[AXIS_Y], + bfm.accel_ltp->ve[AXIS_X], + bfm.accel_ltp->ve[AXIS_Y], bfm.accel_ltp->ve[AXIS_Z]); - + } } @@ -305,7 +305,7 @@ int main ( int argc, char** argv) { booz2_sim_init(); GMainLoop *ml = g_main_loop_new(NULL, FALSE); - + g_timeout_add(HOST_TIMEOUT_PERIOD, booz2_sim_periodic, NULL); g_main_loop_run(ml); @@ -323,11 +323,11 @@ static void ivy_transport_init(void) { } #include "std.h" -#include "settings.h" +#include "generated/settings.h" #include "dl_protocol.h" #include "downlink.h" -static void on_DL_SETTING(IvyClientPtr app __attribute__ ((unused)), - void *user_data __attribute__ ((unused)), +static void on_DL_SETTING(IvyClientPtr app __attribute__ ((unused)), + void *user_data __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[]){ uint8_t index = atoi(argv[2]); float value = atof(argv[3]); @@ -336,8 +336,8 @@ static void on_DL_SETTING(IvyClientPtr app __attribute__ ((unused)), // printf("setting %d %f\n", index, value); } -static void on_DL_BLOCK(IvyClientPtr app __attribute__ ((unused)), - void *user_data __attribute__ ((unused)), +static void on_DL_BLOCK(IvyClientPtr app __attribute__ ((unused)), + void *user_data __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[]){ int block = atoi(argv[1]); nav_goto_block(block); @@ -345,8 +345,8 @@ static void on_DL_BLOCK(IvyClientPtr app __attribute__ ((unused)), #include "pprz_geodetic_int.h" #include "stdio.h" -static void on_DL_MOVE_WP(IvyClientPtr app __attribute__ ((unused)), - void *user_data __attribute__ ((unused)), +static void on_DL_MOVE_WP(IvyClientPtr app __attribute__ ((unused)), + void *user_data __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[]){ int wp_id = atoi(argv[1]); //int ac_id = atoi(argv[1]); @@ -376,8 +376,8 @@ static void on_DL_MOVE_WP(IvyClientPtr app __attribute__ ((unused)), #include "actuators.h" static void booz_sim_read_actuators(void) { - -// printf("actatuors %d %d %d %d\n", + +// printf("actatuors %d %d %d %d\n", // Actuator(SERVO_FRONT), Actuator(SERVO_BACK), Actuator(SERVO_RIGHT), Actuator(SERVO_LEFT)); int32_t ut_front = Actuator(SERVO_FRONT) - TRIM_FRONT; int32_t ut_back = Actuator(SERVO_BACK) - TRIM_BACK; @@ -425,7 +425,7 @@ static void booz2_sim_parse_options(int argc, char** argv) { long_options, &option_index); if (c == -1) break; - + switch (c) { case 0: switch (option_index) { @@ -441,7 +441,7 @@ static void booz2_sim_parse_options(int argc, char** argv) { case 'j': joystick_dev = strdup(optarg); break; - + default: /* $B!G(B?$B!G(B */ printf("?? getopt returned character code 0%o ??\n", c); fprintf(stderr, usage, argv[0]); diff --git a/sw/simulator/old_booz/booz_flight_model.c b/sw/simulator/old_booz/booz_flight_model.c index d65f1fa364..5aa0029238 100644 --- a/sw/simulator/old_booz/booz_flight_model.c +++ b/sw/simulator/old_booz/booz_flight_model.c @@ -11,11 +11,11 @@ #define BFMS_PSI 8 #define BFMS_P 9 #define BFMS_Q 10 -#define BFMS_R 11 +#define BFMS_R 11 #define BFMS_OM_B 12 #define BFMS_OM_F 13 -#define BFMS_OM_R 14 -#define BFMS_OM_L 15 +#define BFMS_OM_R 14 +#define BFMS_OM_L 15 #define BFMS_SIZE 16 #define BoozFlighModelGetPos(_dest) { \ @@ -70,7 +70,7 @@ static void booz_flight_model_get_derivatives(VEC* X, VEC* u, VEC* Xdot); void booz_flight_model_init( void ) { bfm.on_ground = TRUE; - + bfm.time = 0.; bfm.bat_voltage = BAT_VOLTAGE; bfm.mot_voltage = v_get(SERVOS_NB); @@ -143,12 +143,12 @@ void booz_flight_model_init( void ) { #define WRAP(x,a) { while (x > a) x -= 2 * a; while (x <= -a) x += 2 * a;} void booz_flight_model_run( double dt, double* commands ) { - + int i; for (i=0; ive[i] = bfm.bat_voltage * commands[i]; - // rk4(motor_model_derivative, bfm.mot_omega, bfm.mot_voltage, dt); + // rk4(motor_model_derivative, bfm.mot_omega, bfm.mot_voltage, dt); rk4(booz_flight_model_get_derivatives, bfm.state, bfm.mot_voltage, dt); /* wrap euler angles */ WRAP( bfm.state->ve[BFMS_PHI], M_PI); @@ -165,7 +165,7 @@ static void booz_flight_model_update_byproducts(void) { BoozFlighModelGetAngles( bfm.eulers); /* extract body rotational rates from state */ BoozFlighModelGetRate( bfm.ang_rate_body); - + /* direct cosine matrix ( inertial to body )*/ dcm_of_eulers(bfm.eulers, bfm.dcm); /* transpose of dcm ( body to inertial ) */ @@ -188,18 +188,18 @@ static void booz_flight_model_update_byproducts(void) { /* rotate speed and accel to body frame */ mv_mlt(bfm.dcm, bfm.speed_ltp, bfm.speed_body); mv_mlt(bfm.dcm, bfm.accel_ltp, bfm.accel_body); - + /* rotational accelerations */ - + } -/* - compute the sum of external forces. - assumes that dcm and omega_square are already precomputed from X +/* + compute the sum of external forces. + assumes that dcm and omega_square are already precomputed from X */ static VEC* booz_get_forces_ltp(VEC* F , VEC* speed_ltp, MAT* dcm_t, VEC* omega_square) { @@ -219,7 +219,7 @@ static VEC* booz_get_forces_ltp(VEC* F , VEC* speed_ltp, MAT* dcm_t, VEC* omega_ F = v_add(F, prop_thrust_ltp, F); // gravity - F = v_mltadd(F, bfm.g_ltp, bfm.mass, F); + F = v_mltadd(F, bfm.g_ltp, bfm.mass, F); // drag static VEC *airspeed_ltp = VNULL; @@ -232,9 +232,9 @@ static VEC* booz_get_forces_ltp(VEC* F , VEC* speed_ltp, MAT* dcm_t, VEC* omega_ return F; } -/* - compute the sum of external moments. - assumes that omega_square is already precomputed from X +/* + compute the sum of external moments. + assumes that omega_square is already precomputed from X */ static VEC* booz_get_moments_body_frame(VEC* M, VEC* omega_square ) { if (bfm.on_ground) { @@ -305,7 +305,7 @@ static void booz_flight_model_get_derivatives(VEC* X, VEC* u, VEC* Xdot) { euler_dot_of_pqr->me[EULER_PSI][AXIS_R] = cosPHI/cosTHETA; static VEC *euler_dot = VNULL; euler_dot = v_resize(euler_dot, AXIS_NB); - euler_dot = mv_mlt(euler_dot_of_pqr, rate_body, euler_dot); + euler_dot = mv_mlt(euler_dot_of_pqr, rate_body, euler_dot); Xdot->ve[BFMS_PHI] = euler_dot->ve[EULER_PHI]; Xdot->ve[BFMS_THETA] = euler_dot->ve[EULER_THETA]; Xdot->ve[BFMS_PSI] = euler_dot->ve[EULER_PSI]; @@ -356,7 +356,7 @@ static void motor_model_derivative(VEC* x, VEC* u, VEC* xdot) { // omega_dot = -1/THAU*omega - Kq*omega^2 + Kv/THAU * V; temp1 = sv_mlt(-1./THAU, x, temp1); /* temp1 = -1/THAU * x */ temp2 = v_star(x, x, temp2); /* temp2 = x^2 */ - xdot = v_mltadd(temp1, temp2, -Kq, xdot); /* xdot = temp1 - Kq*temp2 */ - xdot = v_mltadd(xdot, u, Kv/THAU, xdot); /* xdot = xdot + Kv/THAU * u */ + xdot = v_mltadd(temp1, temp2, -Kq, xdot); /* xdot = temp1 - Kq*temp2 */ + xdot = v_mltadd(xdot, u, Kv/THAU, xdot); /* xdot = xdot + Kv/THAU * u */ } #endif diff --git a/sw/simulator/old_booz/booz_flight_model.h b/sw/simulator/old_booz/booz_flight_model.h index 6fdbc3cd67..57e2d0a66c 100644 --- a/sw/simulator/old_booz/booz_flight_model.h +++ b/sw/simulator/old_booz/booz_flight_model.h @@ -2,14 +2,14 @@ #define BOOZ_FLIGHT_MODEL_H #include -#include "airframe.h" +#include "generated/airframe.h" struct BoozFlightModel { /* are we flying ? */ int on_ground; - + double time; /* battery voltage in V */ double bat_voltage; diff --git a/sw/simulator/old_booz/booz_flight_model_params.h b/sw/simulator/old_booz/booz_flight_model_params.h index ae80ccf655..964b9287ff 100644 --- a/sw/simulator/old_booz/booz_flight_model_params.h +++ b/sw/simulator/old_booz/booz_flight_model_params.h @@ -16,7 +16,7 @@ /* gravity in m/s2 */ #define G 9.81 /* mass in kg */ -#define MASS 0.724 +#define MASS 0.724 /* inertia on x axis in kg * m2 */ #define Ix .007 /* inertia on y axis in kg * m2 */ @@ -26,7 +26,7 @@ /* lenght between centers of vehicle and prop in m */ #define L 0.25 -/* motors parameters +/* motors parameters from http://cherokee.stanford.edu/~starmac/docs/DynamicsSummary @@ -35,7 +35,7 @@ */ #define BAT_VOLTAGE 11. -#define THAU 0.05 +#define THAU 0.05 #define Kq 0.12 #define Kv 304. diff --git a/sw/simulator/old_booz/booz_flight_model_utils.c b/sw/simulator/old_booz/booz_flight_model_utils.c index 0ad50d91dd..6a648227c6 100644 --- a/sw/simulator/old_booz/booz_flight_model_utils.c +++ b/sw/simulator/old_booz/booz_flight_model_utils.c @@ -36,12 +36,12 @@ void rk4(ode_fun f, VEC* x, VEC* u, double dt) { /* adjust x */ v_mltadd(x,temp,dt/6.0,x); /* x = x+(h/6) * temp */ - + } MAT* dcm_of_eulers (VEC* eulers, MAT* dcm ) { - + dcm = m_resize(dcm, 3,3); double sinPHI = sin(eulers->ve[EULER_PHI]); @@ -66,17 +66,17 @@ MAT* dcm_of_eulers (VEC* eulers, MAT* dcm ) { VEC* quat_of_eulers(VEC* quat, VEC* eulers) { - + double phi2 = eulers->ve[EULER_PHI] / 2.0; double theta2 = eulers->ve[EULER_THETA] / 2.0; - double psi2 = eulers->ve[EULER_PSI] / 2.0; - - double sinphi2 = sin( phi2 ); - double cosphi2 = cos( phi2 ); - double sintheta2 = sin( theta2 ); - double costheta2 = cos( theta2 ); - double sinpsi2 = sin( psi2 ); - double cospsi2 = cos( psi2 ); + double psi2 = eulers->ve[EULER_PSI] / 2.0; + + double sinphi2 = sin( phi2 ); + double cosphi2 = cos( phi2 ); + double sintheta2 = sin( theta2 ); + double costheta2 = cos( theta2 ); + double sinpsi2 = sin( psi2 ); + double cospsi2 = cos( psi2 ); quat->ve[QUAT_QI] = cosphi2 * costheta2 * cospsi2 + sinphi2 * sintheta2 * sinpsi2; quat->ve[QUAT_QX] = -cosphi2 * sintheta2 * sinpsi2 + sinphi2 * costheta2 * cospsi2; diff --git a/sw/simulator/old_booz/booz_flightgear.c b/sw/simulator/old_booz/booz_flightgear.c index 943895036f..2a58ea4529 100644 --- a/sw/simulator/old_booz/booz_flightgear.c +++ b/sw/simulator/old_booz/booz_flightgear.c @@ -22,9 +22,9 @@ void booz_flightgear_init(const char* host, unsigned int port) { int so_reuseaddr = 1; struct protoent * pte = getprotobyname("UDP"); fg_socket = socket( PF_INET, SOCK_DGRAM, pte->p_proto); - setsockopt(fg_socket, SOL_SOCKET, SO_REUSEADDR, + setsockopt(fg_socket, SOL_SOCKET, SO_REUSEADDR, &so_reuseaddr, sizeof(so_reuseaddr)); - + fg_addr.sin_family = PF_INET; fg_addr.sin_port = htons(port); fg_addr.sin_addr.s_addr = inet_addr(host); @@ -44,7 +44,7 @@ void booz_flightgear_send() { gui.latitude = lat; gui.longitude = lon; - gui.altitude = 1.1 - bfm.state->ve[BFMS_Z]; + gui.altitude = 1.1 - bfm.state->ve[BFMS_Z]; gui.phi = bfm.state->ve[BFMS_PHI]; gui.theta = bfm.state->ve[BFMS_THETA]; @@ -58,16 +58,16 @@ void booz_flightgear_send() { } void net_gui_init (struct FGNetGUI* gui) { - gui->version = FG_NET_GUI_VERSION; + gui->version = FG_NET_GUI_VERSION; gui->latitude = 0.656480; gui->longitude = -2.135537; gui->altitude = 0.807609; gui->agl = 1.111652; - + gui->phi = 0.; gui->theta = 0.; gui->psi = 5.20; - + gui->vcas = 0.; gui->climb_rate = 0.; diff --git a/sw/simulator/old_booz/booz_joystick.c b/sw/simulator/old_booz/booz_joystick.c index 9811c2784e..731c7a5305 100644 --- a/sw/simulator/old_booz/booz_joystick.c +++ b/sw/simulator/old_booz/booz_joystick.c @@ -27,7 +27,7 @@ void booz_joystick_init(const char* device) { int i; for (i=0; i 0 ) seed_val = test; else seed_val = test + LONG_MAX; - + } - + return seed_val; } diff --git a/sw/simulator/old_booz/booz_sensors_model.c b/sw/simulator/old_booz/booz_sensors_model.c index 9bd0223111..8b4ac35086 100644 --- a/sw/simulator/old_booz/booz_sensors_model.c +++ b/sw/simulator/old_booz/booz_sensors_model.c @@ -29,7 +29,7 @@ extern void booz_sensors_model_gps_run(double time); void booz_sensors_model_init(double time) { - + VEC* tmp_eulers = v_get(AXIS_NB); tmp_eulers->ve[EULER_PHI] = BSM_BODY_TO_IMU_PHI; tmp_eulers->ve[EULER_THETA] = BSM_BODY_TO_IMU_THETA; @@ -44,7 +44,7 @@ void booz_sensors_model_init(double time) { booz_sensors_model_baro_init(time); booz_sensors_model_gps_init(time); -} +} void booz_sensors_model_run(double time) { @@ -55,7 +55,7 @@ void booz_sensors_model_run(double time) { booz_sensors_model_baro_run(time); booz_sensors_model_gps_run(time); -} +} diff --git a/sw/simulator/old_booz/booz_sensors_model.h b/sw/simulator/old_booz/booz_sensors_model.h index e4f5ab1410..ccc4a8f585 100644 --- a/sw/simulator/old_booz/booz_sensors_model.h +++ b/sw/simulator/old_booz/booz_sensors_model.h @@ -1,6 +1,6 @@ /* * $Id$ - * + * * Copyright (C) 2008 Antoine Drouin * * This file is part of paparazzi. @@ -18,7 +18,7 @@ * 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. + * Boston, MA 02111-1307, USA. * */ @@ -81,12 +81,12 @@ struct BoozSensorsModel { double mag_next_update; int mag_available; - + /* Rangemeter */ double rangemeter; double rangemeter_next_update; int rangemeter_available; - + /* Barometer */ double baro; diff --git a/sw/simulator/old_booz/booz_sensors_model_accel.c b/sw/simulator/old_booz/booz_sensors_model_accel.c index d87165c2fd..77d834bf2f 100644 --- a/sw/simulator/old_booz/booz_sensors_model_accel.c +++ b/sw/simulator/old_booz/booz_sensors_model_accel.c @@ -65,13 +65,13 @@ void booz_sensors_model_accel_run( double time ) { static VEC* accel_imu = VNULL; accel_imu = v_resize(accel_imu, AXIS_NB); mv_mlt(bsm.body_to_imu, accel_body, accel_imu); - + // printf(" accel_body ~ %f %f %f\n", accel_body->ve[AXIS_X], accel_body->ve[AXIS_Y], accel_body->ve[AXIS_Z]); /* compute accel reading */ - mv_mlt(bsm.accel_sensitivity, accel_imu, bsm.accel); + mv_mlt(bsm.accel_sensitivity, accel_imu, bsm.accel); v_add(bsm.accel, bsm.accel_neutral, bsm.accel); /* compute accel error readings */ @@ -81,19 +81,19 @@ void booz_sensors_model_accel_run( double time ) { /* add a gaussian noise */ accel_error = v_add_gaussian_noise(accel_error, bsm.accel_noise_std_dev, accel_error); /* constant bias */ - accel_error = v_add(accel_error, bsm.accel_bias, accel_error); + accel_error = v_add(accel_error, bsm.accel_bias, accel_error); /* scale to adc units FIXME : should use full adc gain ? sum ? */ accel_error->ve[AXIS_X] = accel_error->ve[AXIS_X] * bsm.accel_sensitivity->me[AXIS_X][AXIS_X]; accel_error->ve[AXIS_Y] = accel_error->ve[AXIS_Y] * bsm.accel_sensitivity->me[AXIS_Y][AXIS_Y]; accel_error->ve[AXIS_Z] = accel_error->ve[AXIS_Z] * bsm.accel_sensitivity->me[AXIS_Z][AXIS_Z]; /* add per accel error reading */ - bsm.accel = v_add(bsm.accel, accel_error, bsm.accel); + bsm.accel = v_add(bsm.accel, accel_error, bsm.accel); /* round signal to account for adc discretisation */ RoundSensor(bsm.accel); /* saturation */ - BoundSensor(bsm.accel, 0, bsm.accel_resolution); + BoundSensor(bsm.accel, 0, bsm.accel_resolution); - // printf("sim adc %f %f %f\n",bsm.accel->ve[AXIS_X] ,bsm.accel->ve[AXIS_Y] ,bsm.accel->ve[AXIS_Z]); + // printf("sim adc %f %f %f\n",bsm.accel->ve[AXIS_X] ,bsm.accel->ve[AXIS_Y] ,bsm.accel->ve[AXIS_Z]); bsm.accel_next_update += BSM_ACCEL_DT; bsm.accel_available = TRUE; } diff --git a/sw/simulator/old_booz/booz_sensors_model_baro.c b/sw/simulator/old_booz/booz_sensors_model_baro.c index afc1c9b86e..e16e3d1c12 100644 --- a/sw/simulator/old_booz/booz_sensors_model_baro.c +++ b/sw/simulator/old_booz/booz_sensors_model_baro.c @@ -32,7 +32,7 @@ void booz_sensors_model_baro_run( double time ) { // double p = ( z / 0.084 ) + BSM_BARO_QNH; // double baro_reading = p * BSM_BARO_SENSITIVITY; double baro_reading = BSM_BARO_QNH + z * BSM_BARO_SENSITIVITY; - + /* FIXME : add noise and random walk */ baro_reading = rint(baro_reading); bsm.baro = baro_reading; diff --git a/sw/simulator/old_booz/booz_sensors_model_gyro.c b/sw/simulator/old_booz/booz_sensors_model_gyro.c index eb59941d16..f8f607ca0e 100644 --- a/sw/simulator/old_booz/booz_sensors_model_gyro.c +++ b/sw/simulator/old_booz/booz_sensors_model_gyro.c @@ -66,8 +66,8 @@ void booz_sensors_model_gyro_run( double time ) { rate_imu = v_resize(rate_imu, AXIS_NB); mv_mlt(bsm.body_to_imu, bfm.ang_rate_body, rate_imu); /* compute gyros readings */ - bsm.gyro = mv_mlt(bsm.gyro_sensitivity, rate_imu, bsm.gyro); - bsm.gyro = v_add(bsm.gyro, bsm.gyro_neutral, bsm.gyro); + bsm.gyro = mv_mlt(bsm.gyro_sensitivity, rate_imu, bsm.gyro); + bsm.gyro = v_add(bsm.gyro, bsm.gyro_neutral, bsm.gyro); /* compute gyro error readings */ static VEC *gyro_error = VNULL; @@ -76,24 +76,24 @@ void booz_sensors_model_gyro_run( double time ) { /* add a gaussian noise */ gyro_error = v_add_gaussian_noise(gyro_error, bsm.gyro_noise_std_dev, gyro_error); /* update random walk bias */ - bsm.gyro_bias_random_walk_value = - v_update_random_walk(bsm.gyro_bias_random_walk_value, - bsm.gyro_bias_random_walk_std_dev, BSM_GYRO_DT, + bsm.gyro_bias_random_walk_value = + v_update_random_walk(bsm.gyro_bias_random_walk_value, + bsm.gyro_bias_random_walk_std_dev, BSM_GYRO_DT, bsm.gyro_bias_random_walk_value); - gyro_error = v_add(gyro_error, bsm.gyro_bias_random_walk_value, gyro_error); + gyro_error = v_add(gyro_error, bsm.gyro_bias_random_walk_value, gyro_error); /* scale to adc units FIXME : should use full adc gain ? sum ? */ - gyro_error->ve[AXIS_P] = + gyro_error->ve[AXIS_P] = gyro_error->ve[AXIS_P] * bsm.gyro_sensitivity->me[AXIS_P][AXIS_P]; - gyro_error->ve[AXIS_Q] = + gyro_error->ve[AXIS_Q] = gyro_error->ve[AXIS_Q] * bsm.gyro_sensitivity->me[AXIS_Q][AXIS_Q]; - gyro_error->ve[AXIS_R] = + gyro_error->ve[AXIS_R] = gyro_error->ve[AXIS_R] * bsm.gyro_sensitivity->me[AXIS_R][AXIS_R]; /* add per gyro error reading */ - bsm.gyro = v_add(bsm.gyro, gyro_error, bsm.gyro); + bsm.gyro = v_add(bsm.gyro, gyro_error, bsm.gyro); /* round signal to account for adc discretisation */ RoundSensor(bsm.gyro); /* saturation */ - BoundSensor(bsm.gyro, 0, bsm.gyro_resolution); + BoundSensor(bsm.gyro, 0, bsm.gyro_resolution); bsm.gyro_next_update += BSM_GYRO_DT; bsm.gyro_available = TRUE; diff --git a/sw/simulator/old_booz/booz_sensors_model_mag.c b/sw/simulator/old_booz/booz_sensors_model_mag.c index 3bb91d83d8..4ad6b65157 100644 --- a/sw/simulator/old_booz/booz_sensors_model_mag.c +++ b/sw/simulator/old_booz/booz_sensors_model_mag.c @@ -53,7 +53,7 @@ void booz_sensors_model_mag_init( double time ) { void booz_sensors_model_mag_run( double time ) { if (time < bsm.mag_next_update) return; - + /* rotate h to body frame */ static VEC *h_body = VNULL; h_body = v_resize(h_body, AXIS_NB); @@ -67,27 +67,27 @@ void booz_sensors_model_mag_run( double time ) { h_sensor = v_resize(h_sensor, AXIS_NB); mv_mlt(bsm.mag_imu_to_sensor, h_imu, h_sensor); - mv_mlt(bsm.mag_sensitivity, h_sensor, bsm.mag); - v_add(bsm.mag, bsm.mag_neutral, bsm.mag); + mv_mlt(bsm.mag_sensitivity, h_sensor, bsm.mag); + v_add(bsm.mag, bsm.mag_neutral, bsm.mag); - /* compute mag error readings */ + /* compute mag error readings */ static VEC *mag_error = VNULL; mag_error = v_resize(mag_error, AXIS_NB); /* add hard iron now ? */ mag_error = v_zero(mag_error); /* add a gaussian noise */ mag_error = v_add_gaussian_noise(mag_error, bsm.mag_noise_std_dev, mag_error); - + mag_error->ve[AXIS_X] = mag_error->ve[AXIS_X] * bsm.mag_sensitivity->me[AXIS_X][AXIS_X]; mag_error->ve[AXIS_Y] = mag_error->ve[AXIS_Y] * bsm.mag_sensitivity->me[AXIS_Y][AXIS_Y]; mag_error->ve[AXIS_Z] = mag_error->ve[AXIS_Z] * bsm.mag_sensitivity->me[AXIS_Z][AXIS_Z]; /* add error */ - v_add(bsm.mag, mag_error, bsm.mag); + v_add(bsm.mag, mag_error, bsm.mag); // printf("h body %f %f %f\n", h_body->ve[AXIS_X], h_body->ve[AXIS_Y], h_body->ve[AXIS_Z]); // printf("mag %f %f %f\n", bsm.mag->ve[AXIS_X], bsm.mag->ve[AXIS_Y], bsm.mag->ve[AXIS_Z]); - /* round signal to account for adc discretisation */ + /* round signal to account for adc discretisation */ RoundSensor(bsm.mag); bsm.mag_next_update += BSM_MAG_DT; diff --git a/sw/simulator/old_booz/booz_sensors_model_params_booz2.h b/sw/simulator/old_booz/booz_sensors_model_params_booz2.h index 9c2bee00f8..465b093b75 100644 --- a/sw/simulator/old_booz/booz_sensors_model_params_booz2.h +++ b/sw/simulator/old_booz/booz_sensors_model_params_booz2.h @@ -1,6 +1,6 @@ /* * $Id$ - * + * * Copyright (C) 2008 Antoine Drouin * * This file is part of paparazzi. @@ -18,15 +18,15 @@ * 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. + * Boston, MA 02111-1307, USA. * */ #ifndef BOOZ_SENSORS_MODEL_PARAMS_H #define BOOZ_SENSORS_MODEL_PARAMS_H -/* - * Accelerometer +/* + * Accelerometer */ #define BSM_ACCEL_RESOLUTION (65536) /* ms-2 */ @@ -54,8 +54,8 @@ -/* - * Gyrometer +/* + * Gyrometer */ #define BSM_GYRO_RESOLUTION 65536 @@ -134,9 +134,9 @@ #define BSM_GPS_POS_BIAS_INITIAL_X 1e-1 #define BSM_GPS_POS_BIAS_INITIAL_Y -1e-1 #define BSM_GPS_POS_BIAS_INITIAL_Z -5e-1 -#define BSM_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_X 1e-1 -#define BSM_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Y 1e-1 -#define BSM_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Z 1e-1 +#define BSM_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_X 1e-1 +#define BSM_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Y 1e-1 +#define BSM_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Z 1e-1 #define BSM_GPS_POS_LATENCY 0.25 #define BSM_GPS_POS_INITIAL_UTM_EAST 37728000 #define BSM_GPS_POS_INITIAL_UTM_NORTH 482464300 diff --git a/sw/simulator/old_booz/booz_sensors_model_params_booz2_a1.h b/sw/simulator/old_booz/booz_sensors_model_params_booz2_a1.h index 149f0801f8..1a923b9e44 100644 --- a/sw/simulator/old_booz/booz_sensors_model_params_booz2_a1.h +++ b/sw/simulator/old_booz/booz_sensors_model_params_booz2_a1.h @@ -1,6 +1,6 @@ /* * $Id$ - * + * * Copyright (C) 2008 Antoine Drouin * * This file is part of paparazzi. @@ -18,14 +18,14 @@ * 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. + * Boston, MA 02111-1307, USA. * */ #ifndef BOOZ_SENSORS_MODEL_PARAMS_H #define BOOZ_SENSORS_MODEL_PARAMS_H -#include "airframe.h" +#include "generated/airframe.h" #define BSM_BODY_TO_IMU_PHI RadOfDeg(4.) @@ -34,8 +34,8 @@ //#define BSM_BODY_TO_IMU_THETA RadOfDeg(0.) #define BSM_BODY_TO_IMU_PSI RadOfDeg(0.) -/* - * Accelerometer +/* + * Accelerometer */ #define BSM_ACCEL_RESOLUTION (65536) /* ms-2 */ @@ -64,8 +64,8 @@ -/* - * Gyrometer +/* + * Gyrometer */ #define BSM_GYRO_RESOLUTION 65536 @@ -157,9 +157,9 @@ #define BSM_GPS_POS_BIAS_INITIAL_X 0. #define BSM_GPS_POS_BIAS_INITIAL_Y 0. #define BSM_GPS_POS_BIAS_INITIAL_Z 0. -#define BSM_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_X 0. -#define BSM_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Y 0. -#define BSM_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Z 0. +#define BSM_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_X 0. +#define BSM_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Y 0. +#define BSM_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Z 0. #define BSM_GPS_POS_LATENCY 0. #else @@ -170,9 +170,9 @@ #define BSM_GPS_POS_BIAS_INITIAL_X 0e-1 #define BSM_GPS_POS_BIAS_INITIAL_Y -0e-1 #define BSM_GPS_POS_BIAS_INITIAL_Z -0e-1 -#define BSM_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_X 1e-3 -#define BSM_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Y 1e-3 -#define BSM_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Z 1e-3 +#define BSM_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_X 1e-3 +#define BSM_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Y 1e-3 +#define BSM_GPS_POS_BIAS_RANDOM_WALK_STD_DEV_Z 1e-3 #define BSM_GPS_POS_LATENCY 0.25 #endif /* GPS_PERFECT */ diff --git a/sw/simulator/old_booz/booz_sensors_model_rangemeter.c b/sw/simulator/old_booz/booz_sensors_model_rangemeter.c index f2c951829c..e1a8ed7d7d 100644 --- a/sw/simulator/old_booz/booz_sensors_model_rangemeter.c +++ b/sw/simulator/old_booz/booz_sensors_model_rangemeter.c @@ -19,7 +19,7 @@ void booz_sensors_model_rangemeter_init(double time) { bsm.rangemeter_next_update = time; bsm.rangemeter_available = FALSE; - + } diff --git a/sw/simulator/old_booz/booz_wind_model.c b/sw/simulator/old_booz/booz_wind_model.c index c1bbd09c33..6aaa633e71 100644 --- a/sw/simulator/old_booz/booz_wind_model.c +++ b/sw/simulator/old_booz/booz_wind_model.c @@ -22,9 +22,9 @@ void booz_wind_model_init( void ) { bwm.velocity = v_get(AXIS_NB); v_zero(bwm.velocity); - bwm.velocity->ve[AXIS_X] = INIT_WIND_X; - bwm.velocity->ve[AXIS_Y] = INIT_WIND_Y; - bwm.velocity->ve[AXIS_Z] = INIT_WIND_Z; + bwm.velocity->ve[AXIS_X] = INIT_WIND_X; + bwm.velocity->ve[AXIS_Y] = INIT_WIND_Y; + bwm.velocity->ve[AXIS_Z] = INIT_WIND_Z; bwm.state = v_get(BWM_STATE_SIZE); @@ -43,7 +43,7 @@ void booz_wind_model_run( double dt __attribute__ ((unused))) { static VEC *one = VNULL; one = v_resize(one, AXIS_NB); one = v_ones(one); - u = v_mltadd(one, u, -2., u); + u = v_mltadd(one, u, -2., u); u = sv_mlt((BWM_STD_DEV * BWM_STD_DEV), u, u); rk4(booz_wind_model_get_derivatives, bwm.state, u, dt); diff --git a/sw/simulator/scilab/q1d/q1d_ctl_common.sci b/sw/simulator/scilab/q1d/q1d_ctl_common.sci index 877ec3e8df..080ebe8bf8 100644 --- a/sw/simulator/scilab/q1d/q1d_ctl_common.sci +++ b/sw/simulator/scilab/q1d/q1d_ctl_common.sci @@ -47,7 +47,7 @@ function [Xrefi1] = ctl_update_ref(Xrefi, Xspi, dt) sp_zdd = min(sp_zdd, ref_max_accel); else sp_zdd = max(sp_zdd, ref_min_accel); - end + end Xrefi1(REF_ZDD) = sp_zdd; endfunction @@ -98,19 +98,19 @@ function ctl_display(ctl_type, ctl_list, ctl_sp, ctl_ref_state, ins_state, ctl_ plot2d(time, ctl_sp, 5); legends(["setpoint", "reference", "achieved"],[5 2 3], with_box=%f, opt="ur"); xtitle('Altitude'); - + subplot(nr,nc,3); plot2d(time, ins_state(INS_ZD,:),3); plot2d(time, ctl_ref_state(REF_ZD,:),2); legends(["reference", "achieved"],[2 3], with_box=%f, opt="ur"); xtitle('Vertical Speed'); - + subplot(nr,nc,5); plot2d(time, ins_state(INS_ZDD,:),3); plot2d(time, ctl_ref_state(REF_ZDD,:),2); legends(["reference", "achieved"],[2 3], with_box=%f, opt="ur"); xtitle('Vertical Acceleration'); - + select ctl_type case CTL_MIAC subplot(nr,nc,2); @@ -121,7 +121,7 @@ function ctl_display(ctl_type, ctl_list, ctl_sp, ctl_ref_state, ins_state, ctl_ plot2d(time, ctl_adp_state,2); legends(["estimation", "measure"],[2 3], with_box=%f, opt="ur"); xtitle('Parameter adaptation'); - + subplot(nr,nc,4); _rect = [time(1), 0., time($), 0.003]; plot2d(time, ctl_adp_cov,2, rect=_rect); diff --git a/sw/simulator/scilab/q1d/q1d_ctl_miac.sci b/sw/simulator/scilab/q1d/q1d_ctl_miac.sci index f88cc2b743..779ca3e604 100644 --- a/sw/simulator/scilab/q1d/q1d_ctl_miac.sci +++ b/sw/simulator/scilab/q1d/q1d_ctl_miac.sci @@ -15,17 +15,17 @@ miac_vnull = 7.; function [Xadpi1p, Padpi1p, Madpi1] = ctl_adapt_model(Xadpip, Padpip, Xinsi, Ui) if (Ui < adp_min_cmd) - Xadpi1p = Xadpip + Xadpi1p = Xadpip // so propagate covariance only Padpi1p = Padpip; // + adp_sys_noise; Madpi1 = 0; else // Propagate // we're estimating a constant - Xadpi1m = Xadpip + Xadpi1m = Xadpip // so propagate covariance only Padpi1m = Padpip + adp_sys_noise; - + // Update // our measurement Madpi1 = (Xinsi(INS_ZDD) + fdm_g) / ( Ui ); @@ -42,7 +42,7 @@ function [Xadpi1p, Padpi1p, Madpi1] = ctl_adapt_model(Xadpip, Padpip, Xinsi, Ui) Padpi1p = Padpi1m - K * Padpi1m; Xadpi1p = Xadpi1m + K * res; end - + endfunction diff --git a/sw/simulator/scilab/q1d/q1d_ctl_mrac.sci b/sw/simulator/scilab/q1d/q1d_ctl_mrac.sci index b0013f35ea..59cbc6b77d 100644 --- a/sw/simulator/scilab/q1d/q1d_ctl_mrac.sci +++ b/sw/simulator/scilab/q1d/q1d_ctl_mrac.sci @@ -16,7 +16,7 @@ function [Xadpi1p] = ctl_mrac(Xadpim1, Xinsi, Xrefim1, Uim1) s = err_zd + mrac_lbd*err_z; Xadpi1p = Xadpim1 + mrac_gma*s*(Uim1- ... Xinsi(INS_ZD) * abs(Xinsi(INS_ZD)) * fdm_Cd); - + endfunction diff --git a/sw/simulator/scilab/q1d/q1d_fdm.sci b/sw/simulator/scilab/q1d/q1d_fdm.sci index bc1ae1bc54..0020b3ae20 100644 --- a/sw/simulator/scilab/q1d/q1d_fdm.sci +++ b/sw/simulator/scilab/q1d/q1d_fdm.sci @@ -8,16 +8,16 @@ FDM_ZD = 2; FDM_ZDD = 3; FDM_SIZE = 3; -// u +// u // Parameters fdm_mass = 0.5; // mass in kg fdm_g = 9.81; // gravity acceleration m/s2 fdm_max_thrust = 4. * fdm_mass * fdm_g; // actuators high saturation fdm_min_thrust = 0.05 * fdm_mass * fdm_g; // actuators low saturation -fdm_Cd = 0.01; // non dimentional drag coefficient -fdm_Ct0 = fdm_max_thrust; // non dimentional lift coefficient -fdm_Ctzd = -fdm_max_thrust/7; // non dimensional lift coefficient +fdm_Cd = 0.01; // non dimentional drag coefficient +fdm_Ct0 = fdm_max_thrust; // non dimentional lift coefficient +fdm_Ctzd = -fdm_max_thrust/7; // non dimensional lift coefficient function [Xdot] = fdm_get_derivatives(t, X, U, perturb, param) @@ -27,7 +27,7 @@ function [Xdot] = fdm_get_derivatives(t, X, U, perturb, param) u_trim = trim(U(1), 0.01, 1.); thrust = u_trim * (fdm_Ct0 + fdm_Ctzd * X(FDM_ZD)); Xdot(FDM_ZD) = 1/mass*(thrust - fdm_Cd * X(FDM_ZD) * abs(X(FDM_ZD))) - fdm_g + perturb; - + endfunction // diff --git a/sw/simulator/scilab/q1d/q1d_ins.sci b/sw/simulator/scilab/q1d/q1d_ins.sci index 758a180f22..3ae8dbe225 100644 --- a/sw/simulator/scilab/q1d/q1d_ins.sci +++ b/sw/simulator/scilab/q1d/q1d_ins.sci @@ -17,24 +17,24 @@ function [Xi1, Pi1] = ins_run(Xi, Pi, sensors_i, sensors_i1, dt) 0 1 -dt 0 0 1 ]; B = [ dt^2/2 dt 0]'; - + Qz = 0.01*dt^2/2; Qzd = 0.01*dt; - + // FIXME: Qz and Qzd noise mismatch with dt //Qz = 0.01*dt; //Qzd = 0.01*dt^2/2; - + Qbias = 0.0001 * dt; Q = [ Qz 0 0 0 Qzd 0 0 0 Qbias ]; accel = sensors_i( SENSORS_ACCEL ) - 9.81; - + Xi1m = F * Xi + B * accel; - + Pi1m = F * Pi * F' + Q; // @@ -53,7 +53,7 @@ function [Xi1, Pi1] = ins_run(Xi, Pi, sensors_i, sensors_i1, dt) // update covariance Pi1 = Pi1m - K*H*Pi1m; Xi1(4) = accel - Xi1(INS_BIAS); - + endfunction function [Pi] = getP(n, P,i) diff --git a/sw/simulator/scilab/q1d/q1d_run.sce b/sw/simulator/scilab/q1d/q1d_run.sce index 47a89a717f..ee557d98fc 100644 --- a/sw/simulator/scilab/q1d/q1d_run.sce +++ b/sw/simulator/scilab/q1d/q1d_run.sce @@ -102,9 +102,9 @@ ctl_max = zeros(1, length(time)); ctl_max(1) = 0; ctl_min = zeros(1, length(time)); ctl_min(1) = 0; - + for i = 1:length(time)-1 - + ti = time(i); ti1 = time(i+1); // run control @@ -140,7 +140,7 @@ for i = 1:length(time)-1 Xfdmi1 = fdm_run(Xfdmi, Ui, ti, ti1, fdm_perturb(:,i), fdm_param(i)); fdm_state(:,i+1) = Xfdmi1; // run sensor model - Xsensorsi1 = sensors_run(ti, Xfdmi); + Xsensorsi1 = sensors_run(ti, Xfdmi); sensors_state(:,i+1) = Xsensorsi1; // run ins Pinsi = getP(INS_SIZE, ins_cov, i); @@ -170,7 +170,7 @@ if 0 drawlater(); fdm_display_simple(fdm_state, time); drawnow(); - + set("current_figure",1); clf(); f=get("current_figure"); @@ -203,7 +203,7 @@ drawnow(); end if 0 - + set("current_figure",4); clf(); f=get("current_figure"); @@ -238,7 +238,7 @@ drawlater(); plot2d(time, sensors_state(SENSORS_BARO,:),3); plot2d(time, bflt_state(BF_Z, :), 5); plot2d(time, fdm_state(FDM_Z,:),2); - legends(["Estimation", "Truth", "Measurement"],[5 2 3], with_box=%f, opt="ur"); + legends(["Estimation", "Truth", "Measurement"],[5 2 3], with_box=%f, opt="ur"); xtitle('Z'); subplot(4, 2, 3); @@ -250,14 +250,14 @@ drawlater(); subplot(4, 2, 5); plot2d(time, sensors_state(SENSORS_ACCEL_BIAS,:),2); plot2d(time, bflt_state(BF_BIAS, :), 5); - legends(["Estimation", "Truth"],[5 2], with_box=%f, opt="ur"); + legends(["Estimation", "Truth"],[5 2], with_box=%f, opt="ur"); xtitle('BIAS'); subplot(4, 2, 7); plot2d(time, bflt_state(BF_C, :)); xtitle('C'); - + subplot(4, 2, 2); foo=[]; for i=1:length(time) @@ -265,7 +265,7 @@ drawlater(); end plot2d(time, foo); xtitle('COV ZZ'); - + subplot(4, 2, 4); foo=[]; @@ -290,6 +290,6 @@ drawlater(); end plot2d(time, foo); xtitle('COV CC'); - + drawnow(); diff --git a/sw/simulator/scilab/q1d/q1d_sensors.sci b/sw/simulator/scilab/q1d/q1d_sensors.sci index 7779602bf7..1edb5367cb 100644 --- a/sw/simulator/scilab/q1d/q1d_sensors.sci +++ b/sw/simulator/scilab/q1d/q1d_sensors.sci @@ -25,7 +25,7 @@ function [Xsensorsi] = sensors_run(ti, Xfdmi) accel_bias +... accel_noise_std_dev * rand(1,1,'normal'); Xsensorsi(SENSORS_ACCEL_BIAS) = accel_bias; - + baro_real = Xfdmi(FDM_Z) + baro_noise_std_dev * rand(1,1,'normal'); baro_disc = round(baro_real/baro_step) * baro_step; Xsensorsi(SENSORS_BARO) = baro_disc; diff --git a/sw/simulator/scilab/q3d/fonts/ttx2scilab.c b/sw/simulator/scilab/q3d/fonts/ttx2scilab.c index 9973f95093..f262e481d9 100644 --- a/sw/simulator/scilab/q3d/fonts/ttx2scilab.c +++ b/sw/simulator/scilab/q3d/fonts/ttx2scilab.c @@ -12,7 +12,7 @@ static void on_start_element(GMarkupParseContext *context, GError **error); static void on_text(GMarkupParseContext *context, const gchar *text, - gsize text_len, + gsize text_len, gpointer user_data, GError **error); static void on_error (GMarkupParseContext *context, @@ -65,7 +65,7 @@ static void on_start_element(GMarkupParseContext *context, static void on_text(GMarkupParseContext *context, const gchar *text, - gsize text_len, + gsize text_len, gpointer user_data, GError **error) { // g_message("on text (%s)", text); diff --git a/sw/simulator/scilab/q3d/q3d_adaptation.sci b/sw/simulator/scilab/q3d/q3d_adaptation.sci index 25b4060ddc..6c2a1755b5 100644 --- a/sw/simulator/scilab/q3d/q3d_adaptation.sci +++ b/sw/simulator/scilab/q3d/q3d_adaptation.sci @@ -7,7 +7,7 @@ // estimated parameters ADP_EST_A = 1; // a = fdm_Ct0/fdm_mass ADP_EST_B = 2; // b = fdm_la*fdm_Ct0/fdm_inertia -ADP_EST_SIZE = 2; +ADP_EST_SIZE = 2; global adp_est; global adp_P; @@ -26,20 +26,20 @@ function adp_init(time, est0, P0) global adp_est; adp_est = zeros(ADP_EST_SIZE, length(time)); adp_est(:,1) = est0; - + global adp_P; adp_P = zeros(ADP_EST_SIZE, ADP_EST_SIZE, length(time)); adp_P(:,:,1) = [ 20 0 ; 0 50000]; - + global adp_y; adp_y = zeros(ADP_EST_SIZE, length(time)); - + global adp_thetad_f; adp_thetad_f = zeros(1, length(time)); global adp_ud_f; adp_ud_f = zeros(1, length(time)); - + endfunction @@ -55,10 +55,10 @@ function adp_run2(i) // output global adp_y; adp_y(:,i) = [ sqrt(fdm_accel(FDM_AX,i)^2 + (fdm_accel(FDM_AZ,i)+9.81)^2) // FIXME - sensors_state(SEN_SG,i) - 1/adp_lp_tau * adp_thetad_f(i) ]; - // input - W = [ ctl_u(CTL_UT,i) 0; 0 adp_ud_f(i) ]; - + sensors_state(SEN_SG,i) - 1/adp_lp_tau * adp_thetad_f(i) ]; + // input + W = [ ctl_u(CTL_UT,i) 0; 0 adp_ud_f(i) ]; + global adp_est; global adp_P; // residual @@ -74,7 +74,7 @@ function adp_run2(i) lambda = 1.025; Pd = lambda*adp_P(:,:,i-1) - adp_P(:,:,i-1)* W' * W * adp_P(:,:,i-1); adp_P(:,:,i) = adp_P(:,:,i-1) + Pd * dt; - + endfunction // propagate the adaptation from step i-1 to step 1 @@ -88,11 +88,11 @@ function adp_run(i) global adp_y; global adp_est; global adp_P; - + //output adp_y(1,i-1) = sqrt(fdm_accel(FDM_AX,i-1)^2 + (fdm_accel(FDM_AZ,i-1)+9.81)^2); // fixme - // input - W = ctl_u(CTL_UT,i-1); + // input + W = ctl_u(CTL_UT,i-1); // residual e1 = W*adp_est(1,i-1) - adp_y(1,i-1); // update state @@ -103,11 +103,11 @@ function adp_run(i) // lambda = 2.25; Pd = lambda*adp_P(1,1,i-1) - adp_P(1,1,i-1)* W' * W * adp_P(1,1,i-1); adp_P(1,1,i) = adp_P(1,1,i-1) + Pd * dt; - + //output adp_y(2,i-1) = sensors_state(SEN_SG,i-1) - 1/adp_lp_tau * adp_thetad_f(i-1); // input - W = adp_ud_f(i-1); + W = adp_ud_f(i-1); // residual e1 = W*adp_est(2,i-1) - adp_y(2,i-1); // update state @@ -118,6 +118,6 @@ function adp_run(i) // lambda = 2.25; Pd = lambda*adp_P(2,2,i-1) - adp_P(2,2,i-1)* W' * W * adp_P(2,2,i-1); adp_P(2,2,i) = adp_P(2,2,i-1) + Pd * dt; - + endfunction diff --git a/sw/simulator/scilab/q3d/q3d_ctl.sci b/sw/simulator/scilab/q3d/q3d_ctl.sci index 134fdea9bc..100149e65a 100644 --- a/sw/simulator/scilab/q3d/q3d_ctl.sci +++ b/sw/simulator/scilab/q3d/q3d_ctl.sci @@ -23,7 +23,7 @@ ctl_gain = [ 0 0 0 0 0 0 else ctl_gain = [ 0 -1 0 0 -1 0 0.95 0 -3 1.2 0 -3 ]; - + end function ctl_init(time) @@ -46,7 +46,7 @@ function ctl_run(i, model_a, model_b) global ctl_diff_flat_ref; ctl_diff_flat_ref(:,i) = df_state_of_fo(fo_traj(:,:,i)); global ctl_fb_cmd; - ctl_fb_cmd(:,i) = ctl_compute_feeback(fdm_state(:,i), ctl_diff_flat_ref(:,i), ctl_diff_flat_cmd(:,i), model_a, model_b); + ctl_fb_cmd(:,i) = ctl_compute_feeback(fdm_state(:,i), ctl_diff_flat_ref(:,i), ctl_diff_flat_cmd(:,i), model_a, model_b); global ctl_u; ctl_u(:,i) = ctl_diff_flat_cmd(:,i) + ctl_fb_cmd(:,i); MotorsOfCmds = 0.5*[1 -1 ; 1 1]; @@ -70,8 +70,8 @@ function [fb_cmd] = ctl_compute_feeback(fdm_state, s_ref, u_ref, a, b) o2_t = fb_o_t^2; xo2_t = 2*fb_x_t*fb_o_t; ut = u_ref(1); - - + + gain = [ o2_x*st/a -o2_z*ct/a 0 xo2_x*st/a -xo2_z*ct/a 0 o2_t/b*o2_x*ct/a/ut o2_t/b*o2_z*st/a/ut -o2_t/b o2_t/b*xo2_x*ct/a/ut o2_t/b*xo2_z*st/a/ut -xo2_t/b]; diff --git a/sw/simulator/scilab/q3d/q3d_diff_flatness.sci b/sw/simulator/scilab/q3d/q3d_diff_flatness.sci index bb9494298a..a428b7c55c 100644 --- a/sw/simulator/scilab/q3d/q3d_diff_flatness.sci +++ b/sw/simulator/scilab/q3d/q3d_diff_flatness.sci @@ -33,25 +33,25 @@ endfunction // control input from flat output function [inp] = df_input_of_fo(fo, model_a, model_b) - x2 = fo(1,3); - z2pg = fo(2,3)+9.81; + x2 = fo(1,3); + z2pg = fo(2,3)+9.81; // u1 = fo_mass / fo_Ct0 * sqrt((x2)^2 + (z2pg)^2); u1 = 1/model_a * sqrt((x2)^2 + (z2pg)^2); - - x3 = fo(1,4); - z3 = fo(2,4); - x4 = fo(1,5); - z4 = fo(2,5); - a = x4*z2pg - z4*x2; + + x3 = fo(1,4); + z3 = fo(2,4); + x4 = fo(1,5); + z4 = fo(2,5); + a = x4*z2pg - z4*x2; b = z2pg^2+x2^2; c = 2 * (z2pg*z3 + x2*x3); d = x3*z2pg-z3*x2; // u2 = -fo_J / fo_la /fo_Ct0 * ( a/b - c*d/b^2); u2 = -1/model_b * ( a/b - c*d/b^2); - + inp = [u1; u2]; - + endfunction diff --git a/sw/simulator/scilab/q3d/q3d_display.sci b/sw/simulator/scilab/q3d/q3d_display.sci index 3e40c2114d..bc5e3c039a 100644 --- a/sw/simulator/scilab/q3d/q3d_display.sci +++ b/sw/simulator/scilab/q3d/q3d_display.sci @@ -30,13 +30,13 @@ function display_fdm() subplot(2,3,6); plot2d(fdm_time, deg_of_rad(fdm_state(FDM_STHETAD, :))); xtitle('Thetad'); - + endfunction function display_fo(time, fo) clf(); - + subplot(5,2,1); plot2d(time, matrix(fo(1,1,:), 1, length(time))); xtitle('X(0)'); @@ -88,7 +88,7 @@ function display_commands(time, diff_flat_cmd) subplot(2,2,2); plot2d(time, diff_flat_cmd(2,:)); xtitle('u2'); - + subplot(2,2,3); plot2d(time, diff_flat_cmd(1,:)-diff_flat_cmd(2,:)); xtitle('F1'); @@ -96,8 +96,8 @@ function display_commands(time, diff_flat_cmd) subplot(2,2,4); plot2d(time, diff_flat_cmd(1,:)+diff_flat_cmd(2,:)); xtitle('F2'); - - + + endfunction @@ -126,7 +126,7 @@ function display_fo_ref(time, diff_flat_ref) subplot(2,3,6); plot2d(time, deg_of_rad(diff_flat_ref(FDM_STHETAD, :))); xtitle('Thetad'); - + endfunction function display_control(time, diff_flat_ref, fdm_state, diff_flat_cmd, fb_cmd, motor_cmd ) @@ -135,11 +135,11 @@ function display_control(time, diff_flat_ref, fdm_state, diff_flat_cmd, fb_cmd, f.figure_name="Control"; clf(); - + subplot(4,3,1); plot2d(time(2:$-1), ctl_diff_flat_ref(FDM_SX, 2:$-1), 3); plot2d(time(2:$-1), fdm_state(FDM_SX, 2:$-1), 2); - legends(["fdm", "ref"],[2 3], with_box=%f, opt="ul"); + legends(["fdm", "ref"],[2 3], with_box=%f, opt="ul"); xtitle('X'); subplot(4,3,2); @@ -166,8 +166,8 @@ function display_control(time, diff_flat_ref, fdm_state, diff_flat_cmd, fb_cmd, plot2d(time(2:$-1), deg_of_rad(diff_flat_ref(FDM_STHETAD, 2:$-1)), 3); plot2d(time(2:$-1), deg_of_rad(fdm_state(FDM_STHETAD, 2:$-1)), 2); xtitle('Thetad'); - - + + subplot(4,3,7); xset("color",5); xfpoly([time(2:$-1) time($-1:-1:2)], [diff_flat_cmd(1,2:$-1) ctl_u(1,$-1:-1:2)]); @@ -183,7 +183,7 @@ function display_control(time, diff_flat_ref, fdm_state, diff_flat_cmd, fb_cmd, plot2d(time(2:$-1), ctl_u(2,2:$-1), 5); plot2d(time(2:$-1), diff_flat_cmd(2,2:$-1), 2); xtitle('u_d'); - + subplot(4,3,10); plot2d(time(2:$-1), motor_cmd(1,2:$-1), 2); xtitle('u1'); @@ -191,23 +191,23 @@ function display_control(time, diff_flat_ref, fdm_state, diff_flat_cmd, fb_cmd, subplot(4,3,11); plot2d(time(2:$-1), motor_cmd(2,2:$-1), 2); xtitle('u2'); - - + + endfunction -function display_adaptation() +function display_adaptation() f=get("current_figure"); f.figure_name="Adaptation"; clf(); - + subplot(2,3,1); plot2d(fdm_time, adp_y(1,:), 3); // plot2d(fdm_time, fdm_Ct0/fdm_mass*ctl_u(CTL_UT,:), 2); - legends(["y1", "ut"],[3 2], with_box=%f, opt="ul"); + legends(["y1", "ut"],[3 2], with_box=%f, opt="ul"); xtitle('apd_y1'); - + subplot(2,3,2); // plot2d(fdm_time, fdm_Ct0/fdm_mass*ones(1,length(time)),3); plot2d(fdm_time, adp_est(ADP_EST_A,:), 2); @@ -217,13 +217,13 @@ function display_adaptation() plot2d(fdm_time, matrix(adp_P(1,1,:), 1, length(time)), 2); xtitle('adp_P11'); - + subplot(2,3,4); plot2d(fdm_time, adp_y(2,:), 3); // plot2d(fdm_time, fdm_la*fdm_Ct0/fdm_inertia*adp_ud_f, 2); - legends(["y2", "udf"],[3 2], with_box=%f, opt="ul"); + legends(["y2", "udf"],[3 2], with_box=%f, opt="ul"); xtitle('ud_f'); - + subplot(2,3,5); // plot2d(fdm_time, fdm_la*fdm_Ct0/fdm_inertia*ones(1, length(time)),3); plot2d(fdm_time, adp_est(ADP_EST_B,:), 2); diff --git a/sw/simulator/scilab/q3d/q3d_fdm.sci b/sw/simulator/scilab/q3d/q3d_fdm.sci index 5cdfbf74e7..783976574b 100644 --- a/sw/simulator/scilab/q3d/q3d_fdm.sci +++ b/sw/simulator/scilab/q3d/q3d_fdm.sci @@ -34,10 +34,10 @@ fdm_inertia = 0.0078; fdm_la = 0.25; // arm length //fdm_Ct0 = 4. * fdm_mass * fdm_g / 2; // thrust coefficient -//fdm_V0 = 1e9; // +//fdm_V0 = 1e9; // fdm_Cd = 1e-9; // drag coefficient -fdm_min_thrust = 0.05; // 5% +fdm_min_thrust = 0.05; // 5% fdm_max_thrust = 1.00; // 100% fdm_wind = [0 0]'; @@ -63,7 +63,7 @@ global fdm_state; // state global fdm_accel; // aceleration (used for sensors) global fdm_perturb; // perturbation -function fdm_init(time, fdm_X0, cmd0) +function fdm_init(time, fdm_X0, cmd0) global fdm_time; fdm_time = time; @@ -81,7 +81,7 @@ endfunction // propagate dynamic model from step i-1 to step i function fdm_run(i, cmd) - + cmd = trim_vect(cmd, fdm_min_thrust, fdm_max_thrust); global fdm_state; // global fdm_time; @@ -95,36 +95,36 @@ endfunction function [Xdot] = fdm_get_derivatives(t, X, U, perturb) Xdot = zeros(length(X),1); - + Xdot(FDM_SX:FDM_STHETA) = X(FDM_SXD:FDM_STHETAD); - + // forces : gspeed_ltp = X(FDM_SXD:FDM_SZD); airspeed_ltp = gspeed_ltp - fdm_wind; - + stheta = sin(X(FDM_STHETA)); ctheta = cos(X(FDM_STHETA)); - + DCM = [ctheta stheta ; -stheta ctheta]; airspeed_body = DCM * airspeed_ltp; - + thrust = fdm_get_thrust(airspeed_body,X(FDM_STHETAD),U); - + lift_body = [0; sum(thrust)]; - lift_ltp = DCM'*lift_body; + lift_ltp = DCM'*lift_body; weight_ltp = [0; -fdm_g * fdm_mass]; drag_ltp = -fdm_Cd * norm(airspeed_ltp) * airspeed_ltp; Xdot(FDM_SXD:FDM_SZD) = 1/fdm_mass*(lift_ltp+weight_ltp+drag_ltp); - + // moments Xdot(FDM_STHETAD) = fdm_la / fdm_inertia * (thrust(FDM_MOTOR_LEFT) - thrust(FDM_MOTOR_RIGHT)); - + // add perturbation Xdot(FDM_SXD:FDM_STHETAD) = Xdot(FDM_SXD:FDM_STHETAD)+perturb; endfunction function thrust = fdm_get_thrust(airspeed_body,rates_body,U) - + vel_of_rate = [rates_body*fdm_la; -rates_body*fdm_la]; for i = 1:FDM_MOTOR_NB diff --git a/sw/simulator/scilab/q3d/q3d_fo_traj_misc.sci b/sw/simulator/scilab/q3d/q3d_fo_traj_misc.sci index e0f745b45a..f9a30bd429 100644 --- a/sw/simulator/scilab/q3d/q3d_fo_traj_misc.sci +++ b/sw/simulator/scilab/q3d/q3d_fo_traj_misc.sci @@ -1,20 +1,20 @@ function [fo_traj] = fo_traj_circle(time, _center, radius, omega) - + n_comp = 2; order = 5; fo_traj = zeros(n_comp, order, length(time)); for i=1:length(time) - + alpha = omega*time(i); fo_traj(1,1,i) = _center(1) + radius * cos(alpha); fo_traj(2,1,i) = _center(1) + radius * sin(alpha); fo_traj(1,2,i) = -omega * radius * sin(alpha); fo_traj(2,2,i) = omega * radius * cos(alpha); - + fo_traj(1,3,i) = -omega^2 * radius * cos(alpha); fo_traj(2,3,i) = -omega^2 * radius * sin(alpha); @@ -23,8 +23,8 @@ function [fo_traj] = fo_traj_circle(time, _center, radius, omega) fo_traj(1,5,i) = omega^4 * radius * cos(alpha); fo_traj(2,5,i) = omega^4 * radius * sin(alpha); - - end + + end endfunction @@ -37,23 +37,23 @@ function [fo_traj] = fo_traj_swing(time) fo_traj = zeros(n_comp, order, length(time)); for i=1:length(time) - + alpha = omega*time(i); radius = 2; fo_traj(1,1,i) = radius * cos(alpha); fo_traj(1,2,i) = -omega * radius * sin(alpha); - + fo_traj(1,3,i) = -omega^2 * radius * cos(alpha); fo_traj(1,4,i) = omega^3 * radius * sin(alpha); fo_traj(1,5,i) = omega^4 * radius * cos(alpha); - - end - + end + + endfunction diff --git a/sw/simulator/scilab/q3d/q3d_polynomials.sci b/sw/simulator/scilab/q3d/q3d_polynomials.sci index 28978de278..d9c0a5e747 100644 --- a/sw/simulator/scilab/q3d/q3d_polynomials.sci +++ b/sw/simulator/scilab/q3d/q3d_polynomials.sci @@ -6,8 +6,8 @@ // function poly_display_traj(time, traj) - [n_compo, n_order, n_sample] = size(traj); - + [n_compo, n_order, n_sample] = size(traj); + for compo=1:n_compo for order=1:n_order subplot(n_order, n_compo, compo+(order-1)*n_compo); @@ -15,20 +15,20 @@ function poly_display_traj(time, traj) xtitle(sprintf('$X^{%d}_{%d}$', order-1, compo)); end end - + endfunction // // compute the values of a set of polynomials along a time vector -// +// // function [traj] = poly_gen_traj(time, coefs) - + [n_comp, n_order, n_coef] = size(coefs); - + traj = zeros(n_comp, n_coef/2, length(time)); - for compo=1:n_comp + for compo=1:n_comp for order=1:n_order for i=1:length(time) traj(compo, order, i) = ... @@ -51,7 +51,7 @@ function [v] = poly_compute_val(coefs, t0, t) v = v * dt; v = v + coefs(length(coefs)-i); // assume coef(1) = a_0 end - + endfunction @@ -64,20 +64,20 @@ function [coefs] = poly_get_coef_from_bound(time, b0,b1) [n_comp, n_order] = size(b0); n_coef = 2*n_order - coefs = zeros(n_comp, n_order, n_coef); - + coefs = zeros(n_comp, n_order, n_coef); + // refer to paper for notations - + for compo=1:n_comp - // invert of the top left corner block + // invert of the top left corner block invA1 = zeros(n_order, n_order); for i=1:n_order invA1(i,i) = 1/Arr(i-1,i-1); end // first half of the coefficients coefs(compo, 1, 1:n_order) = (invA1*b0(compo,:)')'; - + // bottom left block : triangular A3 = zeros(n_order, n_order); dt = time($) - time(1); @@ -86,7 +86,7 @@ function [coefs] = poly_get_coef_from_bound(time, b0,b1) A3(i,j) = Arr(i-1,j-1) * dt^(j-i); end end - // bottom right block + // bottom right block A4 = zeros(n_order, n_order); for i=1:n_order for j=1:n_order @@ -95,14 +95,14 @@ function [coefs] = poly_get_coef_from_bound(time, b0,b1) end coefs(compo, 1, n_order+1:2*n_order) = ... (inv(A4)*(b1(compo,:)' - A3*matrix(coefs(compo,1, 1:n_order), n_order, 1)))'; - // fill in the coefficients for the succesive time derivatives + // fill in the coefficients for the succesive time derivatives for order=2:n_order for pow=0:2*n_order-order coefs(compo, order, pow+1) = Arr(order-1,pow-1+order)*coefs(compo, 1, pow+order); end end end - + endfunction diff --git a/sw/simulator/scilab/q3d/q3d_povray.sci b/sw/simulator/scilab/q3d/q3d_povray.sci index dea28bf0cd..528c2d9fdf 100644 --- a/sw/simulator/scilab/q3d/q3d_povray.sci +++ b/sw/simulator/scilab/q3d/q3d_povray.sci @@ -26,6 +26,6 @@ function povray_draw( time, diff_flat_ref ) mplayer_cmd = "mencoder ""mf://povray/foo*.png"" -mf fps=25 -o povray/test.avi -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=800"; unix_g(mplayer_cmd); - + endfunction diff --git a/sw/simulator/scilab/q3d/q3d_ref_misc.sci b/sw/simulator/scilab/q3d/q3d_ref_misc.sci index 08f769e786..7ab53bc54e 100644 --- a/sw/simulator/scilab/q3d/q3d_ref_misc.sci +++ b/sw/simulator/scilab/q3d/q3d_ref_misc.sci @@ -6,10 +6,10 @@ endfunction function [time_out, ref_out] = get_reference_circle(time_in, ref_in, center, radius, duration) - + dt = 1/512; time = time_in($)+dt:dt:time_in($)+duration; - + omega = 2*%pi/period; X0 = radius * sin(omega * time) + center(AXIS_X); Z0 = radius * -cos(omega * time) + center(AXIS_Z); @@ -19,7 +19,7 @@ function [time_out, ref_out] = get_reference_circle(time_in, ref_in, center, rad X2 = omega^2 * radius * -sin(omega * time); Z2 = omega^2 * radius * cos(omega * time); - + X3 = omega^3 * radius * -cos(omega * time); Z3 = omega^3 * radius * -sin(omega * time); @@ -28,7 +28,7 @@ function [time_out, ref_out] = get_reference_circle(time_in, ref_in, center, rad time_out = [time_in time]; ref_out = [ref_in X0;Z0;X1;Z1;X2;Z2;X3;Z3;X4;Z4]; - + endfunction @@ -42,16 +42,16 @@ function [time, Xref] = get_reference_looping(t0, duration, center, radius) X0 = radius * sin(2*delta) + center(AXIS_X); Z0 = -radius * (cos(2*delta)-1) + center(AXIS_Z); - + X1 = +2*radius*delta_dot.*cos(2*delta); Z1 = +2*radius*delta_dot.*sin(2*delta); X2 = -4*radius*(delta_dot^2).*sin(2*delta); Z2 = +4*radius*(delta_dot^2).*cos(2*delta); - + X3 = -8*radius*(delta_dot^3).*cos(2*delta); Z3 = -8*radius*(delta_dot^3).*sin(2*delta); - + X4 = +16*radius*(delta_dot^4).*sin(2*delta); Z4 = -16*radius*(delta_dot^4).*cos(2*delta); @@ -69,17 +69,17 @@ function [time_out, Xref] = get_reference_poly(duration, a, b) p3 = b(1:2); p1 = p0 - a(3:4); p2 = p3 - b(3:4); - + d0 = p1 - p0; d1 = p2 - p1; d2 = p3 - p2; - + dd0 = d1 - d0; dd1 = d2 - d1; ddd0 = dd1 - dd0; - - dt = 1/512; + + dt = 1/512; dt = 1/512; time = 0:dt:duration; @@ -91,8 +91,8 @@ function [time_out, Xref] = get_reference_poly(duration, a, b) Xref(5:6,i) = 2*((1-t)*dd0 + t * dd1 ); Xref(7:8,i) = ddd0; end - - + + endfunction @@ -134,16 +134,16 @@ function [time, Xref] = get_reference_poly2(duration, a, b) p0_7 = 1/4*(p1_7 - p0_8); p1_6 = 1/4*(p2_6 - p1_7); p2_5 = 1/4*(p3_5 - p2_6); - + p0_6 = 1/5*(p1_6 - p0_7); p1_5 = 1/5*(p2_5 - p1_6); - + p0_5 = 1/6*(p1_5 - p0_6); p1_4 = p0_4 + p0_5; // p2_4 = ; // p2_3 = ; - + // p3_4 = ; // p3_3 = ; // p3_4 = ; @@ -153,8 +153,8 @@ function [time, Xref] = get_reference_poly2(duration, a, b) // p4_3 = ; // p4_2 = ; // p4_1 = ; - - dt = 1/512; + + dt = 1/512; dt = 1/512; time = 0:dt:duration; @@ -167,7 +167,7 @@ function [time, Xref] = get_reference_poly2(duration, a, b) // Xref(7:8,i) = p3_0*(1-t)^6 + p3_1*t*(1-t)^5 + p3_2*t^2*(1-t)^4 + p3_3*t^3*(1-t)^3 + p3_4*t^4*(1-t)^2 + p3_5*t^5*(1-t)^1 + p3_6*t^6*; // Xref(9:10,i) = p4_0*(1-t)^5 + p4_1*t*(1-t)^4 + p4_2*t^2*(1-t)^3 + p4_3*t^3*(1-t)^2 + p4_4*t^4*(1-t)^1 + p4_5*t^5; end - + endfunction function [time_out, ref_out] = get_reference_poly3(time_in, ref_in, duration, state_out) @@ -213,18 +213,18 @@ function [time_out, ref_out] = get_reference_lti4(time_in, ref_in, duration, pos xdot = lti4_get_derivatives(0, refi, pos_out) ref_out = [ref_out [refi; xdot(7:8)]]; end - + endfunction -lti4_omega1 = [ rad_of_deg(35); rad_of_deg(35)]; -lti4_zeta1 = [ 0.9; 0.9 ]; +lti4_omega1 = [ rad_of_deg(35); rad_of_deg(35)]; +lti4_zeta1 = [ 0.9; 0.9 ]; -lti4_omega2 = [ rad_of_deg(720); rad_of_deg(720)]; -lti4_zeta2 = [ 0.9; 0.9 ]; +lti4_omega2 = [ rad_of_deg(720); rad_of_deg(720)]; +lti4_zeta2 = [ 0.9; 0.9 ]; lti4_a0 = lti4_omega1^2 .* lti4_omega2^2; lti4_a1 = 2 * lti4_zeta1 .* lti4_omega1 .* lti4_omega2^2 + ... - 2 * lti4_zeta2 .* lti4_omega2 .* lti4_omega1^2; + 2 * lti4_zeta2 .* lti4_omega2 .* lti4_omega1^2; lti4_a2 = lti4_omega1^2 + ... 2 * lti4_zeta1 .* lti4_omega1 .* lti4_zeta2 .* lti4_omega2 + ... lti4_omega2^2; diff --git a/sw/simulator/scilab/q3d/q3d_sbb.sci b/sw/simulator/scilab/q3d/q3d_sbb.sci index 1e0885c044..5a8ee0e83e 100644 --- a/sw/simulator/scilab/q3d/q3d_sbb.sci +++ b/sw/simulator/scilab/q3d/q3d_sbb.sci @@ -11,7 +11,7 @@ function [fo_traj] = sbb_gen_traj(time, dyn, max_speed, max_accel, b0, b1) order = 5; fo_traj = zeros(n_comp, order, length(time)); - for compo=1:n_comp + for compo=1:n_comp // compute trajectory caracteristics dist = b1(compo)-b0(compo); if (abs(dist) > 0.01) @@ -40,21 +40,21 @@ function [fo_traj] = sbb_gen_traj(time, dyn, max_speed, max_accel, b0, b1) printf('step_dt :%f\n', step_dt); printf('step_xdd :%f\n', step_xdd); printf('total time:%f\n', t_tot); - - + + fo_traj(compo,1,1) = b0(compo); for i=2:length(time) if time(i)-time(1) < step_dt - sp = sign(dist)*step_xdd; + sp = sign(dist)*step_xdd; elseif time(i)-time(1) < t_tot - step_dt & time(i)-time(1) >= t_tot - 2 * step_dt - sp = -sign(dist)*step_xdd; + sp = -sign(dist)*step_xdd; else sp = 0; end - fo_traj(compo,:,i) = propagate_traj(fo_traj(compo,:,i-1), dyn(compo,:), sp, time(i) - time(i-1)); + fo_traj(compo,:,i) = propagate_traj(fo_traj(compo,:,i-1), dyn(compo,:), sp, time(i) - time(i-1)); end end - + endfunction function [Xi1] = propagate_traj(Xi, dyn, sp, dt) diff --git a/sw/simulator/scilab/q3d/q3d_sensors.sci b/sw/simulator/scilab/q3d/q3d_sensors.sci index 754c29d79d..cbf0ae99aa 100644 --- a/sw/simulator/scilab/q3d/q3d_sensors.sci +++ b/sw/simulator/scilab/q3d/q3d_sensors.sci @@ -24,13 +24,13 @@ endfunction function sensors_run(i) global sensors_state; - + accel_inertial = fdm_accel(FDM_AX:FDM_AZ, i) - [0, -9.81]'; in_2_body = [ cos(fdm_state(FDM_STHETA, i)) sin(fdm_state(FDM_STHETA, i)) - -sin(fdm_state(FDM_STHETA, i)) cos(fdm_state(FDM_STHETA, i)) ]; + -sin(fdm_state(FDM_STHETA, i)) cos(fdm_state(FDM_STHETA, i)) ]; accel_body = in_2_body * accel_inertial + accel_noise * rand(2,1,'normal'); sensors_state(SEN_SAX:SEN_SAZ, i) = accel_body; sensors_state(SEN_SG, i) = fdm_state(FDM_STHETAD, i) + gyro_noise * rand(1,1,'normal') + gyro_bias; - + endfunction diff --git a/sw/simulator/scilab/q3d/q3d_string.sci b/sw/simulator/scilab/q3d/q3d_string.sci index 9bebf64b4a..efbd5f816a 100644 --- a/sw/simulator/scilab/q3d/q3d_string.sci +++ b/sw/simulator/scilab/q3d/q3d_string.sci @@ -2,8 +2,8 @@ function [traj] = string_get_traj() - - M=fscanfMat('fonts/e_cms.csv'); + + M=fscanfMat('fonts/e_cms.csv'); X = M(:,1); Y = M(:,2); @@ -11,12 +11,12 @@ function [traj] = string_get_traj() X = [X; X(1)]; Y = [Y; Y(1)]; - + delta_x = max(X) - min(X); sf = 3/delta_x; X = sf * X; Y = sf * Y; - + speed = 2; dt = 1/512; @@ -33,15 +33,15 @@ function [traj] = string_get_traj() end i = i+1; end - + traj = [traj zeros(2,1024)]; - - + + endfunction function [traj1, traj5] = string_get_traj2() - - M=fscanfMat('fonts/e_cms.csv'); + + M=fscanfMat('fonts/e_cms.csv'); X = M(:,1); Y = M(:,2); @@ -55,14 +55,14 @@ function [traj1, traj5] = string_get_traj2() // offset to start at [0;0] X = X - X(1); Y = Y - Y(1); - + traj1 = [X';Y']; X = [X; X(1)]; Y = [Y; Y(1)]; traj5 = []; - + // for i=1:length(X) i = 1; p0 = [X(1); Y(1)]; @@ -70,12 +70,12 @@ function [traj1, traj5] = string_get_traj2() p2 = [X(3); Y(3)]; p3 = [X(4); Y(4)]; for t=0:dt:1 - p = (1-t)^3*p0 + 3*(1-t)^2*t*p1 + 3*(1-t)*t^2*p2 + t^3*p3; + p = (1-t)^3*p0 + 3*(1-t)^2*t*p1 + 3*(1-t)*t^2*p2 + t^3*p3; traj5 = [traj5 p]; end - + // traj5 = [X';Y']; // end - + endfunction diff --git a/sw/simulator/scilab/q3d/q3d_utils.sci b/sw/simulator/scilab/q3d/q3d_utils.sci index 17277e3723..d420f6f064 100644 --- a/sw/simulator/scilab/q3d/q3d_utils.sci +++ b/sw/simulator/scilab/q3d/q3d_utils.sci @@ -56,7 +56,7 @@ function draw_quad(i, _rect) earth_lines(j) = dcmt*body_lines(j)'; plot2d(earth_lines(j)(1,:)+fdm_state(FDM_SX,i),earth_lines(j)(2,:)+fdm_state(FDM_SZ,i),1, rect=_rect); end - + endfunction @@ -68,9 +68,9 @@ function gen_video() min_z = min(fdm_state(FDM_SZ,:))-margin; max_z = max(fdm_state(FDM_SZ,:))+margin; _rect = [min_x min_z max_x max_z]; - + dt_display = 1/25; - + time_display = 0; frame_idx = 1; for i=1:length(fdm_time) @@ -94,6 +94,6 @@ function gen_video() frame_idx = frame_idx + 1; end end - + endfunction diff --git a/sw/simulator/scilab/q3d/test_adapt.sce b/sw/simulator/scilab/q3d/test_adapt.sce index 018410a8f9..76d85bceab 100644 --- a/sw/simulator/scilab/q3d/test_adapt.sce +++ b/sw/simulator/scilab/q3d/test_adapt.sce @@ -52,14 +52,14 @@ adp_init(time, [16.5 110]', []); sensors_init(time) for i=2:length(time) - ctl_run(i-1, adp_est(1,i-1), adp_est(2,i-1)); -// ctl_run(i-1, 16, 100); + ctl_run(i-1, adp_est(1,i-1), adp_est(2,i-1)); +// ctl_run(i-1, 16, 100); fdm_run(i, ctl_motor_cmd(:,i-1)); sensors_run(i); adp_run(i); end - + set("current_figure",1); display_control(time, ctl_diff_flat_ref, fdm_state, ctl_diff_flat_cmd, ctl_fb_cmd, ctl_motor_cmd ); diff --git a/sw/simulator/scilab/q3d/test_circle.sce b/sw/simulator/scilab/q3d/test_circle.sce index e6edde35bf..db16030f67 100644 --- a/sw/simulator/scilab/q3d/test_circle.sce +++ b/sw/simulator/scilab/q3d/test_circle.sce @@ -33,8 +33,8 @@ b1 = [-5 0 0 0 0; 0 0 0 0 0]; [time, fo_traj] = merge_traj(list(time1, time2, time3), list(fo_traj1, fo_traj2, fo_traj3)); - - + + diff_flat_cmd = zeros(2,length(time)); diff_flat_ref = zeros(FDM_SSIZE, length(time)); for i=1:length(time) @@ -42,7 +42,7 @@ for i=1:length(time) diff_flat_ref(:,i) = df_state_of_fo(fo_traj(:,:,i)); end -fdm_init(time, df_state_of_fo(fo_traj(:,:,1))); +fdm_init(time, df_state_of_fo(fo_traj(:,:,1))); for i=2:length(time) u1 = diff_flat_cmd(1,i-1); u2 = diff_flat_cmd(2,i-1); diff --git a/sw/simulator/scilab/q3d/test_polynomial.sce b/sw/simulator/scilab/q3d/test_polynomial.sce index 040b2762af..6d514547e6 100644 --- a/sw/simulator/scilab/q3d/test_polynomial.sce +++ b/sw/simulator/scilab/q3d/test_polynomial.sce @@ -24,7 +24,7 @@ time = t0:dt:t1; [fo_traj] = poly_gen_traj(time, coefs); - + set("current_figure",0); clf(); f=get("current_figure"); diff --git a/sw/simulator/scilab/q3d/test_stop_stop.sce b/sw/simulator/scilab/q3d/test_stop_stop.sce index 92712e5cab..9819a31ffa 100644 --- a/sw/simulator/scilab/q3d/test_stop_stop.sce +++ b/sw/simulator/scilab/q3d/test_stop_stop.sce @@ -38,13 +38,13 @@ if (0) // analytic definition [fo_traj] = fo_traj_circle(time, [0 0], 2, rad_of_deg(45)); end - - + + fdm_init(time, df_state_of_fo(fo_traj(:,:,1)), [0.25 0.25]'); ctl_init(time); for i=2:length(time) - ctl_run(i-1, fdm_Ct0/fdm_mass, fdm_la*fdm_Ct0/fdm_inertia); + ctl_run(i-1, fdm_Ct0/fdm_mass, fdm_la*fdm_Ct0/fdm_inertia); fdm_run(i, ctl_motor_cmd(:,i-1)); end diff --git a/sw/simulator/scilab/q6d/q6d_ahrs.sci b/sw/simulator/scilab/q6d/q6d_ahrs.sci index 8c560a8fd5..b45438e262 100644 --- a/sw/simulator/scilab/q6d/q6d_ahrs.sci +++ b/sw/simulator/scilab/q6d/q6d_ahrs.sci @@ -13,7 +13,7 @@ global ahrs_state; global ahrs_euler; global ahrs_rate; -function ahrs_init() +function ahrs_init() global fdm_time; @@ -24,7 +24,7 @@ function ahrs_init() ahrs_euler = zeros(AXIS_NB, length(fdm_time)); global ahrs_rate; ahrs_rate = zeros(AXIS_NB, length(fdm_time)); - + endfunction @@ -45,10 +45,10 @@ function ahrs_propagate(i) quat_dot = -1/2 * W * quat; quat_dot = quat_dot + K_lagrange * ( 1 - norm(quat)) * quat; dt = 1/512; - ahrs_state(AHRS_QI:AHRS_QZ, i) = ahrs_state(AHRS_QI:AHRS_QZ, i-1) + dt * quat_dot; - + ahrs_state(AHRS_QI:AHRS_QZ, i) = ahrs_state(AHRS_QI:AHRS_QZ, i-1) + dt * quat_dot; + ahrs_euler(:,i) = euler_of_quat(ahrs_state(AHRS_QI:AHRS_QZ,i)); - + endfunction function ahrs_display() @@ -59,7 +59,7 @@ function ahrs_display() global fdm_raccel; global fdm_time; - + subplot(nr,nc,1); plot2d(fdm_time, deg_of_rad(fdm_euler(EULER_PHI,:)),3); plot2d(fdm_time, deg_of_rad(ahrs_euler(EULER_PHI,:)),2); @@ -101,7 +101,7 @@ legends(["setpoint", "reference", "fdm"],[5 2 3], with_box=%f, opt="ur"); plot2d(fdm_time, fdm_raccel(AXIS_Z,:),3); legends(["setpoint", "reference", "fdm"],[5 2 3], with_box=%f, opt="ur"); xtitle('Rd'); - - - + + + endfunction diff --git a/sw/simulator/scilab/q6d/q6d_algebra.sci b/sw/simulator/scilab/q6d/q6d_algebra.sci index 8b7e3dd7d6..750e052feb 100644 --- a/sw/simulator/scilab/q6d/q6d_algebra.sci +++ b/sw/simulator/scilab/q6d/q6d_algebra.sci @@ -48,7 +48,7 @@ Q_SIZE = 4; // -// +// // function [quat] = quat_null() quat = [1 0 0 0]'; @@ -88,26 +88,26 @@ endfunction // // // -function [quat] = quat_of_euler(euler) +function [quat] = quat_of_euler(euler) phi2 = euler(EULER_PHI) / 2.0; theta2 = euler(EULER_THETA) / 2.0; - psi2 = euler(EULER_PSI) / 2.0; - - sinphi2 = sin( phi2 ); - cosphi2 = cos( phi2 ); - sintheta2 = sin( theta2 ); - costheta2 = cos( theta2 ); - sinpsi2 = sin( psi2 ); - cospsi2 = cos( psi2 ); - + psi2 = euler(EULER_PSI) / 2.0; + + sinphi2 = sin( phi2 ); + cosphi2 = cos( phi2 ); + sintheta2 = sin( theta2 ); + costheta2 = cos( theta2 ); + sinpsi2 = sin( psi2 ); + cospsi2 = cos( psi2 ); + q0 = cosphi2 * costheta2 * cospsi2 + sinphi2 * sintheta2 * sinpsi2; q1 = -cosphi2 * sintheta2 * sinpsi2 + sinphi2 * costheta2 * cospsi2; q2 = cosphi2 * sintheta2 * cospsi2 + sinphi2 * costheta2 * sinpsi2; q3 = cosphi2 * costheta2 * sinpsi2 - sinphi2 * sintheta2 * cospsi2; - + quat = [q0 q1 q2 q3]'; - + endfunction // @@ -132,7 +132,7 @@ endfunction // // function [qo] = quat_normalize(qi) - qo = qi / norm(qi); + qo = qi / norm(qi); endfunction // diff --git a/sw/simulator/scilab/q6d/q6d_ctl.sci b/sw/simulator/scilab/q6d/q6d_ctl.sci index bfe9a50c57..6b31efa81b 100644 --- a/sw/simulator/scilab/q6d/q6d_ctl.sci +++ b/sw/simulator/scilab/q6d/q6d_ctl.sci @@ -36,9 +36,9 @@ function ctl_run(i, fo_tra) ctl_diff_flat_ref(:,i) = df_ref_of_fo(fo_tra); global ctl_u; ctl_u(:,i) = ctl_diff_flat_cmd(:,i); - motor_of_cmd = [ 0.25 0. 0.5 -0.25 - 0.25 -0.5 0. 0.25 - 0.25 0. -0.5 -0.25 + motor_of_cmd = [ 0.25 0. 0.5 -0.25 + 0.25 -0.5 0. 0.25 + 0.25 0. -0.5 -0.25 0.25 0.5 0. 0.25 ]; global ctl_motor_cmd; ctl_motor_cmd(:,i) = 1/fdm_Ct0 * motor_of_cmd * ctl_u(:,i); diff --git a/sw/simulator/scilab/q6d/q6d_diff_flatness.sci b/sw/simulator/scilab/q6d/q6d_diff_flatness.sci index b986b1c09b..69430277c1 100644 --- a/sw/simulator/scilab/q6d/q6d_diff_flatness.sci +++ b/sw/simulator/scilab/q6d/q6d_diff_flatness.sci @@ -40,43 +40,43 @@ function [ref] = df_ref_of_fo(fo) ref(DF_REF_ZD) = fo(DF_FO_Z,2); ref(DF_REF_PSI) = fo(DF_FO_PSI,1); - + psi = ref(DF_REF_PSI); cpsi = cos(psi); spsi = sin(psi); - + x2d = fo(1,3); y2d = fo(2,3); z2d = fo(3,3); - + axpsi = cpsi*x2d + spsi*y2d; aypsi = spsi*x2d - cpsi*y2d; z2dmg = z2d - DF_G; av = sqrt(axpsi^2 + z2dmg^2); - + ref(DF_REF_PHI) = sign(z2dmg)*atan(aypsi/av); ref(DF_REF_THETA) = atan(axpsi/z2dmg); - + x3d = fo(1,4); y3d = fo(2,4); z3d = fo(3,4); - + jxpsi = cpsi*x3d + spsi*y3d; jypsi = spsi*x3d - cpsi*y3d; - + x4d = fo(1,5); y4d = fo(2,5); - + kxpsi = cpsi*x4d + spsi*y4d; kypsi = spsi*x4d - cpsi*y4d; psid = fo(4,2); - + adxpsi = -psid*aypsi + jxpsi; adypsi = psid*axpsi + jypsi; adv = (axpsi*adxpsi + z2dmg*fo(3,4))/av; - + phid = sign(z2dmg)*(adypsi*av-adv*aypsi)/(aypsi^2+av^2); thetad = (adxpsi*z2dmg-z3d*axpsi)/(axpsi^2+z2dmg^2); @@ -84,11 +84,11 @@ function [ref] = df_ref_of_fo(fo) sphi = sin(ref(DF_REF_PHI)); ctheta = cos(ref(DF_REF_THETA)); stheta = sin(ref(DF_REF_THETA)); - + ref(DF_REF_P) = phid - stheta*psid; ref(DF_REF_Q) = cphi*thetad + sphi*ctheta*psid; ref(DF_REF_R) = -sphi*thetad + cphi*ctheta*psid; - + endfunction @@ -98,41 +98,41 @@ endfunction function [inp] = df_input_of_fo(fo) inp = zeros(4,1); - + x2d = fo(1,3); y2d = fo(2,3); z2d = fo(3,3); z2dmg = z2d - DF_G; inp(1) = DF_MASS * sqrt(x2d^2+y2d^2+z2dmg^2); - + psi = fo(4,1); psid = fo(4,2); psi2d = fo(4,3); - + cpsi = cos(psi); spsi = sin(psi); - + axpsi = cpsi*x2d + spsi*y2d; aypsi = spsi*x2d - cpsi*y2d; - + x3d = fo(1,4); y3d = fo(2,4); - + jxpsi = cpsi*x3d + spsi*y3d; jypsi = spsi*x3d - cpsi*y3d; - + x4d = fo(1,5); y4d = fo(2,5); - + kxpsi = cpsi*x4d + spsi*y4d; kypsi = spsi*x4d - cpsi*y4d; - + adxpsi = -psid*aypsi + jxpsi; adypsi = psid*axpsi + jypsi; - + a2dxpsi = -psi2d*aypsi - psid^2*axpsi - 2*psid*jypsi + kxpsi; a2dypsi = psi2d*axpsi - psid^2*aypsi + 2*psid*jxpsi + kypsi; - + av = sqrt(axpsi^2 + z2dmg^2); z3d = fo(3,4); adv = (axpsi*adxpsi + z2dmg*z3d)/av; @@ -140,43 +140,43 @@ function [inp] = df_input_of_fo(fo) a = (axpsi*a2dxpsi + adxpsi^2 + (z2dmg)*z4d +z3d^2)*av; b = -adv*(axpsi*adxpsi + z2dmg*z3d); a2dv = (a+b)/av^2; - + phi = sign(z2dmg)*atan(aypsi/av); theta = atan(axpsi/z2dmg); - + phid = sign(z2dmg)*(adypsi*av-adv*aypsi)/(aypsi^2+av^2); thetad = (adxpsi*z2dmg-z3d*axpsi)/(axpsi^2+z2dmg^2); - + a = (a2dypsi*av-a2dv*aypsi)*(aypsi^2+av^2); b = -2*(aypsi*adypsi+av*adv)*(adypsi*av-adv*aypsi); c = (aypsi^2+av^2)^2; phi2d = sign(z2dmg)*(a+b)/c; - + a = (a2dxpsi*z2dmg-z4d*axpsi)*(axpsi^2+z2dmg^2); b = -2*(axpsi*adxpsi+z2dmg*z3d)*(adxpsi*z2dmg-z3d*axpsi); c = (axpsi^2+z2dmg^2)^2; theta2d = (a+b)/c; - + cphi = cos(phi); sphi = sin(phi); ctheta = cos(theta); stheta = sin(theta); - + p = phid - stheta*psid; q = cphi*thetad + sphi*ctheta*psid; r = -sphi*thetad + cphi*ctheta*psid; - + pd = phi2d - ctheta*thetad*psid - stheta*psi2d; a = -sphi*phid*thetad + cphi*theta2d + cphi*ctheta*phid*psid; b = -sphi*stheta*thetad*psid + sphi*ctheta*psi2d; qd = a+b; a = -cphi*phid*thetad - sphi*theta2d - sphi*ctheta*phid*psid; - b = -cphi*stheta*thetad*psid + cphi*ctheta*psi2d; + b = -cphi*stheta*thetad*psid + cphi*ctheta*psi2d; rd = a+b; - + inp(2) = 1/DF_L*(DF_JXX*pd + (DF_JZZ-DF_JYY)*q*r); inp(3) = 1/DF_L*(DF_JYY*qd + (DF_JXX-DF_JZZ)*p*r); inp(4) = 1/DF_CM_OV_CT*(DF_JZZ*rd + (DF_JYY-DF_JXX)*p*q); - + endfunction \ No newline at end of file diff --git a/sw/simulator/scilab/q6d/q6d_display.sci b/sw/simulator/scilab/q6d/q6d_display.sci index 0a9cd7f38d..9d0553f614 100644 --- a/sw/simulator/scilab/q6d/q6d_display.sci +++ b/sw/simulator/scilab/q6d/q6d_display.sci @@ -1,98 +1,98 @@ function display_fo_traj(time, fo_traj) - + f=get("current_figure"); f.figure_name="Flat Outputs Trajectory"; subplot(5,4,1); plot2d(time, matrix(fo_traj(1,1,:), 1, length(time))); - xtitle('X(0)'); - + xtitle('X(0)'); + subplot(5,4,2); plot2d(time, matrix(fo_traj(2,1,:), 1, length(time))); xtitle('Y(0)'); - + subplot(5,4,3); plot2d(time, matrix(fo_traj(3,1,:), 1, length(time))); xtitle('Z(0)'); - + subplot(5,4,4); plot2d(time, deg_of_rad(matrix(fo_traj(4,1,:), 1, length(time)))); xtitle('PSI(0)'); - - + + subplot(5,4,5); plot2d(time, matrix(fo_traj(1,2,:), 1, length(time))); - xtitle('X(1)'); - + xtitle('X(1)'); + subplot(5,4,6); plot2d(time, matrix(fo_traj(2,2,:), 1, length(time))); xtitle('Y(1)'); - + subplot(5,4,7); plot2d(time, matrix(fo_traj(3,2,:), 1, length(time))); xtitle('Z(1)'); - + subplot(5,4,8); plot2d(time, deg_of_rad(matrix(fo_traj(4,2,:), 1, length(time)))); xtitle('PSI(1)'); - - - + + + subplot(5,4,9); plot2d(time, matrix(fo_traj(1,3,:), 1, length(time))); - xtitle('X(2)'); - + xtitle('X(2)'); + subplot(5,4,10); plot2d(time, matrix(fo_traj(2,3,:), 1, length(time))); xtitle('Y(2)'); - + subplot(5,4,11); plot2d(time, matrix(fo_traj(3,3,:), 1, length(time))); xtitle('Z(2)'); - + subplot(5,4,12); plot2d(time, deg_of_rad(matrix(fo_traj(4,3,:), 1, length(time)))); xtitle('PSI(2)'); - - - + + + subplot(5,4,13); plot2d(time, matrix(fo_traj(1,4,:), 1, length(time))); - xtitle('X(3)'); - + xtitle('X(3)'); + subplot(5,4,14); plot2d(time, matrix(fo_traj(2,4,:), 1, length(time))); xtitle('Y(3)'); - + subplot(5,4,15); plot2d(time, matrix(fo_traj(3,4,:), 1, length(time))); xtitle('Z(3)'); - + // subplot(5,4,16); // plot2d(time, deg_of_rad(matrix(fo_traj(4,4,:), 1, length(time)))); // xtitle('PSI(3)'); - - - + + + subplot(5,4,17); plot2d(time, matrix(fo_traj(1,5,:), 1, length(time))); - xtitle('X(4)'); - + xtitle('X(4)'); + subplot(5,4,18); plot2d(time, matrix(fo_traj(2,5,:), 1, length(time))); xtitle('Y(4)'); - + subplot(5,4,19); plot2d(time, matrix(fo_traj(3,5,:), 1, length(time))); xtitle('Z(4)'); - + // subplot(5,4,20); // plot2d(time, deg_of_rad(matrix(fo_traj(4,5,:), 1, length(time)))); // xtitle('PSI(4)'); - + endfunction @@ -100,57 +100,57 @@ function display_df_ref(time, diff_flat_ref) f=get("current_figure"); f.figure_name="Reference"; - + subplot(6,2,1); plot2d(time, diff_flat_ref(DF_REF_X,:)); - xtitle('X'); - + xtitle('X'); + subplot(6,2,3); plot2d(time, diff_flat_ref(DF_REF_Y,:)); - xtitle('Y'); + xtitle('Y'); subplot(6,2,5); plot2d(time, diff_flat_ref(DF_REF_Z,:)); - xtitle('Z'); + xtitle('Z'); subplot(6,2,7); plot2d(time, deg_of_rad(diff_flat_ref(DF_REF_PHI,:))); - xtitle('PHI'); - + xtitle('PHI'); + subplot(6,2,9); plot2d(time, deg_of_rad(diff_flat_ref(DF_REF_THETA,:))); - xtitle('THETA'); + xtitle('THETA'); subplot(6,2,11); plot2d(time, deg_of_rad(diff_flat_ref(DF_REF_PSI,:))); - xtitle('PSI'); + xtitle('PSI'); + - subplot(6,2,2); plot2d(time, diff_flat_ref(DF_REF_XD,:)); - xtitle('XD'); - + xtitle('XD'); + subplot(6,2,4); plot2d(time, diff_flat_ref(DF_REF_YD,:)); - xtitle('YD'); + xtitle('YD'); subplot(6,2,6); plot2d(time, diff_flat_ref(DF_REF_ZD,:)); - xtitle('ZD'); + xtitle('ZD'); subplot(6,2,8); plot2d(time, deg_of_rad(diff_flat_ref(DF_REF_P,:))); - xtitle('P'); - + xtitle('P'); + subplot(6,2,10); plot2d(time, deg_of_rad(diff_flat_ref(DF_REF_Q,:))); - xtitle('Q'); + xtitle('Q'); subplot(6,2,12); plot2d(time, deg_of_rad(diff_flat_ref(DF_REF_R,:))); - xtitle('R'); + xtitle('R'); endfunction @@ -162,19 +162,19 @@ function display_df_cmd(time, diff_flat_cmd) subplot(2,4,1); plot2d(time, diff_flat_cmd(1,:)); - xtitle('Ut'); + xtitle('Ut'); subplot(2,4,2); plot2d(time, diff_flat_cmd(2,:)); - xtitle('Up'); + xtitle('Up'); subplot(2,4,3); plot2d(time, diff_flat_cmd(3,:)); - xtitle('Uq'); + xtitle('Uq'); subplot(2,4,4); plot2d(time, diff_flat_cmd(4,:)); - xtitle('Ur'); + xtitle('Ur'); endfunction @@ -183,19 +183,19 @@ function display_motor_cmd(time, motor_cmd) subplot(2,4,5); plot2d(time, motor_cmd(1,:)); - xtitle('F1'); + xtitle('F1'); subplot(2,4,6); plot2d(time, motor_cmd(2,:)); - xtitle('F2'); + xtitle('F2'); subplot(2,4,7); plot2d(time, motor_cmd(3,:)); - xtitle('F3'); + xtitle('F3'); subplot(2,4,8); plot2d(time, motor_cmd(4,:)); - xtitle('F4'); + xtitle('F4'); endfunction @@ -208,7 +208,7 @@ function display_fdm(time, state, euler) subplot(4,3,1); plot2d(time, state(FDM_SX,:)); xtitle('X'); - + subplot(4,3,2); plot2d(time, state(FDM_SY,:)); xtitle('Y'); @@ -217,11 +217,11 @@ function display_fdm(time, state, euler) plot2d(time, state(FDM_SZ,:)); xtitle('Z'); - + subplot(4,3,4); plot2d(time, state(FDM_SXD,:)); xtitle('Xd'); - + subplot(4,3,5); plot2d(time, state(FDM_SYD,:)); xtitle('Yd'); @@ -230,11 +230,11 @@ function display_fdm(time, state, euler) plot2d(time, state(FDM_SZD,:)); xtitle('Zd'); - + subplot(4,3,7); plot2d(time, deg_of_rad(euler(FDM_EPHI,:))); xtitle('Phi'); - + subplot(4,3,8); plot2d(time, deg_of_rad(euler(FDM_ETHETA,:))); xtitle('Theta'); @@ -247,7 +247,7 @@ function display_fdm(time, state, euler) subplot(4,3,10); plot2d(time, deg_of_rad(state(FDM_SP,:))); xtitle('p'); - + subplot(4,3,11); plot2d(time, deg_of_rad(state(FDM_SQ,:))); xtitle('q'); @@ -269,7 +269,7 @@ function display_control(time, fdm_state, fdm_euler, diff_flat_ref) plot2d(time, fdm_state(FDM_SX,:), 2); plot2d(time, diff_flat_ref(DF_REF_X,:),3); xtitle('X'); - legends(["fdm", "ref"],[2 3], with_box=%f, opt="ul"); + legends(["fdm", "ref"],[2 3], with_box=%f, opt="ul"); subplot(4,3,2); plot2d(time, fdm_state(FDM_SY,:), 2); @@ -281,12 +281,12 @@ function display_control(time, fdm_state, fdm_euler, diff_flat_ref) plot2d(time, diff_flat_ref(DF_REF_Z,:),3); xtitle('Z'); - + subplot(4,3,4); plot2d(time, fdm_state(FDM_SXD,:), 2); plot2d(time, diff_flat_ref(DF_REF_XD,:),3); xtitle('Xd'); - + subplot(4,3,5); plot2d(time, fdm_state(FDM_SYD,:), 2); plot2d(time, diff_flat_ref(DF_REF_YD,:),3); @@ -297,12 +297,12 @@ function display_control(time, fdm_state, fdm_euler, diff_flat_ref) plot2d(time, diff_flat_ref(DF_REF_ZD,:),3); xtitle('Zd'); - + subplot(4,3,7); plot2d(time, deg_of_rad(fdm_euler(FDM_EPHI,:)), 2); plot2d(time, deg_of_rad(diff_flat_ref(DF_REF_PHI,:)), 3); xtitle('Phi'); - + subplot(4,3,8); plot2d(time, deg_of_rad(fdm_euler(FDM_ETHETA,:)), 2); plot2d(time, deg_of_rad(diff_flat_ref(DF_REF_THETA,:)), 3); @@ -318,7 +318,7 @@ function display_control(time, fdm_state, fdm_euler, diff_flat_ref) plot2d(time, deg_of_rad(fdm_state(FDM_SP,:)), 2); plot2d(time, deg_of_rad(diff_flat_ref(DF_REF_P,:)), 3); xtitle('p'); - + subplot(4,3,11); plot2d(time, deg_of_rad(fdm_state(FDM_SQ,:)), 2); plot2d(time, deg_of_rad(diff_flat_ref(DF_REF_Q,:)), 3); @@ -341,7 +341,7 @@ function display_sensors(time) subplot(3,3,1); plot2d(time, deg_of_rad(sensor_gyro(1,:)), 2); xtitle('gyro p'); - + subplot(3,3,2); plot2d(time, deg_of_rad(sensor_gyro(2,:)), 2); xtitle('gyro q'); @@ -350,11 +350,11 @@ function display_sensors(time) plot2d(time, deg_of_rad(sensor_gyro(3,:)), 2); xtitle('gyro r'); - + subplot(3,3,4); plot2d(time, sensor_accel(1,:), 2); xtitle('accel x'); - + subplot(3,3,5); plot2d(time, sensor_accel(2,:), 2); xtitle('accel y'); @@ -366,7 +366,7 @@ function display_sensors(time) subplot(3,3,7); plot2d(time, sensor_mag(1,:), 2); xtitle('mag x'); - + subplot(3,3,8); plot2d(time, sensor_mag(2,:), 2); xtitle('mag y'); diff --git a/sw/simulator/scilab/q6d/q6d_fdm.sci b/sw/simulator/scilab/q6d/q6d_fdm.sci index 718f3ee1bb..d7b10cc43d 100644 --- a/sw/simulator/scilab/q6d/q6d_fdm.sci +++ b/sw/simulator/scilab/q6d/q6d_fdm.sci @@ -53,8 +53,8 @@ fdm_inertia = [0.0078 0. 0. // inertia tensor 0. 0.0078 0. 0. 0. 0.0137 ]; fdm_Ct0 = 4. * fdm_mass * fdm_g / 4; // thrust coefficient -//fdm_V0 = 7.; // -fdm_V0 = 1e6; // +//fdm_V0 = 7.; // +fdm_V0 = 1e6; // //fdm_Cd = 0.01; // drag coefficient fdm_Cd = 1e-6; // drag coefficient fdm_la = 0.25; // arm length @@ -74,7 +74,7 @@ global fdm_accel; global fdm_raccel; -function fdm_init(time, X0) +function fdm_init(time, X0) global fdm_time; fdm_time = time; @@ -143,13 +143,13 @@ function [F_ltp] = fdm_get_forces_ltp(X, U) airspeed_body = quat_vect_mult(quat, airspeed_ltp); lift_body = [0; 0; -sum(U) * fdm_Ct0 * ( 1 - abs(1/fdm_V0 * airspeed_body(AXIS_Z)))]; lift_ltp = quat_vect_inv_mult(quat, lift_body); - + weight_ltp = [0; 0; fdm_g * fdm_mass]; - + drag_ltp = -fdm_Cd * norm(airspeed_ltp) * airspeed_ltp; F_ltp = lift_ltp + weight_ltp + drag_ltp; - + endfunction @@ -160,7 +160,7 @@ function [M_body] = fdm_get_moments_body(X, U) moments_of_u = [ 0 -k1 0 k1 k1 0 -k1 0 -k2 k2 -k2 k2 ]; - + M_body = moments_of_u * U; endfunction diff --git a/sw/simulator/scilab/q6d/q6d_fo_traj_misc.sci b/sw/simulator/scilab/q6d/q6d_fo_traj_misc.sci index ed28cd7fe2..f8af0625ad 100644 --- a/sw/simulator/scilab/q6d/q6d_fo_traj_misc.sci +++ b/sw/simulator/scilab/q6d/q6d_fo_traj_misc.sci @@ -25,16 +25,16 @@ function [fo_traj] = fo_traj_circle(time) radius = 3; omega = rad_of_deg(60); c = [0 0]'; - omega_z = rad_of_deg(105); + omega_z = rad_of_deg(105); dz = 1.; - + for i=1:length(time) fo_traj(DF_FO_X,1,i) = c(1) + radius*cos(omega*time(i)); fo_traj(DF_FO_Y,1,i) = c(2) + radius*sin(omega*time(i)); fo_traj(DF_FO_Z,1,i) = dz*sin(omega_z*time(i)); // fo_traj(DF_FO_PSI,1,i) = omega*time(i); - + fo_traj(DF_FO_X,2,i) = c(1) - omega*radius*sin(omega*time(i)); fo_traj(DF_FO_Y,2,i) = c(2) + omega*radius*cos(omega*time(i)); @@ -51,13 +51,13 @@ function [fo_traj] = fo_traj_circle(time) fo_traj(DF_FO_X,4,i) = c(1) + omega^3*radius*sin(omega*time(i)); fo_traj(DF_FO_Y,4,i) = c(2) - omega^3*radius*cos(omega*time(i)); fo_traj(DF_FO_Z,4,i) = -omega_z^3*dz*cos(omega_z*time(i)); - + fo_traj(DF_FO_X,5,i) = c(1) + omega^4*radius*cos(omega*time(i)); fo_traj(DF_FO_Y,5,i) = c(2) + omega^4*radius*sin(omega*time(i)); fo_traj(DF_FO_Z,5,i) = omega_z^4*dz*sin(omega_z*time(i)); - + end - + endfunction diff --git a/sw/simulator/scilab/q6d/q6d_guidance.sci b/sw/simulator/scilab/q6d/q6d_guidance.sci index 60a9538870..9aceb39770 100644 --- a/sw/simulator/scilab/q6d/q6d_guidance.sci +++ b/sw/simulator/scilab/q6d/q6d_guidance.sci @@ -15,8 +15,8 @@ global guidance_cmd_fb; global guidance_output_quat; global guidance_output_thrust; -guidance_omega_ref = [ rad_of_deg(90); rad_of_deg(90); rad_of_deg(270) ]; -guidance_zeta_ref = [ 0.8; 0.8; 0.8 ]; +guidance_omega_ref = [ rad_of_deg(90); rad_of_deg(90); rad_of_deg(270) ]; +guidance_zeta_ref = [ 0.8; 0.8; 0.8 ]; guidance_vsat = [ -3 3 -8 16 @@ -24,7 +24,7 @@ guidance_vsat = [ -3 3 guidance_hsat = [ -3 3 -3 3 -10 10 ]; - + guidance_thau = [ -1/1. -1/0.6 -1/0.25 -1/1. -1/0.6 -1/0.25 -1/0.36 -1/0.15 -1/0.7 ]; @@ -36,10 +36,10 @@ guidance_Kp = 0.5* [ -0.1; -0.1; -0.1]; guidance_Kd = 1.5* [ -0.1; -0.1; -0.1]; -function guidance_init() +function guidance_init() global fdm_time; - + global guidance_sp_psi; guidance_sp_psi = zeros(1, length(fdm_time)); global guidance_sp_pos; @@ -50,15 +50,15 @@ function guidance_init() guidance_ref_speed = zeros(AXIS_NB, length(fdm_time)); global guidance_ref_accel; guidance_ref_accel = zeros(AXIS_NB, length(fdm_time)); - + global guidance_output_quat; guidance_output_quat = zeros(Q_SIZE, length(fdm_time)); global guidance_output_thrust; - guidance_output_thrust = zeros(1, length(fdm_time)); + guidance_output_thrust = zeros(1, length(fdm_time)); endfunction -function guidance_run(i) +function guidance_run(i) // guidance_step_phi(i); // guidance_step_theta(i); @@ -96,7 +96,7 @@ function guidance_hover(i) global guidance_ref_accel; global ins_state; global ahrs_state; - + pos_err = ins_state(INS_SX:INS_SZ,i) - guidance_ref_pos(:,i); speed_err = ins_state(INS_SXD:INS_SZD,i) - guidance_ref_speed(:,i); @@ -107,19 +107,19 @@ function guidance_hover(i) thrust_ltp = nli_thrust_ltp + corr_thrust_ltp; axis_foo = cross_product(thrust_ltp/norm(thrust_ltp), [0; 0; -1]); - + angle_foo = asin(norm(axis_foo)); - + quat_foo = [ cos(angle_foo); -axis_foo]; - + // printf("%f %f %f\n", nli_thrust_ltp(1), nli_thrust_ltp(2), nli_thrust_ltp(3)); // printf("%f %f %f %f\n", quat_foo(1), quat_foo(2), quat_foo(3), quat_foo(4)); - + // thrust_body = quat_vect_mult(ahrs_state(AHRS_QI:AHRS_QZ, i), thrust_ltp); global guidance_output_thrust; guidance_output_thrust(i) = norm(thrust_ltp); - + global guidance_output_quat; guidance_output_quat(:, i) = quat_foo; //[1; 0; 0; 0]; endfunction @@ -143,7 +143,7 @@ function guidance_update_ref_old(i) dt = 1/512; guidance_ref_speed(:,i) = guidance_ref_speed(:,i-1) + dt * guidance_ref_accel(:,i-1); guidance_ref_pos(:,i) = guidance_ref_pos(:,i-1) + dt * guidance_ref_speed(:,i-1); - + endfunction function guidance_update_ref(i) @@ -177,7 +177,7 @@ function guidance_update_ref(i) // sp_acceld(2) = trim(sp_acceld(2), guidance_hsat(3,1), guidance_hsat(3,2)); sp_acceld(3) = trim(sp_acceld(3), guidance_vsat(3,1), guidance_vsat(3,2)); guidance_ref_acceld(:,i) = sp_acceld; - + endfunction @@ -190,7 +190,7 @@ function guidance_step_x(i) pos_sp = [ 10; 0; 0]; else pos_sp = [ -10; 0; 0]; - end + end global guidance_sp_pos; guidance_sp_pos(:,i) = pos_sp; endfunction @@ -204,7 +204,7 @@ function guidance_step_y(i) pos_sp = [ 0; 5; 0]; else pos_sp = [ 0; -5; 0]; - end + end global guidance_sp_pos; guidance_sp_pos(:,i) = pos_sp; endfunction @@ -218,7 +218,7 @@ function guidance_step_z(i) pos_sp = [ 0; 0; -1]; else pos_sp = [ 0; 0; 0]; - end + end global guidance_sp_pos; guidance_sp_pos(:,i) = pos_sp; endfunction @@ -234,7 +234,7 @@ function guidance_step_phi(i) euler_sp = [ rad_of_deg(10); 0; 0]; else euler_sp = [ rad_of_deg(-10); 0; 0]; - end + end global guidance_output_quat; guidance_output_quat(:, i) = quat_of_euler(euler_sp); endfunction @@ -247,8 +247,8 @@ function guidance_step_theta(i) if modulo(i,512) < 256 euler_sp = [ 0; rad_of_deg(10); 0]; else - euler_sp = [ 0; rad_of_deg(-10); 0]; - end + euler_sp = [ 0; rad_of_deg(-10); 0]; + end global guidance_output_quat; guidance_output_quat(:, i) = quat_of_euler(euler_sp); endfunction @@ -262,7 +262,7 @@ function guidance_step_psi(i) euler_sp = [ 0; 0; rad_of_deg(10)]; else euler_sp = [ 0; 0; rad_of_deg(-10)]; - end + end global guidance_output_quat; guidance_output_quat(:, i) = quat_of_euler(euler_sp); endfunction @@ -299,7 +299,7 @@ function guidance_display() plot2d(fdm_time, guidance_sp_pos(AXIS_Z,:),5); legends(["setpoint", "INS", "ref"],[5 2 3], with_box=%f, opt="ur"); xtitle('Z'); - + subplot(nr,nc,4); plot2d(fdm_time, ins_state(INS_SXD,:),2); plot2d(fdm_time, guidance_ref_speed(AXIS_X,:),3); @@ -315,7 +315,7 @@ function guidance_display() plot2d(fdm_time, guidance_ref_speed(AXIS_Z,:),3); legends(["setpoint", "INS", "ref"],[5 2 3], with_box=%f, opt="ur"); xtitle('Zdot'); - + subplot(nr,nc,7); plot2d(fdm_time, ins_accel(AXIS_X,:),2); plot2d(fdm_time, guidance_ref_accel(AXIS_X,:),3); @@ -331,7 +331,7 @@ function guidance_display() plot2d(fdm_time, guidance_ref_accel(AXIS_Z,:),3); legends(["setpoint", "INS", "ref"],[5 2 3], with_box=%f, opt="ur"); xtitle('Zdotdot'); - + subplot(nr,nc,12); plot2d(fdm_time, guidance_output_thrust,3); legends(["setpoint", "INS", "ref"],[5 2 3], with_box=%f, opt="ur"); diff --git a/sw/simulator/scilab/q6d/q6d_ins.sci b/sw/simulator/scilab/q6d/q6d_ins.sci index 45e0bb0a2f..7f4e49709a 100644 --- a/sw/simulator/scilab/q6d/q6d_ins.sci +++ b/sw/simulator/scilab/q6d/q6d_ins.sci @@ -21,7 +21,7 @@ function ins_init() ins_state = zeros(INS_SSIZE, length(fdm_time)); global ins_accel; ins_accel = zeros(AXIS_NB, length(fdm_time)); - + endfunction // propagate from i-1 to i @@ -42,8 +42,8 @@ function ins_propagate(i) state_dot = [ ins_state(INS_SXD:INS_SZD, i-1); ins_accel(:,i); 0; 0; 0]; // propagate dt = fdm_time(i) - fdm_time(i-1); - ins_state(:,i) = ins_state(:,i-1) + state_dot * dt; - + ins_state(:,i) = ins_state(:,i-1) + state_dot * dt; + endfunction @@ -54,7 +54,7 @@ function ins_display() global ins_state; global fdm_state; global fdm_time; - + subplot(nr,nc,1); plot2d(fdm_time, fdm_state(FDM_SX,:),3); plot2d(fdm_time, ins_state(INS_SX,:),2); diff --git a/sw/simulator/scilab/q6d/q6d_povray.sci b/sw/simulator/scilab/q6d/q6d_povray.sci index 9ed6b66323..3995b36a67 100644 --- a/sw/simulator/scilab/q6d/q6d_povray.sci +++ b/sw/simulator/scilab/q6d/q6d_povray.sci @@ -31,6 +31,6 @@ function povray_draw( time, diff_flat_ref ) mplayer_cmd = "mencoder ""mf://povray/img*.png"" -mf fps=25 -o povray/q6d.avi -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=800"; unix_g(mplayer_cmd); - + endfunction diff --git a/sw/simulator/scilab/q6d/q6d_sbb.sci b/sw/simulator/scilab/q6d/q6d_sbb.sci index 4d8814bf58..b59f3291ba 100644 --- a/sw/simulator/scilab/q6d/q6d_sbb.sci +++ b/sw/simulator/scilab/q6d/q6d_sbb.sci @@ -48,7 +48,7 @@ if 1 fo_traj(DF_FO_PSI, 2, i) = omega* cos(omega*time(i)); fo_traj(DF_FO_PSI, 3, i) = -omega^2*sin(omega*time(i)); end -end +end // x and y disp_xy = b1(1:2) - b0(1:2); [pulse_dt, pulse_ampl, traj_dt] = compute_step(norm(disp_xy), dyn(1,:), max_accel(1), max_speed(1)); @@ -68,9 +68,9 @@ end sp = 0; end fo_traj(1:2,1:4,i) = fo_traj(1:2,1:4,i-1) + fo_traj(1:2,2:5,i-1)* (time(i)-time(i-1)); - fo_traj(1:2,5,i) = -2*dyn(1,2)*dyn(1,1)*fo_traj(1:2,4,i)-dyn(1,1)^2*(fo_traj(1:2,3,i)-sp*u); + fo_traj(1:2,5,i) = -2*dyn(1,2)*dyn(1,1)*fo_traj(1:2,4,i)-dyn(1,1)^2*(fo_traj(1:2,3,i)-sp*u); end - + // z disp_z = b1(3) - b0(3); [pulse_dt, pulse_ampl, traj_dt] = compute_step(norm(disp_z), dyn(2,:), max_accel(2), max_speed(2)); @@ -87,7 +87,7 @@ end fo_traj(3,1:4,i) = fo_traj(3,1:4,i-1) + fo_traj(3,2:5,i-1)*(time(i)-time(i-1)); fo_traj(3,5,i) = -2*dyn(2,2)*dyn(2,1)*fo_traj(3,4,i)-dyn(2,1)^2*(fo_traj(3,3,i)-sp*sign(disp_z)); end - + endfunction diff --git a/sw/simulator/scilab/q6d/q6d_sensors.sci b/sw/simulator/scilab/q6d/q6d_sensors.sci index 99f5036995..24fa0132cd 100644 --- a/sw/simulator/scilab/q6d/q6d_sensors.sci +++ b/sw/simulator/scilab/q6d/q6d_sensors.sci @@ -18,21 +18,21 @@ global sensor_gps_pos; global sensor_gps_speed; -function sensors_init(time) +function sensors_init(time) global sensor_gyro; - sensor_gyro = sensor_noise_gyro * rand(AXIS_NB, length(time),'normal'); + sensor_gyro = sensor_noise_gyro * rand(AXIS_NB, length(time),'normal'); global sensor_accel; - sensor_accel = sensor_noise_accel * rand(AXIS_NB, length(time),'normal'); + sensor_accel = sensor_noise_accel * rand(AXIS_NB, length(time),'normal'); global sensor_mag; - sensor_mag = sensor_noise_mag * rand(AXIS_NB, length(time),'normal'); + sensor_mag = sensor_noise_mag * rand(AXIS_NB, length(time),'normal'); global sensor_baro; - sensor_baro = zeros(1, length(time)); + sensor_baro = zeros(1, length(time)); global sensor_gps_pos; - sensor_gps_pos = zeros(AXIS_NB, length(time)); + sensor_gps_pos = zeros(AXIS_NB, length(time)); global sensor_gps_speed; - sensor_gps_speed = zeros(AXIS_NB, length(time)); - + sensor_gps_speed = zeros(AXIS_NB, length(time)); + endfunction @@ -58,11 +58,11 @@ function sensors_run(i) mag_earth = [0.4912 0.1225 0.8624]'; mag_body = quat_vect_mult(fdm_state(FDM_SQI:FDM_SQZ,i), mag_earth); sensor_mag(:,i) = sensor_mag(:,i) + mag_body; - + sensor_gps_pos(:,i) = fdm_state(FDM_SX:FDM_SZ, i); sensor_gps_speed(:,i) = fdm_state(FDM_SXD:FDM_SZD, i); - + // sensor_baro(:,i) = fdm_state(FDM_SZ, i); endfunction diff --git a/sw/simulator/scilab/q6d/q6d_stabilization.sci b/sw/simulator/scilab/q6d/q6d_stabilization.sci index 37290740ac..e6a3d529cb 100644 --- a/sw/simulator/scilab/q6d/q6d_stabilization.sci +++ b/sw/simulator/scilab/q6d/q6d_stabilization.sci @@ -16,11 +16,11 @@ global stabilization_cmd_axis; global stabilization_cmd_motors; -stab_omega_ref = [ rad_of_deg(720); rad_of_deg(720); rad_of_deg(720) ]; -stab_zeta_ref = [ 0.8; 0.8; 0.8 ]; +stab_omega_ref = [ rad_of_deg(720); rad_of_deg(720); rad_of_deg(720) ]; +stab_zeta_ref = [ 0.8; 0.8; 0.8 ]; -function stabilization_init() +function stabilization_init() global fdm_time; @@ -40,7 +40,7 @@ function stabilization_init() stabilization_ref_euler = zeros(EULER_NB, length(fdm_time)); stabilization_ref_rate = zeros(AXIS_NB, length(fdm_time)); stabilization_ref_raccel = zeros(AXIS_NB, length(fdm_time)); - + global stabilization_cmd_ff; global stabilization_cmd_fb; global stabilization_cmd_axis; @@ -56,7 +56,7 @@ Kp = [ -0.5; -0.5; -0.5 ]; Kd = [ -0.5; -0.5; -0.5 ]; Kdd = [ 0.007; 0.007; 0.007 ]; -function stabilization_run(i) +function stabilization_run(i) global ahrs_state; global stabilization_sp_euler; @@ -64,8 +64,8 @@ function stabilization_run(i) stabilization_sp_euler(:,i) = euler_of_quat(stabilization_sp_quat(:,i)); stabilization_update_ref(i); - - err_angle = quat_div(stabilization_ref_quat(:,i), ahrs_state(AHRS_QI:AHRS_QZ,i)); + + err_angle = quat_div(stabilization_ref_quat(:,i), ahrs_state(AHRS_QI:AHRS_QZ,i)); err_rate = ahrs_rate(:,i) - stabilization_ref_rate(:,i); global stabilization_cmd_fb; @@ -89,30 +89,30 @@ function stabilization_update_ref(i) global stabilization_ref_raccel; // pause - -// error_quat = quat_mult_inv(stabilization_sp_quat(:,i-1), stabilization_ref_quat(:,i-1)); -// error_quat = quat_inv_comp(stabilization_ref_quat(:,i-1), stabilization_sp_quat(:,i-1)); - error_quat = quat_div(stabilization_sp_quat(:,i-1), stabilization_ref_quat(:,i-1)); + +// error_quat = quat_mult_inv(stabilization_sp_quat(:,i-1), stabilization_ref_quat(:,i-1)); +// error_quat = quat_inv_comp(stabilization_ref_quat(:,i-1), stabilization_sp_quat(:,i-1)); + error_quat = quat_div(stabilization_sp_quat(:,i-1), stabilization_ref_quat(:,i-1)); error_quat = quat_wrap_shortest(error_quat); - + ref_accel_0 = -stab_omega_ref^2 .* error_quat(Q_QX:Q_QZ); ref_accel_1 = -2. * stab_zeta_ref .* stab_omega_ref .* stabilization_ref_rate(:,i-1); - + stabilization_ref_raccel(:,i) = ref_accel_0 + ref_accel_1; - + W = get_omega_quat(stabilization_ref_rate(:,i-1)); K_lagrange = 1.; quat = stabilization_ref_quat(:,i-1); quat_dot = -1/2 * W * quat; quat_dot = quat_dot + K_lagrange * ( 1 - norm(quat)) * quat; dt = 1/512; - stabilization_ref_quat(:,i) = stabilization_ref_quat(:,i-1) + dt * quat_dot; - + stabilization_ref_quat(:,i) = stabilization_ref_quat(:,i-1) + dt * quat_dot; + stabilization_ref_rate(:,i) = stabilization_ref_rate(:,i-1) + dt * stabilization_ref_raccel(:,i-1); - + global stabilization_ref_euler; stabilization_ref_euler(:,i) = euler_of_quat(stabilization_ref_quat(:,i)); - + endfunction @@ -128,7 +128,7 @@ function stabilization_mix(i) 1 0 1 1 ]; stabilization_cmd_motors(:,i) = motors_of_axis * stabilization_cmd_axis(:,i); - + endfunction @@ -140,11 +140,11 @@ function stabilization_display() nc = 3; global stabilization_ref_euler; global stabilization_sp_euler; - + global fdm_state; global fdm_euler; global fdm_time; - + subplot(nr,nc,1); plot2d(fdm_time, deg_of_rad(stabilization_ref_euler(EULER_PHI,:)),2); plot2d(fdm_time, deg_of_rad(stabilization_sp_euler(EULER_PHI,:)),5); @@ -182,9 +182,9 @@ function stabilization_display() xtitle('R'); - - + + global stabilization_cmd_axis; global stabilization_cmd_motors; @@ -202,6 +202,6 @@ function stabilization_display() plot2d(fdm_time, stabilization_cmd_motors(FDM_MOTOR_LEFT,:),4); legends(["f", "r", "b", "l"],[1 2 3 4], with_box=%f, opt="ur"); xtitle('Cmd motor'); - + endfunction diff --git a/sw/simulator/scilab/q6d/test1.sce b/sw/simulator/scilab/q6d/test1.sce index 442bdd33b4..beb9a62909 100644 --- a/sw/simulator/scilab/q6d/test1.sce +++ b/sw/simulator/scilab/q6d/test1.sce @@ -37,7 +37,7 @@ for i=1:length(fdm_time)-1 stabilization_sp_thrust(i+1) = guidance_mass / guidance_Ct0 * 9.81; stabilization_run(i+1); - + end if 0 @@ -48,7 +48,7 @@ if 0 drawlater(); ahrs_display(); drawnow(); - + set("current_figure",1); clf(); f=get("current_figure"); diff --git a/sw/simulator/scilab/q6d/test_gen_sensors.sce b/sw/simulator/scilab/q6d/test_gen_sensors.sce index 8175eddba9..10329ce379 100644 --- a/sw/simulator/scilab/q6d/test_gen_sensors.sce +++ b/sw/simulator/scilab/q6d/test_gen_sensors.sce @@ -48,11 +48,11 @@ ctl_init(time); sensors_init(time); for i=2:length(time) - - ctl_run(i-1, fo_traj(:,:,i-1)); + + ctl_run(i-1, fo_traj(:,:,i-1)); fdm_run(i, ctl_motor_cmd(:,i-1)); sensors_run(i); - + end set("current_figure",1); diff --git a/sw/simulator/scilab/q6d/test_stop_stop.sce b/sw/simulator/scilab/q6d/test_stop_stop.sce index eefb92e39f..a74ec261ad 100644 --- a/sw/simulator/scilab/q6d/test_stop_stop.sce +++ b/sw/simulator/scilab/q6d/test_stop_stop.sce @@ -47,12 +47,12 @@ clf(); display_df_cmd(time, diff_flat_cmd) -motor_of_cmd = [ 0.25 0. 0.5 -0.25 - 0.25 -0.5 0. 0.25 - 0.25 0. -0.5 -0.25 +motor_of_cmd = [ 0.25 0. 0.5 -0.25 + 0.25 -0.5 0. 0.25 + 0.25 0. -0.5 -0.25 0.25 0.5 0. 0.25 ]; -motor_cmd = zeros(4,length(time)); +motor_cmd = zeros(4,length(time)); for i=1:length(time) motor_cmd(:,i) = 1/fdm_Ct0 * motor_of_cmd * diff_flat_cmd(:,i); @@ -63,7 +63,7 @@ display_motor_cmd(time, motor_cmd); X0 = [diff_flat_ref(DF_REF_X,1) ; diff_flat_ref(DF_REF_Y,1) ; diff_flat_ref(DF_REF_Z,1) diff_flat_ref(DF_REF_XD,1) ; diff_flat_ref(DF_REF_YD,1); diff_flat_ref(DF_REF_ZD,1) quat_of_euler([diff_flat_ref(DF_REF_PHI,1) diff_flat_ref(DF_REF_THETA,1) diff_flat_ref(DF_REF_PSI,1)]) - diff_flat_ref(DF_REF_P,1) ; diff_flat_ref(DF_REF_Q,1) ; diff_flat_ref(DF_REF_R,1) + diff_flat_ref(DF_REF_P,1) ; diff_flat_ref(DF_REF_Q,1) ; diff_flat_ref(DF_REF_R,1) ]; fdm_init(time, X0); diff --git a/sw/simulator/sim.ml b/sw/simulator/sim.ml index 75ecdf57d3..e600d781b9 100644 --- a/sw/simulator/sim.ml +++ b/sw/simulator/sim.ml @@ -2,7 +2,7 @@ * $Id$ * * Hardware in the loop basic simulator (handling GPS, infrared and commands) - * + * * Copyright (C) 2004-2006 Pascal Brisset, Antoine Drouin * * This file is part of paparazzi. @@ -20,7 +20,7 @@ * 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. + * Boston, MA 02111-1307, USA. * *) @@ -51,7 +51,7 @@ let cb_register = fun closure -> s -module type AIRCRAFT = +module type AIRCRAFT = sig val init : int -> GPack.box -> unit (** [init ac_id box] *) @@ -60,16 +60,16 @@ module type AIRCRAFT = val commands : pprz_t array -> unit (** Called once at init *) - + val infrared : float -> float -> float -> float -> unit (** [infrared ir_left ir_front ir_top air_speed] Called on timer *) - + val gps : Gps.state -> unit (** [gps state] Called on timer *) end -module type AIRCRAFT_ITL = +module type AIRCRAFT_ITL = functor (A : Data.MISSION) -> functor (FM: FlightModel.SIG) -> AIRCRAFT external fg_sizeof : unit -> int = "fg_sizeof" @@ -109,11 +109,11 @@ module Make(AircraftItl : AIRCRAFT_ITL) = struct let qfu = try float_attrib flight_plan "qfu" with _ -> 0. (* Try to get the ground alt from the SRTM data, default to flight plan *) - + let alt0 = let ground_alt = Srtm.add_path (Env.paparazzi_home ^ "/data/srtm"); - try + try float (Srtm.of_wgs84 !pos0) with Srtm.Tile_not_found x -> float_attrib flight_plan "ground_alt" in @@ -125,18 +125,18 @@ module Make(AircraftItl : AIRCRAFT_ITL) = struct let quit = fun () -> GMain.Main.quit (); exit 0 in ignore (window#connect#destroy ~callback:quit); let vbox = GPack.vbox ~packing:window#add () in - + Aircraft.init A.ac.Data.id vbox; let gps_period = 0.25 in - + let compute_gps_state = Gps.state pos0 alt0 in let initial_state = FM.init (pi/.2. -. qfu/.180.*.pi) in let state = ref initial_state in - let _reset = fun () -> state := initial_state in + let _reset = fun () -> state := initial_state in let commands = Array.create FM.nb_commands 0 in @@ -158,9 +158,9 @@ module Make(AircraftItl : AIRCRAFT_ITL) = struct let world_update = fun _ vs -> gps_availability := Pprz.int_assoc "gps_availability" vs; - wind_x := Pprz.float_assoc "wind_east" vs; - wind_y := Pprz.float_assoc "wind_north" vs; - wind_z := Pprz.float_assoc "wind_up" vs; + wind_x := Pprz.float_assoc "wind_east" vs; + wind_y := Pprz.float_assoc "wind_north" vs; + wind_z := Pprz.float_assoc "wind_up" vs; infrared_contrast := Pprz.float_assoc "ir_contrast" vs; time_scale#set_value (Pprz.float_assoc "time_scale" vs) in @@ -168,9 +168,9 @@ module Make(AircraftItl : AIRCRAFT_ITL) = struct let ask_for_world_env = fun () -> try let (x, y, z) = FlightModel.get_xyz !state in - + let gps_sol = compute_gps_state (x,y,z) (FlightModel.get_time !state) in - + let float = fun f -> Pprz.Float f in let values = ["east", float x; "north", float y; "up", float z; "lat", float ((Rad>>Deg)gps_sol.Gps.wgs84.posn_lat); @@ -197,18 +197,18 @@ module Make(AircraftItl : AIRCRAFT_ITL) = struct end | None -> 0. in FM.state_update !state FM.nominal_airspeed (!wind_x, !wind_y, !wind_z) agl fm_period - + and ir_task = fun () -> let phi, theta, _ = FlightModel.get_attitude !state in let phi_sensor = phi +. FM.roll_neutral_default and theta_sensor = theta +. FM.pitch_neutral_default in - + let ir_left = sin phi_sensor *. !infrared_contrast and ir_front = sin theta_sensor *. !infrared_contrast and ir_top = cos phi_sensor *. cos theta_sensor *. !infrared_contrast in Aircraft.infrared ir_left ir_front ir_top (FlightModel.get_air_speed !state) - + and gps_task = fun () -> let (x,y,z) = FlightModel.get_xyz !state in east_label#set_text (Printf.sprintf "%.0f" x); @@ -269,8 +269,8 @@ module Make(AircraftItl : AIRCRAFT_ITL) = struct with e -> fprintf stderr "Error while connecting to fg: %s" (Printexc.to_string e) in - - let take_off = fun () -> FlightModel.set_air_speed !state FM.nominal_airspeed in + + let take_off = fun () -> FlightModel.set_air_speed !state FM.nominal_airspeed in let hbox = GPack.hbox ~spacing:4 ~packing:vbox#pack () in let s = GButton.button ~label:"Set Pos" ~packing:hbox#pack () in @@ -290,7 +290,7 @@ module Make(AircraftItl : AIRCRAFT_ITL) = struct ignore (s#connect#clicked ~callback) end else set_pos_and_boot (); - + if not !autolaunch then begin let t = GButton.button ~label:"Launch" ~packing:hbox#pack () in let callback = fun () -> diff --git a/sw/simulator/sim_ac_booz.c b/sw/simulator/sim_ac_booz.c index a92cd74eba..cca05ed8f4 100644 --- a/sw/simulator/sim_ac_booz.c +++ b/sw/simulator/sim_ac_booz.c @@ -1,6 +1,6 @@ /* * $Id: sim_ac_fw.c 3499 2009-06-16 17:38:56Z gov $ - * + * * Copyright (C) 2008 Gautier Hattenberger * * This file is part of paparazzi. @@ -18,7 +18,7 @@ * 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. + * Boston, MA 02111-1307, USA. * */ @@ -53,7 +53,7 @@ void autopilot_event_task(void) { } void copy_inputs_to_jsbsim(FGFDMExec* FDMExec) { - + FGPropertyManager* cur_node; double cur_value; char buf[64]; @@ -72,7 +72,7 @@ void copy_inputs_to_jsbsim(FGFDMExec* FDMExec) { } void copy_outputs_from_jsbsim(FGFDMExec* FDMExec) { - + FGPropertyManager* cur_node; double cur_value, factor=1; char buf[64]; @@ -86,7 +86,7 @@ void copy_outputs_from_jsbsim(FGFDMExec* FDMExec) { cur_node = FDMExec->GetPropertyManager()->GetNode("sim-time-sec"); cur_value = cur_node->getDoubleValue(); cout << state[i] << cur_value << endl; - + for (i=1; i<12+1; i++) { sprintf(buf,"ic/%s",state[i]); if (strstr(state[i],"rad_")!=NULL) factor=RAD2DEG; diff --git a/sw/simulator/sim_ac_fw.c b/sw/simulator/sim_ac_fw.c index 23d75a1b60..fac1a433b5 100644 --- a/sw/simulator/sim_ac_fw.c +++ b/sw/simulator/sim_ac_fw.c @@ -1,6 +1,6 @@ /* * $Id$ - * + * * Copyright (C) 2008 Gautier Hattenberger * * This file is part of paparazzi. @@ -18,7 +18,7 @@ * 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. + * Boston, MA 02111-1307, USA. * */ @@ -34,33 +34,33 @@ using namespace std; using namespace JSBSim; /* Datalink Ivy function */ -static void on_DL_PING(IvyClientPtr app __attribute__ ((unused)), - void *user_data __attribute__ ((unused)), +static void on_DL_PING(IvyClientPtr app __attribute__ ((unused)), + void *user_data __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[]){ parse_dl_ping(argv); } -static void on_DL_ACINFO(IvyClientPtr app __attribute__ ((unused)), - void *user_data __attribute__ ((unused)), +static void on_DL_ACINFO(IvyClientPtr app __attribute__ ((unused)), + void *user_data __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[]){ parse_dl_acinfo(argv); } -static void on_DL_SETTING(IvyClientPtr app __attribute__ ((unused)), - void *user_data __attribute__ ((unused)), +static void on_DL_SETTING(IvyClientPtr app __attribute__ ((unused)), + void *user_data __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[]){ parse_dl_setting(argv); } -static void on_DL_GET_SETTING(IvyClientPtr app __attribute__ ((unused)), - void *user_data __attribute__ ((unused)), +static void on_DL_GET_SETTING(IvyClientPtr app __attribute__ ((unused)), + void *user_data __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[]){ parse_dl_get_setting(argv); } -static void on_DL_BLOCK(IvyClientPtr app __attribute__ ((unused)), - void *user_data __attribute__ ((unused)), +static void on_DL_BLOCK(IvyClientPtr app __attribute__ ((unused)), + void *user_data __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[]){ parse_dl_block(argv); } -static void on_DL_MOVE_WP(IvyClientPtr app __attribute__ ((unused)), - void *user_data __attribute__ ((unused)), +static void on_DL_MOVE_WP(IvyClientPtr app __attribute__ ((unused)), + void *user_data __attribute__ ((unused)), int argc __attribute__ ((unused)), char *argv[]){ parse_dl_move_wp(argv); } @@ -103,7 +103,7 @@ void print(FGFDMExec* FDMExec) { cur_node = FDMExec->GetPropertyManager()->GetNode("simulation/sim-time-sec"); cur_value = cur_node->getDoubleValue(); cout << state[i] << " " << cur_value << endl; - + for (i=1; i<3+1; i++) { if (strstr(state[i],"rad_")!=NULL) factor=RAD2DEG; if (strstr(state[i],"fps")!=NULL || strstr(state[i],"ft")!=NULL) factor=FT2M; diff --git a/sw/simulator/sim_ac_jsbsim.c b/sw/simulator/sim_ac_jsbsim.c index 5e7e424c5b..3d81350f87 100644 --- a/sw/simulator/sim_ac_jsbsim.c +++ b/sw/simulator/sim_ac_jsbsim.c @@ -1,6 +1,6 @@ /* * $Id$ - * + * * Copyright (C) 2008 Gautier Hattenberger * * This file is part of paparazzi. @@ -18,7 +18,7 @@ * 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. + * Boston, MA 02111-1307, USA. * */ @@ -85,10 +85,10 @@ static gboolean sim_periodic(gpointer data __attribute__ ((unused))) { copy_outputs_from_jsbsim(FDMExec); /* run the airborne code */ - + // airborne_run_one_step(); - autopilot_event_task(); - autopilot_periodic_task(); + autopilot_event_task(); + autopilot_periodic_task(); return result; } @@ -101,7 +101,7 @@ int main ( int argc, char** argv) { sim_init(); GMainLoop *ml = g_main_loop_new(NULL, FALSE); - + g_timeout_add(JSBSIM_PERIOD, sim_periodic, NULL); g_main_loop_run(ml); @@ -176,7 +176,7 @@ void jsbsim_init(void) { exit(0); } string pprzRoot = string(root); - + #ifdef JSBSIM_MODEL AircraftName = JSBSIM_MODEL; #endif diff --git a/sw/simulator/sim_ac_jsbsim.h b/sw/simulator/sim_ac_jsbsim.h index f1dcd300c9..78eea8915b 100644 --- a/sw/simulator/sim_ac_jsbsim.h +++ b/sw/simulator/sim_ac_jsbsim.h @@ -1,6 +1,6 @@ /* * $Id$ - * + * * Copyright (C) 2008 Gautier Hattenberger * * This file is part of paparazzi. @@ -18,7 +18,7 @@ * 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. + * Boston, MA 02111-1307, USA. * */ @@ -30,8 +30,8 @@ #include #include "std.h" -#include "airframe.h" -#include "flight_plan.h" +#include "generated/airframe.h" +#include "generated/flight_plan.h" #include diff --git a/sw/simulator/simhitl.ml b/sw/simulator/simhitl.ml index 41270af723..00f853a263 100644 --- a/sw/simulator/simhitl.ml +++ b/sw/simulator/simhitl.ml @@ -1,6 +1,6 @@ open Stdlib -let _ = +let _ = Arg.parse (Sim.common_options@[set_string "-a" Sim.ac_name "aircraft name"]) (fun x -> Printf.fprintf stderr "Warning: Don't do anythig with %s\n" x) diff --git a/sw/simulator/simsitl.ml b/sw/simulator/simsitl.ml index a6476d23f9..0ef27c34ba 100644 --- a/sw/simulator/simsitl.ml +++ b/sw/simulator/simsitl.ml @@ -1,4 +1,4 @@ - + let _ = Arg.parse (Sim.common_options@Sitl.options) diff --git a/sw/simulator/sitl.ml b/sw/simulator/sitl.ml index 2e7cba660e..07bf2a0564 100644 --- a/sw/simulator/sitl.ml +++ b/sw/simulator/sitl.ml @@ -2,7 +2,7 @@ * $Id$ * * Software in the loop basic simulator (handling GPS, infrared and commands) - * + * * Copyright (C) 2004 Pascal Brisset, Antoine Drouin * * This file is part of paparazzi. @@ -20,7 +20,7 @@ * 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. + * Boston, MA 02111-1307, USA. * *) @@ -44,7 +44,7 @@ module Make (A:Data.MISSION) (FM: FlightModel.SIG) = struct let servos_period = 1./.40. (* s *) let periodic_period = 1./.60. (* s *) let rc_period = 1./.40. (* s *) - + let msg = fun name -> ExtXml.child Data.messages_ap ~select:(fun x -> ExtXml.attrib x "name" = name) "message" @@ -52,7 +52,7 @@ module Make (A:Data.MISSION) (FM: FlightModel.SIG) = struct (* Commands handling (rcommands is the intermediate storage) *) let rc_channels = Array.of_list (Xml.children A.ac.Data.radio) let nb_channels = Array.length rc_channels - let rc_channel_no = fun x -> + let rc_channel_no = fun x -> List.assoc x (Array.to_list (Array.mapi (fun i c -> Xml.attrib c "function", i) rc_channels)) let rcommands = ref [||] @@ -110,7 +110,7 @@ module Make (A:Data.MISSION) (FM: FlightModel.SIG) = struct let inv = not ((List.mem f inverted) == (ma < mi)) in let _scale = GRange.scale `HORIZONTAL ~inverted:inv ~adjustment:adj ~packing:hbox#add () in let update = fun () -> update_channel i adj#value in - + ignore (adj#connect#value_changed update); update ()) rc_channels; @@ -185,10 +185,10 @@ module Make (A:Data.MISSION) (FM: FlightModel.SIG) = struct Some x -> message_bind msg.Pprz.name x | _ -> ()) Dl_Pprz.messages;; - + (* Functions called by the simulator *) let commands = fun s -> rcommands := s - + external set_ir : int -> int -> int -> float -> unit = "set_ir" let infrared = fun ir_left ir_front ir_top air_speed -> (** ADC neutral is not taken into account in the soft sim (c.f. sim_ir.c)*) diff --git a/sw/simulator/stdlib.ml b/sw/simulator/stdlib.ml index 6dbd4184fb..aebc2e83c8 100644 --- a/sw/simulator/stdlib.ml +++ b/sw/simulator/stdlib.ml @@ -2,7 +2,7 @@ * $Id$ * * Utilities for the simulators - * + * * Copyright (C) 2004 Pascal Brisset, Antoine Drouin * * This file is part of paparazzi. @@ -20,7 +20,7 @@ * 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. + * Boston, MA 02111-1307, USA. * *) @@ -33,7 +33,7 @@ let rec norm_angle = fun x -> if x > pi then norm_angle (x-.2.*.pi) else if x < -.pi then norm_angle (x+.2.*.pi) else x - + let deg_of_rad = fun rad -> rad /. pi *. 180. let rad_of_deg = fun x -> x /. 180. *. pi @@ -48,9 +48,9 @@ let ms x = max 0 (truncate (1000.*.x)) class type value = object method value : float end let timer ?scale p f = - let scale = - match scale with - None -> object method value = 1. end + let scale = + match scale with + None -> object method value = 1. end | Some s -> (s :> value) in let rec loop = fun expected -> let next = expected +. p /. scale#value in @@ -58,10 +58,10 @@ let timer ?scale p f = if dt < 1 then begin (* No timer needed, simply loop *) f (); loop next end else - GMain.Timeout.add + GMain.Timeout.add dt - (fun () -> + (fun () -> ignore (loop next); - f (); + f (); false) in ignore (loop (Unix.gettimeofday()))