diff --git a/conf/Makefile.sim b/conf/Makefile.sim index 6e892e09e3..3b5315cf8d 100644 --- a/conf/Makefile.sim +++ b/conf/Makefile.sim @@ -45,26 +45,24 @@ Q=@ # End of configuration part. # -LBITS := $(shell getconf LONG_BIT) -ifeq ($(LBITS),64) - FPIC = -fPIC -else - FPIC = -endif - -INCLUDES += -I `ocamlc -where` +INCLUDES += -I $(shell $(OCAMLC) -where) CFLAGS = -W -Wall CFLAGS += $(INCLUDES) CFLAGS += $($(TARGET).CFLAGS) CFLAGS += $(LOCAL_CFLAGS) -CFLAGS += $(FPIC) +CFLAGS += -fPIC CFLAGS += -O2 CFLAGS += -g CFLAGS += -std=gnu99 LDFLAGS = -lm +UNAME = $(shell uname -s) +ifeq ("$(UNAME)","Darwin") + CAMLINCLUDES += $(shell ocamlfind query -r -i-format lablgtk2) $(shell ocamlfind query -r -i-format xml-light) + CAMLCMAS = unix.cma str.cma xml-light.cma glibivy-ocaml.cma lib-pprz.cma lablgtk.cma +endif # # General rules @@ -81,9 +79,15 @@ autopilot.so : $($(TARGET).objs) @echo BUILD $@ $(Q)$(CC) -shared -o $(OBJDIR)/$@ $^ +ifeq ("$(UNAME)","Darwin") +$(OBJDIR)/simsitl : $($(TARGET).objs) $(SITLCMA) $(SIMSITLML) + @echo LD $@ + $(Q)$(OCAMLC) -g -custom $(CAMLINCLUDES) -o $@ $(CAMLCMAS) $(MYGTKINITCMO) $^ +else $(OBJDIR)/simsitl : autopilot.so $(SITLCMA) $(SIMSITLML) @echo LD $@ $(Q)$(OCAMLC) -g $(CAMLINCLUDES) -o $@ $(LINKPKG) $(MYGTKINITCMO) $^ -dllpath $(OBJDIR) -dllpath $(SIMDIR) +endif # The id of the A/C is hardcoded in the code (to be improved with dynlink ?) diff --git a/conf/airframes/ENAC/fixed-wing/mythe.xml b/conf/airframes/ENAC/fixed-wing/mythe.xml index fb04ac94e3..5a39cdc4fa 100644 --- a/conf/airframes/ENAC/fixed-wing/mythe.xml +++ b/conf/airframes/ENAC/fixed-wing/mythe.xml @@ -157,8 +157,8 @@
- - + +
diff --git a/conf/airframes/ENAC/quadrotor/blender.xml b/conf/airframes/ENAC/quadrotor/blender.xml index 9fb6184e9c..b5efec74a6 100644 --- a/conf/airframes/ENAC/quadrotor/blender.xml +++ b/conf/airframes/ENAC/quadrotor/blender.xml @@ -5,7 +5,7 @@ - + diff --git a/conf/airframes/ENAC/quadrotor/booz2_g1.xml b/conf/airframes/ENAC/quadrotor/booz2_g1.xml index 275f05fe4b..0604b4a152 100644 --- a/conf/airframes/ENAC/quadrotor/booz2_g1.xml +++ b/conf/airframes/ENAC/quadrotor/booz2_g1.xml @@ -3,7 +3,10 @@ - + + + + - + diff --git a/conf/airframes/booz2_flixr.xml b/conf/airframes/booz2_flixr.xml index 622adf7a5b..009f4312f1 100644 --- a/conf/airframes/booz2_flixr.xml +++ b/conf/airframes/booz2_flixr.xml @@ -40,7 +40,7 @@ - + diff --git a/conf/airframes/esden/gain_scheduling_example.xml b/conf/airframes/esden/gain_scheduling_example.xml index a6e726365b..92ed1bc162 100644 --- a/conf/airframes/esden/gain_scheduling_example.xml +++ b/conf/airframes/esden/gain_scheduling_example.xml @@ -51,7 +51,7 @@
- +
@@ -65,7 +65,6 @@ -
@@ -210,6 +209,7 @@ + diff --git a/conf/airframes/esden/qs_asp22.xml b/conf/airframes/esden/qs_asp22.xml new file mode 100644 index 0000000000..7e4306de9e --- /dev/null +++ b/conf/airframes/esden/qs_asp22.xml @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ + + +
+ + + +
+ +
+ + + + + +
+ +
+ + +
+ +
+ + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + +
+ +
+ + + + + +
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/conf/airframes/examples/Twinstar_energyadaptive.xml b/conf/airframes/examples/Twinstar_energyadaptive.xml index 79385b5eb3..7c916edaa7 100644 --- a/conf/airframes/examples/Twinstar_energyadaptive.xml +++ b/conf/airframes/examples/Twinstar_energyadaptive.xml @@ -33,7 +33,9 @@ twog_1.0 + aspirin + ETS baro + ETS speed - + + + @@ -134,9 +136,6 @@ twog_1.0 + aspirin + ETS baro + ETS speed - - - diff --git a/conf/airframes/examples/quadrotor_lisa_m_2_pwm_spektrum.xml b/conf/airframes/examples/quadrotor_lisa_m_2_pwm_spektrum.xml index 1adbab32b2..e9e9aa9dba 100644 --- a/conf/airframes/examples/quadrotor_lisa_m_2_pwm_spektrum.xml +++ b/conf/airframes/examples/quadrotor_lisa_m_2_pwm_spektrum.xml @@ -193,9 +193,10 @@
- + - + +
diff --git a/conf/airframes/obsolete/ENAC/g1_vision.xml b/conf/airframes/obsolete/ENAC/g1_vision.xml index 89db3cc9de..71ca37d27a 100644 --- a/conf/airframes/obsolete/ENAC/g1_vision.xml +++ b/conf/airframes/obsolete/ENAC/g1_vision.xml @@ -4,7 +4,7 @@ - + diff --git a/conf/airframes/obsolete/ENAC/mkk1-vision.xml b/conf/airframes/obsolete/ENAC/mkk1-vision.xml index 841349147f..4d78dbd80b 100644 --- a/conf/airframes/obsolete/ENAC/mkk1-vision.xml +++ b/conf/airframes/obsolete/ENAC/mkk1-vision.xml @@ -4,7 +4,7 @@ - + diff --git a/conf/firmwares/lisa_passthrough.makefile b/conf/firmwares/lisa_passthrough.makefile index d7f73d72b9..c0b5896080 100644 --- a/conf/firmwares/lisa_passthrough.makefile +++ b/conf/firmwares/lisa_passthrough.makefile @@ -76,7 +76,7 @@ stm_passthrough.srcs += subsystems/commands.c #stm_passthrough.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c #stm_passthrough.srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c # -#stm_passthrough.CFLAGS += -DACTUATORS_ASCTEC_DEVICE=i2c1 +#stm_passthrough.CFLAGS += -DACTUATORS_ASCTEC_I2C_DEV=i2c1 #stm_passthrough.CFLAGS += -DUSE_I2C1 # PWM actuator diff --git a/conf/firmwares/lisa_test_progs.makefile b/conf/firmwares/lisa_test_progs.makefile index c9e563afed..4d57ba3bd6 100644 --- a/conf/firmwares/lisa_test_progs.makefile +++ b/conf/firmwares/lisa_test_progs.makefile @@ -582,7 +582,7 @@ test_actuators_mkk.srcs += $(COMMON_TELEMETRY_SRCS) test_actuators_mkk.srcs += test/test_actuators.c test_actuators_mkk.srcs += subsystems/commands.c test_actuators_mkk.srcs += $(SRC_FIRMWARE)/actuators/actuators_mkk.c -test_actuators_mkk.CFLAGS += -DACTUATORS_MKK_DEVICE=i2c1 +test_actuators_mkk.CFLAGS += -DACTUATORS_MKK_I2C_DEV=i2c1 test_actuators_mkk.srcs += $(SRC_FIRMWARE)/actuators/supervision.c test_actuators_mkk.CFLAGS += -DUSE_I2C1 test_actuators_mkk.srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c @@ -599,7 +599,7 @@ test_actuators_asctecv1.srcs += $(COMMON_TELEMETRY_SRCS) test_actuators_asctecv1.srcs += test/test_actuators.c test_actuators_asctecv1.srcs += subsystems/commands.c -test_actuators_asctecv1.CFLAGS += -DACTUATORS_ASCTEC_DEVICE=i2c1 +test_actuators_asctecv1.CFLAGS += -DACTUATORS_ASCTEC_I2C_DEV=i2c1 test_actuators_asctecv1.srcs += $(SRC_FIRMWARE)/actuators/actuators_asctec.c test_actuators_asctecv1.CFLAGS += -DUSE_I2C1 test_actuators_asctecv1.srcs += mcu_periph/i2c.c $(SRC_ARCH)/mcu_periph/i2c_arch.c diff --git a/conf/firmwares/subsystems/shared/actuators_asctec.makefile b/conf/firmwares/subsystems/shared/actuators_asctec.makefile index c6ec3129ea..be5d0707ff 100644 --- a/conf/firmwares/subsystems/shared/actuators_asctec.makefile +++ b/conf/firmwares/subsystems/shared/actuators_asctec.makefile @@ -10,17 +10,17 @@ $(TARGET).CFLAGS += -DACTUATORS ap.srcs += subsystems/actuators/actuators_asctec.c ifeq ($(ARCH), lpc21) -ap.CFLAGS += -DACTUATORS_ASCTEC_DEVICE=i2c0 +ap.CFLAGS += -DACTUATORS_ASCTEC_I2C_DEV=i2c0 ap.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=150 -DI2C0_SCLH=150 endif ifeq ($(ARCH), stm32) -ap.CFLAGS += -DACTUATORS_ASCTEC_DEVICE=i2c1 +ap.CFLAGS += -DACTUATORS_ASCTEC_I2C_DEV=i2c1 ap.CFLAGS += -DUSE_I2C1 endif # Simulator nps.srcs += subsystems/actuators/actuators_asctec.c -nps.CFLAGS += -DUSE_I2C0 -DACTUATORS_ASCTEC_DEVICE=i2c0 +nps.CFLAGS += -DUSE_I2C0 -DACTUATORS_ASCTEC_I2C_DEV=i2c0 diff --git a/conf/firmwares/subsystems/shared/actuators_asctec_v2.makefile b/conf/firmwares/subsystems/shared/actuators_asctec_v2.makefile index 03962dc76f..c2f8807796 100644 --- a/conf/firmwares/subsystems/shared/actuators_asctec_v2.makefile +++ b/conf/firmwares/subsystems/shared/actuators_asctec_v2.makefile @@ -10,16 +10,16 @@ $(TARGET).CFLAGS += -DACTUATORS ap.srcs += subsystems/actuators/actuators_asctec_v2.c ifeq ($(ARCH), lpc21) -ap.CFLAGS += -DACTUATORS_ASCTEC_V2_DEVICE=i2c0 +ap.CFLAGS += -DACTUATORS_ASCTEC_V2_I2C_DEV=i2c0 ap.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=150 -DI2C0_SCLH=150 endif ifeq ($(ARCH), stm32) -ap.CFLAGS += -DACTUATORS_ASCTEC_V2_DEVICE=i2c1 +ap.CFLAGS += -DACTUATORS_ASCTEC_V2_I2C_DEV=i2c1 ap.CFLAGS += -DUSE_I2C1 endif # Simulator nps.srcs += subsystems/actuators/actuators_asctec_v2.c -nps.CFLAGS += -DUSE_I2C0 -DACTUATORS_ASCTEC_DEVICE=i2c0 +nps.CFLAGS += -DUSE_I2C0 -DACTUATORS_ASCTEC_V2_I2C_DEV=i2c0 diff --git a/conf/firmwares/subsystems/shared/actuators_mkk.makefile b/conf/firmwares/subsystems/shared/actuators_mkk.makefile index 1c902acffd..e602f595fa 100644 --- a/conf/firmwares/subsystems/shared/actuators_mkk.makefile +++ b/conf/firmwares/subsystems/shared/actuators_mkk.makefile @@ -31,14 +31,14 @@ ifeq ($(MKK_I2C_SCL_TIME), ) MKK_I2C_SCL_TIME=150 endif -ap.CFLAGS += -DACTUATORS_MKK_DEVICE=i2c0 +ap.CFLAGS += -DACTUATORS_MKK_I2C_DEV=i2c0 ap.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=$(MKK_I2C_SCL_TIME) -DI2C0_SCLH=$(MKK_I2C_SCL_TIME) else ifeq ($(ARCH), stm32) -ap.CFLAGS += -DACTUATORS_MKK_DEVICE=i2c1 +ap.CFLAGS += -DACTUATORS_MKK_I2C_DEV=i2c1 ap.CFLAGS += -DUSE_I2C1 endif # Simulator nps.srcs += subsystems/actuators/actuators_mkk.c -nps.CFLAGS += -DUSE_I2C0 -DACTUATORS_MKK_DEVICE=i2c0 +nps.CFLAGS += -DUSE_I2C0 -DACTUATORS_MKK_I2C_DEV=i2c0 diff --git a/conf/firmwares/subsystems/shared/actuators_mkk_v2.makefile b/conf/firmwares/subsystems/shared/actuators_mkk_v2.makefile index 69198138e9..4246e1b90a 100644 --- a/conf/firmwares/subsystems/shared/actuators_mkk_v2.makefile +++ b/conf/firmwares/subsystems/shared/actuators_mkk_v2.makefile @@ -31,14 +31,14 @@ ifeq ($(MKK_V2_I2C_SCL_TIME), ) MKK_V2_I2C2_SCL_TIME=150 endif -ap.CFLAGS += -DACTUATORS_MKK_V2_DEVICE=i2c0 +ap.CFLAGS += -DACTUATORS_MKK_V2_I2C_DEV=i2c0 ap.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=$(MKK_V2_I2C_SCL_TIME) -DI2C0_SCLH=$(MKK_V2_I2C_SCL_TIME) else ifeq ($(ARCH), stm32) -ap.CFLAGS += -DACTUATORS_MKK_V2_DEVICE=i2c1 +ap.CFLAGS += -DACTUATORS_MKK_V2_I2C_DEV=i2c1 ap.CFLAGS += -DUSE_I2C1 endif # Simulator: nps.srcs += subsystems/actuators/actuators_mkk_v2.c -nps.CFLAGS += -DUSE_I2C0 -DACTUATORS_MKK_V2_DEVICE=i2c0 +nps.CFLAGS += -DUSE_I2C0 -DACTUATORS_MKK_V2_I2C_DEV=i2c0 diff --git a/conf/firmwares/subsystems/shared/actuators_skiron.makefile b/conf/firmwares/subsystems/shared/actuators_skiron.makefile index 9765d3cc03..5296056e43 100644 --- a/conf/firmwares/subsystems/shared/actuators_skiron.makefile +++ b/conf/firmwares/subsystems/shared/actuators_skiron.makefile @@ -26,11 +26,11 @@ $(TARGET).CFLAGS += -DACTUATORS ap.srcs += subsystems/actuators/actuators_skiron.c ifeq ($(ARCH), lpc21) -ap.CFLAGS += -DACTUATORS_SKIRON_DEVICE=i2c0 +ap.CFLAGS += -DACTUATORS_SKIRON_I2C_DEV=i2c0 ap.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=$(SKIRON_I2C_SCL_TIME) -DI2C0_SCLH=$(SKIRON_I2C_SCL_TIME) endif # Simulator nps.srcs += subsystems/actuators/actuators_skiron.c -nps.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=$(SKIRON_I2C_SCL_TIME) -DI2C0_SCLH=$(SKIRON_I2C_SCL_TIME) -DACTUATORS_SKIRON_DEVICE=i2c0 +nps.CFLAGS += -DUSE_I2C0 -DI2C0_SCLL=$(SKIRON_I2C_SCL_TIME) -DI2C0_SCLH=$(SKIRON_I2C_SCL_TIME) -DACTUATORS_SKIRON_I2C_DEV=i2c0 diff --git a/conf/firmwares/subsystems/shared/imu_aspirin_common.makefile b/conf/firmwares/subsystems/shared/imu_aspirin_common.makefile index 7fa9186de7..a19bb4a2b8 100644 --- a/conf/firmwares/subsystems/shared/imu_aspirin_common.makefile +++ b/conf/firmwares/subsystems/shared/imu_aspirin_common.makefile @@ -49,15 +49,24 @@ IMU_ASPIRIN_CFLAGS += -DUSE_SPI_SLAVE0 IMU_ASPIRIN_CFLAGS += -DASPIRIN_SPI_SLAVE_IDX=SPI_SLAVE0 IMU_ASPIRIN_CFLAGS += -DASPIRIN_SPI_DEV=spi1 IMU_ASPIRIN_CFLAGS += -DUSE_SPI1 -IMU_ASPIRIN_CFLAGS += -DASPIRIN_I2C_DEV=i2c1 -IMU_ASPIRIN_CFLAGS += -DUSE_I2C1 +ifndef ASPIRIN_I2C_DEV +ASPIRIN_I2C_DEV=i2c0 +endif else ifeq ($(ARCH), stm32) -IMU_ASPIRIN_CFLAGS += -DUSE_I2C2 IMU_ASPIRIN_CFLAGS += -DUSE_SPI2 # Slave select configuration # SLAVE2 is on PB12 (NSS) (ADXL345 CS) IMU_ASPIRIN_CFLAGS += -DUSE_SPI_SLAVE2 +ifndef ASPIRIN_I2C_DEV +ASPIRIN_I2C_DEV=i2c2 endif +endif + +# convert i2cx to upper case +ASPIRIN_I2C_DEV_UPPER=$(shell echo $(ASPIRIN_I2C_DEV) | tr a-z A-Z) + +IMU_ASPIRIN_CFLAGS += -DASPIRIN_I2C_DEV=$(ASPIRIN_I2C_DEV) +IMU_ASPIRIN_CFLAGS += -DUSE_$(ASPIRIN_I2C_DEV_UPPER) # # NPS simulator diff --git a/conf/firmwares/subsystems/shared/imu_aspirin_i2c_common.makefile b/conf/firmwares/subsystems/shared/imu_aspirin_i2c_common.makefile index 16f6a05105..064ceb3d03 100644 --- a/conf/firmwares/subsystems/shared/imu_aspirin_i2c_common.makefile +++ b/conf/firmwares/subsystems/shared/imu_aspirin_i2c_common.makefile @@ -38,12 +38,19 @@ IMU_ASPIRIN_SRCS += peripherals/itg3200.c # Magnetometer IMU_ASPIRIN_SRCS += peripherals/hmc58xx.c +# set default i2c bus +ifndef ASPIRIN_I2C_DEV ifeq ($(ARCH), lpc21) -IMU_ASPIRIN_CFLAGS += -DASPIRIN_I2C_DEV=i2c1 -IMU_ASPIRIN_CFLAGS += -DUSE_I2C1 -IMU_ASPIRIN_CFLAGS += -DI2C1_VIC_SLOT=12 +ASPIRIN_I2C_DEV=i2c0 else ifeq ($(ARCH), stm32) -IMU_ASPIRIN_CFLAGS += -DUSE_I2C2 +ASPIRIN_I2C_DEV=i2c2 +endif endif +# convert i2cx to upper case +ASPIRIN_I2C_DEV_UPPER=$(shell echo $(ASPIRIN_I2C_DEV) | tr a-z A-Z) + +IMU_ASPIRIN_CFLAGS += -DASPIRIN_I2C_DEV=$(ASPIRIN_I2C_DEV) +IMU_ASPIRIN_CFLAGS += -DUSE_$(ASPIRIN_I2C_DEV_UPPER) + include $(CFG_SHARED)/imu_nps.makefile diff --git a/conf/messages.xml b/conf/messages.xml index 733ca40e93..89d5b636b8 100644 --- a/conf/messages.xml +++ b/conf/messages.xml @@ -1135,11 +1135,13 @@ - - - - - + + + + + + + @@ -1753,7 +1755,12 @@ - + + + + + + diff --git a/conf/modules/sonar_adc.xml b/conf/modules/sonar_adc.xml index d477c56c96..e0dd84eca3 100644 --- a/conf/modules/sonar_adc.xml +++ b/conf/modules/sonar_adc.xml @@ -3,8 +3,8 @@ - Sonar ADC driver - output - Sonar_distance in [m] + Sonar ADC driver. + Reads an anlog sonar sensor and outputs sonar distance in [m] diff --git a/conf/modules/sonar_maxbotix_booz.xml b/conf/modules/sonar_adc_ins.xml similarity index 69% rename from conf/modules/sonar_maxbotix_booz.xml rename to conf/modules/sonar_adc_ins.xml index be2d50737e..7f0257f98e 100644 --- a/conf/modules/sonar_maxbotix_booz.xml +++ b/conf/modules/sonar_adc_ins.xml @@ -3,8 +3,9 @@ - Sonar ADC INS. - On Booz board, ADC_0 should be use by default (payload connector) + Sonar ADC (INS bindings). + Sonar ADC driver with INS binding, wich oes the same than sonar_adc module with an event function to feed INS subsystem. + Even if SONAR_OFFSET and _SCALE can be set, currently only the raw value and the INS_SONAR_SENS will be used in ins filters. @@ -19,12 +20,6 @@ - -# set ADC_SONAR to ADC_0 as default -ifeq ($(ADC_SONAR),) -ADC_SONAR = ADC_0 -endif - diff --git a/conf/settings/control/rotorcraft_guidance.xml b/conf/settings/control/rotorcraft_guidance.xml index d07e752f93..1362a96a38 100644 --- a/conf/settings/control/rotorcraft_guidance.xml +++ b/conf/settings/control/rotorcraft_guidance.xml @@ -10,9 +10,10 @@ - + - + + @@ -20,13 +21,13 @@ - + - - - - - + + + + + diff --git a/conf/telemetry/default_rotorcraft.xml b/conf/telemetry/default_rotorcraft.xml index 51282743a6..6f83d9b340 100644 --- a/conf/telemetry/default_rotorcraft.xml +++ b/conf/telemetry/default_rotorcraft.xml @@ -16,7 +16,8 @@ - + + @@ -94,14 +95,17 @@ - - - + + + - + + + + @@ -120,6 +124,7 @@ +