diff --git a/README b/README index 1fbae924f2..f93c8bf9a8 100644 --- a/README +++ b/README @@ -1,5 +1,4 @@ -# Paparazzi $Id$ -# Copyright (C) 2003-2010 The Paparazzi Team +# Copyright (C) 2003-2011 The Paparazzi Team # # This file is part of Paparazzi. # @@ -25,7 +24,7 @@ Intro Paparazzi is an attempt to develop a free software Unmanned (Air) Vehicle System. As of today the system is being used successfuly by a number of hobyists, universities and companies all over the world, on vehicle of various size ( 100g to 25Kg ) and of various nature ( fixed wing, rotorcrafts, boats and surface vehicles). -Up to date informations are available from the wiki website +Up to date information is available from the wiki website http://paparazzi.enac.fr @@ -39,8 +38,6 @@ conf: the configuration directory (airframe, radio, ... descriptions). data: where to put read-only data (e.g. maps, terrain elevation files, icons) -hw: hardware (electronic schemas, PCBs, ...) - sw: software (onboard, ground station, simulation, ...) var: products of compilation, cache for the map tiles, ... @@ -64,8 +61,7 @@ For Debian or Ubuntu users, required packages are available at - "paparazzi-dev" will provide everything needed to compile and run the ground segment and the simulator. If something is missing, please report it. - - "paparazzi-arm7" is required to compile the code for LPC21 based boards ( tiny, twog, booz, etc). - - "paparazzi-stm32" is needed for building code for STM32 based boards (lisa/L, lisa/M) + - "paparazzi-arm-multilib" is required to compile the code for LPC21 and STM32 based boards - "paparazzi-omap" is needed for building code for the optional Gumstix Overo module available on lisa/L - "paparazzi-jsbsim" is needed for using jsbsim as flight dynamic model for the simulator. diff --git a/conf/airframes/CDW/ChimuLisaFw.xml b/conf/airframes/CDW/ChimuLisaFw.xml index e8dc58341c..49bb81b77a 100644 --- a/conf/airframes/CDW/ChimuLisaFw.xml +++ b/conf/airframes/CDW/ChimuLisaFw.xml @@ -61,9 +61,6 @@ - - -
diff --git a/conf/airframes/CDW/ChimuTinyFw.xml b/conf/airframes/CDW/ChimuTinyFw.xml index 3552da62fb..8bb3dc7a19 100644 --- a/conf/airframes/CDW/ChimuTinyFw.xml +++ b/conf/airframes/CDW/ChimuTinyFw.xml @@ -85,9 +85,6 @@ - - -
diff --git a/conf/airframes/CDW/ChimuTinyFwSpi.xml b/conf/airframes/CDW/ChimuTinyFwSpi.xml index 2f301e204c..530b6bc7f4 100644 --- a/conf/airframes/CDW/ChimuTinyFwSpi.xml +++ b/conf/airframes/CDW/ChimuTinyFwSpi.xml @@ -85,9 +85,6 @@ - - -
diff --git a/conf/airframes/ENAC/fixed-wing/obsolete/slayer2.xml b/conf/airframes/ENAC/fixed-wing/obsolete/slayer2.xml index cc0603800f..e661db9c7f 100644 --- a/conf/airframes/ENAC/fixed-wing/obsolete/slayer2.xml +++ b/conf/airframes/ENAC/fixed-wing/obsolete/slayer2.xml @@ -107,9 +107,6 @@ - - -
diff --git a/conf/airframes/ENAC/quadrotor/blender.xml b/conf/airframes/ENAC/quadrotor/blender.xml index 86264e5cef..a5f9cecc83 100644 --- a/conf/airframes/ENAC/quadrotor/blender.xml +++ b/conf/airframes/ENAC/quadrotor/blender.xml @@ -18,7 +18,7 @@ - + diff --git a/conf/airframes/ENAC/quadrotor/booz2_g1.xml b/conf/airframes/ENAC/quadrotor/booz2_g1.xml index 97435e4f7e..ef3c0bb8a1 100644 --- a/conf/airframes/ENAC/quadrotor/booz2_g1.xml +++ b/conf/airframes/ENAC/quadrotor/booz2_g1.xml @@ -22,7 +22,7 @@ - + diff --git a/conf/airframes/ENAC/quadrotor/g1_vision.xml b/conf/airframes/ENAC/quadrotor/g1_vision.xml index 52fe0d23e6..8c52e4f955 100644 --- a/conf/airframes/ENAC/quadrotor/g1_vision.xml +++ b/conf/airframes/ENAC/quadrotor/g1_vision.xml @@ -231,8 +231,8 @@ include $(CFG_BOOZ)/subsystems/booz2_ahrs_cmpl.makefile #include $(CFG_BOOZ)/subsystems/booz2_ins_hff.makefile #ap.CFLAGS += -DR_POS=0.1 -ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DBOOZ_START_DELAY=3 -sim.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DBOOZ_START_DELAY=3 +ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DACTUATORS_START_DELAY=3 +sim.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DACTUATORS_START_DELAY=3 ap.CFLAGS += -DUSE_MODULES diff --git a/conf/airframes/PPZUAV/fixed-wing/ppzimu_tiny.xml b/conf/airframes/PPZUAV/fixed-wing/ppzimu_tiny.xml index e99fd0e7a5..b2aa803eda 100644 --- a/conf/airframes/PPZUAV/fixed-wing/ppzimu_tiny.xml +++ b/conf/airframes/PPZUAV/fixed-wing/ppzimu_tiny.xml @@ -122,9 +122,6 @@ - - -
diff --git a/conf/airframes/Poine/beth.xml b/conf/airframes/Poine/beth.xml index 89f4ac6a39..20773ff497 100644 --- a/conf/airframes/Poine/beth.xml +++ b/conf/airframes/Poine/beth.xml @@ -147,7 +147,7 @@ main_stm32.srcs += firmwares/rotorcraft/actuators/actuators_asctec.c #\ # $(SRC_BOOZ_ARCH)/actuators/actuators_asctec_arch.c main_stm32.CFLAGS += -DACTUATORS_ASCTEC_DEVICE=i2c1 -# -DBOOZ_START_DELAY=3 -DUSE_TIM2_IRQ +# -DACTUATORS_START_DELAY=3 -DUSE_TIM2_IRQ main_stm32.CFLAGS += -DUSE_I2C1 main_stm32.srcs += i2c.c $(SRC_ARCH)/i2c_hw.c diff --git a/conf/airframes/Poine/easy_glider1.xml b/conf/airframes/Poine/easy_glider1.xml index dea0734de2..09d6a6f342 100644 --- a/conf/airframes/Poine/easy_glider1.xml +++ b/conf/airframes/Poine/easy_glider1.xml @@ -88,9 +88,6 @@ - - -
diff --git a/conf/airframes/Poine/h_hex.xml b/conf/airframes/Poine/h_hex.xml index 41f0381cb8..87071db173 100644 --- a/conf/airframes/Poine/h_hex.xml +++ b/conf/airframes/Poine/h_hex.xml @@ -170,7 +170,7 @@ - + diff --git a/conf/airframes/TU_Delft/EasyStartPanTiltCHIMU_SPI.xml b/conf/airframes/TU_Delft/EasyStartPanTiltCHIMU_SPI.xml index 0d84e42706..1682d2939d 100644 --- a/conf/airframes/TU_Delft/EasyStartPanTiltCHIMU_SPI.xml +++ b/conf/airframes/TU_Delft/EasyStartPanTiltCHIMU_SPI.xml @@ -86,9 +86,6 @@ - - -
diff --git a/conf/airframes/TU_Delft/MicrojetBR.xml b/conf/airframes/TU_Delft/MicrojetBR.xml index 2d63128fd4..434a884ba8 100644 --- a/conf/airframes/TU_Delft/MicrojetBR.xml +++ b/conf/airframes/TU_Delft/MicrojetBR.xml @@ -93,9 +93,6 @@ - - - diff --git a/conf/airframes/TU_Delft/MicrojetBRimu.xml b/conf/airframes/TU_Delft/MicrojetBRimu.xml index 130cee751b..9d561274ce 100644 --- a/conf/airframes/TU_Delft/MicrojetBRimu.xml +++ b/conf/airframes/TU_Delft/MicrojetBRimu.xml @@ -128,9 +128,6 @@ - - - diff --git a/conf/airframes/TU_Delft/MicrojetCDW.xml b/conf/airframes/TU_Delft/MicrojetCDW.xml index bff9d3f837..b3f56673cf 100644 --- a/conf/airframes/TU_Delft/MicrojetCDW.xml +++ b/conf/airframes/TU_Delft/MicrojetCDW.xml @@ -123,9 +123,6 @@ - - -
diff --git a/conf/airframes/TU_Delft/Trip50A.xml b/conf/airframes/TU_Delft/Trip50A.xml index 46d80a8a28..42d00821de 100644 --- a/conf/airframes/TU_Delft/Trip50A.xml +++ b/conf/airframes/TU_Delft/Trip50A.xml @@ -105,9 +105,6 @@ - - -
diff --git a/conf/airframes/TU_Delft/skywalker.xml b/conf/airframes/TU_Delft/skywalker.xml index 31edbb16c5..86e29bf053 100644 --- a/conf/airframes/TU_Delft/skywalker.xml +++ b/conf/airframes/TU_Delft/skywalker.xml @@ -117,9 +117,6 @@ - - - diff --git a/conf/airframes/TU_Delft/skywalkerfiber.xml b/conf/airframes/TU_Delft/skywalkerfiber.xml index 66b3f00bfb..daaef74cfe 100644 --- a/conf/airframes/TU_Delft/skywalkerfiber.xml +++ b/conf/airframes/TU_Delft/skywalkerfiber.xml @@ -245,9 +245,6 @@ - - - diff --git a/conf/airframes/UofAdelaide/A1000_BOOZ.xml b/conf/airframes/UofAdelaide/A1000_BOOZ.xml index 18e1a7d0de..a1de5fec40 100644 --- a/conf/airframes/UofAdelaide/A1000_BOOZ.xml +++ b/conf/airframes/UofAdelaide/A1000_BOOZ.xml @@ -274,7 +274,7 @@ second attempt - + @@ -347,7 +347,7 @@ include $(CFG_BOOZ)/subsystems/ins_hff.makefile ap.CFLAGS += -DGPS_LAG=0.8 -DUSE_GPS_ACC4R ap.CFLAGS += -DGPS_USE_LATLONG -ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DBOOZ_START_DELAY=3 +ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DACTUATORS_START_DELAY=3 --> diff --git a/conf/airframes/UofAdelaide/A1000_NOVA.xml b/conf/airframes/UofAdelaide/A1000_NOVA.xml index 041c669c91..f6da7f4fcc 100644 --- a/conf/airframes/UofAdelaide/A1000_NOVA.xml +++ b/conf/airframes/UofAdelaide/A1000_NOVA.xml @@ -232,7 +232,7 @@ - + @@ -296,7 +296,7 @@ ap.CFLAGS += -DGPS_LAG=0.8 #-DUSE_GPS_ACC4R ap.CFLAGS += -DGPS_USE_LATLONG -ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DBOOZ_START_DELAY=3 +ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DACTUATORS_START_DELAY=3 --> diff --git a/conf/airframes/UofAdelaide/booz2_NoVa_001_1000.xml b/conf/airframes/UofAdelaide/booz2_NoVa_001_1000.xml index 83c35ed351..550ef036c3 100644 --- a/conf/airframes/UofAdelaide/booz2_NoVa_001_1000.xml +++ b/conf/airframes/UofAdelaide/booz2_NoVa_001_1000.xml @@ -250,7 +250,7 @@ ap.CFLAGS += -DGPS_LAG=0.8 #-DUSE_GPS_ACC4R ap.CFLAGS += -DGPS_USE_LATLONG -ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DBOOZ_START_DELAY=3 +ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DACTUATORS_START_DELAY=3 diff --git a/conf/airframes/UofAdelaide/booz2_a1000.xml b/conf/airframes/UofAdelaide/booz2_a1000.xml index ad6d34c00b..f46a9fbbe9 100755 --- a/conf/airframes/UofAdelaide/booz2_a1000.xml +++ b/conf/airframes/UofAdelaide/booz2_a1000.xml @@ -306,7 +306,7 @@ include $(CFG_BOOZ)/subsystems/ins_hff.makefile ap.CFLAGS += -DGPS_LAG=0.8 -DUSE_GPS_ACC4R ap.CFLAGS += -DGPS_USE_LATLONG -ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DBOOZ_START_DELAY=3 +ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DACTUATORS_START_DELAY=3 diff --git a/conf/airframes/easy_glider_example.xml b/conf/airframes/easy_glider_example.xml index 47393874af..8fde61a734 100644 --- a/conf/airframes/easy_glider_example.xml +++ b/conf/airframes/easy_glider_example.xml @@ -81,9 +81,6 @@ - - -
diff --git a/conf/airframes/esden/jt_lisam.xml b/conf/airframes/esden/jt_lisam.xml index 8cf8f9f6cf..027fc1f9d8 100644 --- a/conf/airframes/esden/jt_lisam.xml +++ b/conf/airframes/esden/jt_lisam.xml @@ -176,7 +176,7 @@ - + diff --git a/conf/airframes/esden/lisa_asctec.xml b/conf/airframes/esden/lisa_asctec.xml index 04e6bda40b..07e4c8cbfa 100644 --- a/conf/airframes/esden/lisa_asctec.xml +++ b/conf/airframes/esden/lisa_asctec.xml @@ -184,7 +184,7 @@ - + diff --git a/conf/airframes/esden/lisa_asctec_aspirin.xml b/conf/airframes/esden/lisa_asctec_aspirin.xml index 93c132ba2c..7dc4b9770b 100644 --- a/conf/airframes/esden/lisa_asctec_aspirin.xml +++ b/conf/airframes/esden/lisa_asctec_aspirin.xml @@ -186,7 +186,7 @@ - + diff --git a/conf/airframes/esden/lisa_m_pwm.xml b/conf/airframes/esden/lisa_m_pwm.xml index df6372d0da..31b8da8f50 100644 --- a/conf/airframes/esden/lisa_m_pwm.xml +++ b/conf/airframes/esden/lisa_m_pwm.xml @@ -206,7 +206,7 @@ - + diff --git a/conf/airframes/esden/lisa_pwm_aspirin.xml b/conf/airframes/esden/lisa_pwm_aspirin.xml index d32481ed6e..fcd3588e0b 100644 --- a/conf/airframes/esden/lisa_pwm_aspirin.xml +++ b/conf/airframes/esden/lisa_pwm_aspirin.xml @@ -181,7 +181,7 @@ - + diff --git a/conf/airframes/esden/synerani_4B.xml b/conf/airframes/esden/synerani_4B.xml index a7f5068165..973a442044 100644 --- a/conf/airframes/esden/synerani_4B.xml +++ b/conf/airframes/esden/synerani_4B.xml @@ -184,7 +184,7 @@ - + diff --git a/conf/airframes/flixr_discovery.xml b/conf/airframes/flixr_discovery.xml index be9fdce96b..2ff3389106 100644 --- a/conf/airframes/flixr_discovery.xml +++ b/conf/airframes/flixr_discovery.xml @@ -230,9 +230,6 @@ http://paparazzi.enac.fr/w/index.php?title=Theory_of_Operation
diff --git a/conf/airframes/microjet_example.xml b/conf/airframes/microjet_example.xml index ac9c757c64..676fa7bc54 100644 --- a/conf/airframes/microjet_example.xml +++ b/conf/airframes/microjet_example.xml @@ -96,9 +96,6 @@ - - -
diff --git a/conf/airframes/mm/rotor/qmk1.xml b/conf/airframes/mm/rotor/qmk1.xml index 6c4e607cf7..c4bacf6f87 100644 --- a/conf/airframes/mm/rotor/qmk1.xml +++ b/conf/airframes/mm/rotor/qmk1.xml @@ -187,7 +187,7 @@ - + diff --git a/conf/airframes/obsolete/booz2_NoVa.xml b/conf/airframes/obsolete/booz2_NoVa.xml index ac6f8776a9..a9e7ff831d 100644 --- a/conf/airframes/obsolete/booz2_NoVa.xml +++ b/conf/airframes/obsolete/booz2_NoVa.xml @@ -248,7 +248,7 @@ include $(CFG_BOOZ)/subsystems/ins_hff.makefile ap.CFLAGS += -DGPS_LAG=0.8 -DUSE_GPS_ACC4R ap.CFLAGS += -DGPS_USE_LATLONG -ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DBOOZ_START_DELAY=3 +ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DACTUATORS_START_DELAY=3 diff --git a/conf/airframes/obsolete/booz2_NoVa_001.xml b/conf/airframes/obsolete/booz2_NoVa_001.xml index affef839d5..582d05c7b4 100644 --- a/conf/airframes/obsolete/booz2_NoVa_001.xml +++ b/conf/airframes/obsolete/booz2_NoVa_001.xml @@ -248,7 +248,7 @@ include $(CFG_BOOZ)/subsystems/ins_hff.makefile ap.CFLAGS += -DGPS_LAG=0.8 -DUSE_GPS_ACC4R ap.CFLAGS += -DGPS_USE_LATLONG -ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DBOOZ_START_DELAY=3 +ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DACTUATORS_START_DELAY=3 diff --git a/conf/airframes/obsolete/booz2_NoVa_002.xml b/conf/airframes/obsolete/booz2_NoVa_002.xml index 56e9ce3c34..27229199c7 100644 --- a/conf/airframes/obsolete/booz2_NoVa_002.xml +++ b/conf/airframes/obsolete/booz2_NoVa_002.xml @@ -249,7 +249,7 @@ include $(CFG_BOOZ)/subsystems/ins_hff.makefile ap.CFLAGS += -DGPS_LAG=0.8 -DUSE_GPS_ACC4R ap.CFLAGS += -DGPS_USE_LATLONG -ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DBOOZ_START_DELAY=3 +ap.CFLAGS += -DUSE_ADAPT_HOVER -DUSE_INS_NAV_INIT -DACTUATORS_START_DELAY=3 diff --git a/conf/airframes/obsolete/hitl_usb.xml b/conf/airframes/obsolete/hitl_usb.xml index a8b52982c1..51d3ad1902 100644 --- a/conf/airframes/obsolete/hitl_usb.xml +++ b/conf/airframes/obsolete/hitl_usb.xml @@ -40,9 +40,6 @@ - - -
diff --git a/conf/airframes/obsolete/microjet6.xml b/conf/airframes/obsolete/microjet6.xml index 6bb0b8e3ac..cea6cdad40 100644 --- a/conf/airframes/obsolete/microjet6.xml +++ b/conf/airframes/obsolete/microjet6.xml @@ -99,9 +99,6 @@ - - -
diff --git a/conf/airframes/obsolete/microjetI.xml b/conf/airframes/obsolete/microjetI.xml index 7e6e3bd5b1..2253cbb0fb 100644 --- a/conf/airframes/obsolete/microjetI.xml +++ b/conf/airframes/obsolete/microjetI.xml @@ -96,9 +96,6 @@ - - -
diff --git a/conf/airframes/obsolete/microjetII.xml b/conf/airframes/obsolete/microjetII.xml index 0fd88e336b..938925cac0 100644 --- a/conf/airframes/obsolete/microjetII.xml +++ b/conf/airframes/obsolete/microjetII.xml @@ -97,9 +97,6 @@ - - -
diff --git a/conf/airframes/obsolete/microjetIII.xml b/conf/airframes/obsolete/microjetIII.xml index 4179706dd5..b1b5e6d001 100644 --- a/conf/airframes/obsolete/microjetIII.xml +++ b/conf/airframes/obsolete/microjetIII.xml @@ -97,9 +97,6 @@ - - -
diff --git a/conf/airframes/obsolete/spirit.xml b/conf/airframes/obsolete/spirit.xml index 66d8d217bf..e8b047f67e 100644 --- a/conf/airframes/obsolete/spirit.xml +++ b/conf/airframes/obsolete/spirit.xml @@ -106,9 +106,6 @@ - - -
diff --git a/conf/airframes/obsolete/spirit_proto.xml b/conf/airframes/obsolete/spirit_proto.xml index d1e147a265..29fa14d9c0 100644 --- a/conf/airframes/obsolete/spirit_proto.xml +++ b/conf/airframes/obsolete/spirit_proto.xml @@ -95,9 +95,6 @@ - - -
diff --git a/conf/airframes/obsolete/storm1.xml b/conf/airframes/obsolete/storm1.xml index 4546155c7b..4d099cbdb7 100644 --- a/conf/airframes/obsolete/storm1.xml +++ b/conf/airframes/obsolete/storm1.xml @@ -122,9 +122,6 @@ - - -
diff --git a/conf/airframes/obsolete/tiny_hitl.xml b/conf/airframes/obsolete/tiny_hitl.xml index c6bfc2b01e..39624cac81 100644 --- a/conf/airframes/obsolete/tiny_hitl.xml +++ b/conf/airframes/obsolete/tiny_hitl.xml @@ -91,9 +91,6 @@ - - -
diff --git a/conf/autopilot/subsystems/fixedwing/radio_control_datalink.makefile b/conf/autopilot/subsystems/fixedwing/radio_control_datalink.makefile index 6202acf1b8..bb342a5c3e 100644 --- a/conf/autopilot/subsystems/fixedwing/radio_control_datalink.makefile +++ b/conf/autopilot/subsystems/fixedwing/radio_control_datalink.makefile @@ -11,6 +11,9 @@ endif ifeq ($(NORADIO), False) +ifdef (RADIO_CONTROL_DATALINK_LED) + ap.CFLAGS += -D(RADIO_CONTROL_DATALINK_LED=$((RADIO_CONTROL_DATALINK_LED) +endif $(TARGET).CFLAGS += -DRADIO_CONTROL $(TARGET).CFLAGS += -DRADIO_CONTROL_TYPE_H=\"radio_control/rc_datalink.h\" $(TARGET).CFLAGS += -DRADIO_CONTROL_TYPE_DATALINK diff --git a/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile b/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile index 5922e9c2ce..ed4da826d6 100644 --- a/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile +++ b/conf/autopilot/subsystems/rotorcraft/actuators_mkk.makefile @@ -6,6 +6,8 @@ # ... # # +# +# # # # diff --git a/conf/autopilot/subsystems/shared/imu_aspirin.makefile b/conf/autopilot/subsystems/shared/imu_aspirin.makefile index 51bbaa33e3..1c08dca87b 100644 --- a/conf/autopilot/subsystems/shared/imu_aspirin.makefile +++ b/conf/autopilot/subsystems/shared/imu_aspirin.makefile @@ -1,66 +1,3 @@ -# -# Aspirin IMU -# -# -# required xml: -#
-# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -# -#
-# -# +include $(CFG_SHARED)/imu_aspirin_v1.0.makefile -# imu aspirin - -IMU_ASPIRIN_CFLAGS = -DUSE_IMU -IMU_ASPIRIN_CFLAGS += -DIMU_TYPE_H=\"imu/imu_aspirin.h\" -DIMU_OVERRIDE_CHANNELS -IMU_ASPIRIN_SRCS = $(SRC_SUBSYSTEMS)/imu.c \ - $(SRC_SUBSYSTEMS)/imu/imu_aspirin.c \ - $(SRC_ARCH)/subsystems/imu/imu_aspirin_arch.c - -# Magnetometer -IMU_ASPIRIN_SRCS += peripherals/hmc5843.c $(SRC_ARCH)/peripherals/hmc5843_arch.c - -IMU_ASPIRIN_CFLAGS += -DUSE_I2C2 - -ifeq ($(ARCH), lpc21) -#TODO -else ifeq ($(ARCH), stm32) -IMU_ASPIRIN_CFLAGS += -DUSE_EXTI15_10_IRQ # Gyro Int on PC14 -IMU_ASPIRIN_CFLAGS += -DUSE_EXTI9_5_IRQ # Mag Int on PB5 -IMU_ASPIRIN_CFLAGS += -DUSE_EXTI2_IRQ # Accel Int on PD2 -IMU_ASPIRIN_CFLAGS += -DUSE_DMA1_C4_IRQ # SPI2 Rx DMA -endif - - -# Keep CFLAGS/Srcs for imu in separate expression so we can assign it to other targets -# see: conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.1.makefile for example -ap.CFLAGS += $(IMU_ASPIRIN_CFLAGS) -ap.srcs += $(IMU_ASPIRIN_SRCS) - -# sim not done yet -#sim.CFLAGS += $(IMU_ASPIRIN_CFLAGS) -#sim.srcs += $(IMU_ASPIRIN_SRCS) +$(warning The imu_aspirin subsystem has been split up into different versions, please replace with (or aspirin_v1.5) in your airframe file.) diff --git a/conf/autopilot/subsystems/shared/imu_aspirin_common.makefile b/conf/autopilot/subsystems/shared/imu_aspirin_common.makefile new file mode 100644 index 0000000000..0deb8e75b3 --- /dev/null +++ b/conf/autopilot/subsystems/shared/imu_aspirin_common.makefile @@ -0,0 +1,58 @@ +# Hey Emacs, this is a -*- makefile -*- +# +# Common part for all Aspirin IMUs +# +# +# required xml: +#
+# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +#
+# +# + +# imu aspirin + +IMU_ASPIRIN_CFLAGS = -DUSE_IMU +IMU_ASPIRIN_CFLAGS += -DIMU_TYPE_H=\"imu/imu_aspirin.h\" -DIMU_OVERRIDE_CHANNELS +IMU_ASPIRIN_SRCS = $(SRC_SUBSYSTEMS)/imu.c \ + $(SRC_SUBSYSTEMS)/imu/imu_aspirin.c \ + $(SRC_ARCH)/subsystems/imu/imu_aspirin_arch.c + +# Magnetometer +IMU_ASPIRIN_SRCS += peripherals/hmc5843.c $(SRC_ARCH)/peripherals/hmc5843_arch.c + +IMU_ASPIRIN_CFLAGS += -DUSE_I2C2 + +ifeq ($(ARCH), lpc21) +#TODO +else ifeq ($(ARCH), stm32) +IMU_ASPIRIN_CFLAGS += -DUSE_EXTI15_10_IRQ # Gyro Int on PC14 +IMU_ASPIRIN_CFLAGS += -DUSE_EXTI9_5_IRQ # Mag Int on PB5 +IMU_ASPIRIN_CFLAGS += -DUSE_EXTI2_IRQ # Accel Int on PD2 +IMU_ASPIRIN_CFLAGS += -DUSE_DMA1_C4_IRQ # SPI2 Rx DMA +endif + diff --git a/conf/autopilot/subsystems/shared/imu_aspirin_v1.0.makefile b/conf/autopilot/subsystems/shared/imu_aspirin_v1.0.makefile new file mode 100644 index 0000000000..3e2e8a7c26 --- /dev/null +++ b/conf/autopilot/subsystems/shared/imu_aspirin_v1.0.makefile @@ -0,0 +1,46 @@ +# Hey Emacs, this is a -*- makefile -*- +# +# Aspirin IMU v1.0 +# +# +# required xml: +#
+# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +#
+# +# + +# imu aspirin + +include $(CFG_SHARED)/imu_aspirin_common.makefile + +IMU_ASPIRIN_CFLAGS += -DIMU_ASPIRIN_VERSION_1_0 + +# Keep CFLAGS/Srcs for imu in separate expression so we can assign it to other targets +# see: conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.1.makefile for example +ap.CFLAGS += $(IMU_ASPIRIN_CFLAGS) +ap.srcs += $(IMU_ASPIRIN_SRCS) diff --git a/conf/autopilot/subsystems/shared/imu_aspirin_v1.5.makefile b/conf/autopilot/subsystems/shared/imu_aspirin_v1.5.makefile new file mode 100644 index 0000000000..2686e94905 --- /dev/null +++ b/conf/autopilot/subsystems/shared/imu_aspirin_v1.5.makefile @@ -0,0 +1,46 @@ +# Hey Emacs, this is a -*- makefile -*- +# +# Aspirin IMU v1.5 +# +# +# required xml: +#
+# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +# +#
+# +# + +# imu aspirin + +include $(CFG_SHARED)/imu_aspirin_common.makefile + +IMU_ASPIRIN_CFLAGS += -DIMU_ASPIRIN_VERSION_1_5 + +# Keep CFLAGS/Srcs for imu in separate expression so we can assign it to other targets +# see: conf/autopilot/subsystems/lisa_passthrough/imu_b2_v1.1.makefile for example +ap.CFLAGS += $(IMU_ASPIRIN_CFLAGS) +ap.srcs += $(IMU_ASPIRIN_SRCS) diff --git a/conf/autopilot/subsystems/shared/radio_control_ppm.makefile b/conf/autopilot/subsystems/shared/radio_control_ppm.makefile index 6b2fdeab88..41b7f90729 100644 --- a/conf/autopilot/subsystems/shared/radio_control_ppm.makefile +++ b/conf/autopilot/subsystems/shared/radio_control_ppm.makefile @@ -12,7 +12,7 @@ endif ifeq ($(NORADIO), False) $(TARGET).CFLAGS += -DRADIO_CONTROL - ifdef RADIO_CONTROL_LED + ifneq ($(RADIO_CONTROL_LED),none) ap.CFLAGS += -DRADIO_CONTROL_LED=$(RADIO_CONTROL_LED) endif $(TARGET).CFLAGS += -DRADIO_CONTROL_TYPE_H=\"subsystems/radio_control/ppm.h\" diff --git a/conf/autopilot/subsystems/shared/radio_control_spektrum.makefile b/conf/autopilot/subsystems/shared/radio_control_spektrum.makefile index ae53bd7a26..192a21c376 100644 --- a/conf/autopilot/subsystems/shared/radio_control_spektrum.makefile +++ b/conf/autopilot/subsystems/shared/radio_control_spektrum.makefile @@ -10,7 +10,7 @@ ap.CFLAGS += -DRADIO_CONTROL_TYPE_H=\"subsystems/radio_control/spektrum.h\" ifeq ($(ARCH), lpc21) ap.CFLAGS += -DRADIO_CONTROL_SPEKTRUM_MODEL_H=$(RADIO_CONTROL_SPEKTRUM_MODEL) endif -ifdef RADIO_CONTROL_LED +ifneq ($(RADIO_CONTROL_LED),none) ap.CFLAGS += -DRADIO_CONTROL_LED=$(RADIO_CONTROL_LED) endif ap.CFLAGS += -DRADIO_CONTROL_SPEKTRUM_PRIMARY_PORT=$(RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT) diff --git a/conf/boards/classix.makefile b/conf/boards/classix.makefile index 79002ad107..055ec54e92 100644 --- a/conf/boards/classix.makefile +++ b/conf/boards/classix.makefile @@ -24,6 +24,7 @@ LPC21ISP_XTAL = 12000 ### default settings for classix GPS_BAUD = B38400 GPS_LED = none +RADIO_CONTROL_LED = none # All targets on the TINY board run on the same processor achitecture $(TARGET).ARCHDIR = $(ARCH) diff --git a/conf/boards/hb_1.1.makefile b/conf/boards/hb_1.1.makefile index b8d0c3ae0a..4c2a8c8525 100644 --- a/conf/boards/hb_1.1.makefile +++ b/conf/boards/hb_1.1.makefile @@ -37,6 +37,7 @@ GPS_BAUD = B38400 endif GPS_LED = 2 +RADIO_CONTROL_LED = none ifndef ADC_IR1 ADC_IR1 = 1 diff --git a/conf/boards/lisa_m_1.0.makefile b/conf/boards/lisa_m_1.0.makefile index 0a05903f17..269bc8aef4 100644 --- a/conf/boards/lisa_m_1.0.makefile +++ b/conf/boards/lisa_m_1.0.makefile @@ -31,7 +31,7 @@ SYS_TIME_LED = 1 RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT = UART3 RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT = UART5 -#RADIO_CONTROL_LED = 5 +RADIO_CONTROL_LED = none ifndef MODEM_PORT MODEM_PORT=UART2 diff --git a/conf/boards/tiny_2.11.makefile b/conf/boards/tiny_2.11.makefile index fd92507e9a..706ebf8154 100644 --- a/conf/boards/tiny_2.11.makefile +++ b/conf/boards/tiny_2.11.makefile @@ -36,6 +36,8 @@ ifndef MODEM_BAUD MODEM_BAUD = B57600 endif +RADIO_CONTROL_LED = none + ADC_IR_TOP = ADC_0 ADC_IR1 = ADC_1 ADC_IR2 = ADC_2 diff --git a/conf/boards/umarim_1.0.makefile b/conf/boards/umarim_1.0.makefile index 793cc91778..3ebc16dbcd 100644 --- a/conf/boards/umarim_1.0.makefile +++ b/conf/boards/umarim_1.0.makefile @@ -29,6 +29,8 @@ GPS_BAUD = B38400 endif GPS_LED = 2 +RADIO_CONTROL_LED = none + ifndef MODEM_PORT MODEM_PORT = UART1 endif diff --git a/conf/settings/tuning.xml b/conf/settings/tuning.xml index 8e9538720e..cf1fcb3f4c 100644 --- a/conf/settings/tuning.xml +++ b/conf/settings/tuning.xml @@ -31,6 +31,11 @@ + + + + + diff --git a/conf/settings/tuning_ctl_adaptive.xml b/conf/settings/tuning_ctl_adaptive.xml index 7cd558dae2..6271f6aa9c 100644 --- a/conf/settings/tuning_ctl_adaptive.xml +++ b/conf/settings/tuning_ctl_adaptive.xml @@ -6,6 +6,11 @@ + + + + + diff --git a/conf/settings/tuning_ctl_new.xml b/conf/settings/tuning_ctl_new.xml index d283b907fb..38f5e825fe 100644 --- a/conf/settings/tuning_ctl_new.xml +++ b/conf/settings/tuning_ctl_new.xml @@ -6,6 +6,11 @@ + + + + + diff --git a/conf/settings/tuning_ins.xml b/conf/settings/tuning_ins.xml index 4b379b8154..a4874b0190 100644 --- a/conf/settings/tuning_ins.xml +++ b/conf/settings/tuning_ins.xml @@ -31,6 +31,11 @@ + + + + + diff --git a/conf/settings/tuning_ins_dcm.xml b/conf/settings/tuning_ins_dcm.xml index c87c3158ac..5bdfe7d129 100644 --- a/conf/settings/tuning_ins_dcm.xml +++ b/conf/settings/tuning_ins_dcm.xml @@ -31,6 +31,11 @@ + + + + + diff --git a/conf/settings/tuning_loiter.xml b/conf/settings/tuning_loiter.xml index 0272ab6421..4b8d0fcdc0 100644 --- a/conf/settings/tuning_loiter.xml +++ b/conf/settings/tuning_loiter.xml @@ -44,6 +44,10 @@ + + + + diff --git a/conf/telemetry/booz.xml b/conf/telemetry/booz.xml deleted file mode 100644 index 6387de0834..0000000000 --- a/conf/telemetry/booz.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sw/airborne/arch/sim/sim_gps.c b/sw/airborne/arch/sim/sim_gps.c index 13ef9b84cd..c329f6b76e 100644 --- a/sw/airborne/arch/sim/sim_gps.c +++ b/sw/airborne/arch/sim/sim_gps.c @@ -42,6 +42,7 @@ value sim_use_gps_pos(value x, value y, value z, value c, value a, value s, valu gps.utm_pos.north = utm_f.north*100; gps.utm_pos.zone = nav_utm_zone0; x = y = z; /* Just to get rid of the "unused arg" warning */ + y = x; /* Just to get rid of the "unused arg" warning */ #else // GPS_USE_LATLONG gps.utm_pos.east = Int_val(x); gps.utm_pos.north = Int_val(y); diff --git a/sw/airborne/arch/stm32/subsystems/settings_arch.c b/sw/airborne/arch/stm32/subsystems/settings_arch.c index 38e1bcd7a8..9ac5d761aa 100644 --- a/sw/airborne/arch/stm32/subsystems/settings_arch.c +++ b/sw/airborne/arch/stm32/subsystems/settings_arch.c @@ -35,9 +35,14 @@ #include "subsystems/settings.h" -#include +#if defined(STM32F1) || defined(STM32F2) || defined(STM32F4) +#include +#include +#else #include #include +#endif +#include struct FlashInfo { uint32_t addr; diff --git a/sw/airborne/arch/stm32/sys_time_hw.h b/sw/airborne/arch/stm32/sys_time_hw.h index 9d88a69d8c..6b8e09fb83 100644 --- a/sw/airborne/arch/stm32/sys_time_hw.h +++ b/sw/airborne/arch/stm32/sys_time_hw.h @@ -50,6 +50,12 @@ extern uint32_t cpu_time_ticks; #define SYS_TICS_OF_SEC(s) (uint32_t)((s) * AHB_CLK + 0.5) #define SIGNED_SYS_TICS_OF_SEC(s) (int32_t)((s) * AHB_CLK + 0.5) +/* Generic timer macros */ +//FIXME: untested! +#define SysTimeTimerStart(_t) { _t = cpu_time_ticks; } +#define SysTimeTimer(_t) ((uint32_t)(cpu_time_ticks - _t)) +#define SysTimeTimerStop(_t) { _t = (cpu_time_ticks - _t); } + static inline bool_t sys_time_periodic( void ) { if (sys_time_period_elapsed) { sys_time_period_elapsed = FALSE; diff --git a/sw/airborne/commands.c b/sw/airborne/commands.c index c73b50081f..3dd61cfdd3 100644 --- a/sw/airborne/commands.c +++ b/sw/airborne/commands.c @@ -28,5 +28,16 @@ #include "commands.h" +#ifndef COMMAND_ROLL_TRIM +#define COMMAND_ROLL_TRIM 0 +#endif + +#ifndef COMMAND_PITCH_TRIM +#define COMMAND_PITCH_TRIM 0 +#endif + +pprz_t command_roll_trim = COMMAND_ROLL_TRIM; +pprz_t command_pitch_trim = COMMAND_PITCH_TRIM; + pprz_t commands[COMMANDS_NB]; const pprz_t commands_failsafe[COMMANDS_NB] = COMMANDS_FAILSAFE; diff --git a/sw/airborne/commands.h b/sw/airborne/commands.h index a824de01c9..4716959233 100644 --- a/sw/airborne/commands.h +++ b/sw/airborne/commands.h @@ -32,6 +32,8 @@ #include "paparazzi.h" #include "generated/airframe.h" +extern pprz_t command_roll_trim; +extern pprz_t command_pitch_trim; extern pprz_t commands[COMMANDS_NB]; extern const pprz_t commands_failsafe[COMMANDS_NB]; diff --git a/sw/airborne/firmwares/fixedwing/datalink.c b/sw/airborne/firmwares/fixedwing/datalink.c index 106156e564..bbd43d3eb1 100644 --- a/sw/airborne/firmwares/fixedwing/datalink.c +++ b/sw/airborne/firmwares/fixedwing/datalink.c @@ -187,14 +187,18 @@ void dl_parse_msg(void) { #endif // USE_JOYSTICK #if defined RADIO_CONTROL && defined RADIO_CONTROL_TYPE_DATALINK if (msg_id == DL_RC_3CH /*&& DL_RC_3CH_ac_id(dl_buffer) == TX_ID*/) { -LED_TOGGLE(3); +#ifdef RADIO_CONTROL_DATALINK_LED + LED_TOGGLE(RADIO_CONTROL_DATALINK_LED); +#endif parse_rc_3ch_datalink( DL_RC_3CH_throttle_mode(dl_buffer), DL_RC_3CH_roll(dl_buffer), DL_RC_3CH_pitch(dl_buffer)); } else if (msg_id == DL_RC_4CH && DL_RC_4CH_ac_id(dl_buffer) == AC_ID) { -LED_TOGGLE(3); +#ifdef RADIO_CONTROL_DATALINK_LED + LED_TOGGLE(RADIO_CONTROL_DATALINK_LED); +#endif parse_rc_4ch_datalink( DL_RC_4CH_mode(dl_buffer), DL_RC_4CH_throttle(dl_buffer), diff --git a/sw/airborne/firmwares/fixedwing/main_fbw.c b/sw/airborne/firmwares/fixedwing/main_fbw.c index 7989e57433..c8d642caef 100644 --- a/sw/airborne/firmwares/fixedwing/main_fbw.c +++ b/sw/airborne/firmwares/fixedwing/main_fbw.c @@ -145,7 +145,18 @@ void event_task_fbw( void) { #ifdef ACTUATORS if (fbw_new_actuators > 0) { - SetActuatorsFromCommands(commands); + pprz_t trimmed_commands[COMMANDS_NB]; + int i; + for(i = 0; i < COMMANDS_NB; i++) trimmed_commands[i] = commands[i]; + + #ifdef COMMAND_ROLL + trimmed_commands[COMMAND_ROLL] += ChopAbs(command_roll_trim, MAX_PPRZ/10); + #endif + #ifdef COMMAND_PITCH + trimmed_commands[COMMAND_PITCH] += ChopAbs(command_pitch_trim, MAX_PPRZ/10); + #endif + + SetActuatorsFromCommands(trimmed_commands); fbw_new_actuators = 0; } #endif diff --git a/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.c b/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.c index 9bf9575bdb..a2c9f4232e 100644 --- a/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.c +++ b/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.c @@ -361,7 +361,10 @@ inline static void loiter(void) { inline static void h_ctl_pitch_loop( void ) { +#if !USE_GYRO_PITCH_RATE static float last_err; +#endif + /* sanity check */ if (h_ctl_pitch_of_roll <0.) h_ctl_pitch_of_roll = 0.; @@ -394,12 +397,12 @@ inline static void h_ctl_pitch_loop( void ) { // Compute errors float err = estimator_theta - h_ctl_ref_pitch_angle; -#ifdef USE_GYRO_PITCH_RATE +#if USE_GYRO_PITCH_RATE float d_err = estimator_q - h_ctl_ref_pitch_rate; #else // soft derivation float d_err = (err - last_err)/H_CTL_REF_DT - h_ctl_ref_pitch_rate; -#endif last_err = err; +#endif if (pprz_mode == PPRZ_MODE_MANUAL || launch == 0) { h_ctl_pitch_sum_err = 0.; diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.c b/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.c index c0b602915b..8b11977485 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.c +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.c @@ -29,7 +29,7 @@ void actuators_init(void) { #endif actuators_asctec.nb_err = 0; -#if defined BOOZ_START_DELAY && ! defined SITL +#if defined ACTUATORS_START_DELAY && ! defined SITL actuators_delay_done = FALSE; SysTimeTimerStart(actuators_delay_time); #else @@ -45,9 +45,9 @@ void actuators_init(void) { #ifndef ACTUATORS_ASCTEC_V2_PROTOCOL void actuators_set(bool_t motors_on) { -#if defined BOOZ_START_DELAY && ! defined SITL +#if defined ACTUATORS_START_DELAY && ! defined SITL if (!actuators_delay_done) { - if (SysTimeTimer(actuators_delay_time) < SYS_TICS_OF_SEC(BOOZ_START_DELAY)) return; + if (SysTimeTimer(actuators_delay_time) < SYS_TICS_OF_SEC(ACTUATORS_START_DELAY)) return; else actuators_delay_done = TRUE; } #endif diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.c b/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.c index b9d7a04b98..b9c3dc8211 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.c +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.c @@ -46,7 +46,7 @@ void actuators_init(void) { actuators_mkk.trans[i].status = I2CTransSuccess; } -#if defined BOOZ_START_DELAY && ! defined SITL +#if defined ACTUATORS_START_DELAY && ! defined SITL actuators_delay_done = FALSE; SysTimeTimerStart(actuators_delay_time); #else @@ -58,9 +58,9 @@ void actuators_init(void) { void actuators_set(bool_t motors_on) { -#if defined BOOZ_START_DELAY && ! defined SITL +#if defined ACTUATORS_START_DELAY && ! defined SITL if (!actuators_delay_done) { - if (SysTimeTimer(actuators_delay_time) < SYS_TICS_OF_SEC(BOOZ_START_DELAY)) return; + if (SysTimeTimer(actuators_delay_time) < SYS_TICS_OF_SEC(ACTUATORS_START_DELAY)) return; else actuators_delay_done = TRUE; } #endif diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.c b/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.c index fe6a806195..c46397e251 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.c +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.c @@ -45,7 +45,7 @@ void actuators_init(void) { actuators_skiron.actuators_idx[i] = actuators_idx[i]; } -#if defined BOOZ_START_DELAY && ! defined SITL +#if defined ACTUATORS_START_DELAY && ! defined SITL actuators_delay_done = FALSE; SysTimeTimerStart(actuators_delay_time); #else @@ -56,9 +56,9 @@ void actuators_init(void) { } void actuators_set(bool_t motors_on) { -#if defined BOOZ_START_DELAY && ! defined SITL +#if defined ACTUATORS_START_DELAY && ! defined SITL if (!actuators_delay_done) { - if (SysTimeTimer(actuators_delay_time) < SYS_TICS_OF_SEC(BOOZ_START_DELAY)) return; + if (SysTimeTimer(actuators_delay_time) < SYS_TICS_OF_SEC(ACTUATORS_START_DELAY)) return; else actuators_delay_done = TRUE; } #endif diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c index 51fa66d0e8..5e81cb5b5e 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c @@ -192,7 +192,9 @@ void guidance_v_run(bool_t in_flight) { #endif gv_update_ref_from_zd_sp(guidance_v_zd_sp); run_hover_loop(in_flight); -#if !NO_RC_THRUST_LIMIT +#if NO_RC_THRUST_LIMIT + stabilization_cmd[COMMAND_THRUST] = guidance_v_delta_t; +#else // saturate max authority with RC stick stabilization_cmd[COMMAND_THRUST] = Min( guidance_v_rc_delta_t, guidance_v_delta_t); #endif @@ -205,7 +207,9 @@ void guidance_v_run(bool_t in_flight) { #endif gv_update_ref_from_z_sp(guidance_v_z_sp); run_hover_loop(in_flight); -#if !NO_RC_THRUST_LIMIT +#if NO_RC_THRUST_LIMIT + stabilization_cmd[COMMAND_THRUST] = guidance_v_delta_t; +#else // saturate max authority with RC stick stabilization_cmd[COMMAND_THRUST] = Min( guidance_v_rc_delta_t, guidance_v_delta_t); #endif @@ -228,7 +232,9 @@ void guidance_v_run(bool_t in_flight) { guidance_v_z_sp = -nav_flight_altitude; // For display only guidance_v_delta_t = nav_throttle; } -#if !NO_RC_THRUST_LIMIT +#if NO_RC_THRUST_LIMIT + stabilization_cmd[COMMAND_THRUST] = guidance_v_delta_t; +#else /* use rc limitation if available */ if (radio_control.status == RC_OK) stabilization_cmd[COMMAND_THRUST] = Min( guidance_v_rc_delta_t, guidance_v_delta_t); diff --git a/sw/airborne/math/pprz_algebra.h b/sw/airborne/math/pprz_algebra.h index 086479d390..9ff572b683 100644 --- a/sw/airborne/math/pprz_algebra.h +++ b/sw/airborne/math/pprz_algebra.h @@ -199,6 +199,19 @@ if ((_v).z > (_v_max).y) (_v).z = (_v_max).z; else if ((_v).z < (_v_min).z) (_v).z = (_v_min).z; \ } +#define VECT3_CROSS_PRODUCT(_vo, _v1, _v2) { \ + (_vo).x = (_v1).y*(_v2).z - (_v1).z*(_v2).y; \ + (_vo).y = (_v1).z*(_v2).x - (_v1).x*(_v2).z; \ + (_vo).z = (_v1).x*(_v2).y - (_v1).y*(_v2).x; \ + } + +#define VECT3_RATES_CROSS_VECT3(_vo, _r1, _v2) { \ + (_vo).x = (_r1).q*(_v2).z - (_r1).r*(_v2).y; \ + (_vo).y = (_r1).r*(_v2).x - (_r1).p*(_v2).z; \ + (_vo).z = (_r1).p*(_v2).y - (_r1).q*(_v2).x; \ + } + + /* diff --git a/sw/airborne/math/pprz_algebra_int.h b/sw/airborne/math/pprz_algebra_int.h index 0e1cff56dd..1a4c3ae322 100644 --- a/sw/airborne/math/pprz_algebra_int.h +++ b/sw/airborne/math/pprz_algebra_int.h @@ -311,10 +311,10 @@ struct Int64Vect3 { } -#define INT32_MAT33_VECT3_MULT(_o, _m, _v, _f) { \ - (_o).x = ((_m)[0]*(_v).x + (_m)[1]*(_v).y + (_m)[2]*(_v).z)>>(_f); \ - (_o).y = ((_m)[3]*(_v).x + (_m)[4]*(_v).y + (_m)[5]*(_v).z)>>(_f); \ - (_o).z = ((_m)[6]*(_v).x + (_m)[7]*(_v).y + (_m)[8]*(_v).z)>>(_f); \ +#define INT32_MAT33_VECT3_MUL(_o, _m, _v, _f) { \ + (_o).x = ((_m).m[0]*(_v).x + (_m).m[1]*(_v).y + (_m).m[2]*(_v).z)>>(_f); \ + (_o).y = ((_m).m[3]*(_v).x + (_m).m[4]*(_v).y + (_m).m[5]*(_v).z)>>(_f); \ + (_o).z = ((_m).m[6]*(_v).x + (_m).m[7]*(_v).y + (_m).m[8]*(_v).z)>>(_f); \ } /* diff --git a/sw/airborne/subsystems/ahrs/ahrs_int_cmpl.c b/sw/airborne/subsystems/ahrs/ahrs_int_cmpl.c index 4060f3ca8d..057f879ffc 100644 --- a/sw/airborne/subsystems/ahrs/ahrs_int_cmpl.c +++ b/sw/airborne/subsystems/ahrs/ahrs_int_cmpl.c @@ -45,28 +45,28 @@ static inline void ahrs_update_mag_2d(void); /* in place quaternion first order integration with constante rotational velocity */ /* */ -#define INT32_QUAT_INTEGRATE_FI(_q, _hr, _omega, _f) { \ - _hr.qi += -_omega.p*_q.qx - _omega.q*_q.qy - _omega.r*_q.qz; \ - _hr.qx += _omega.p*_q.qi + _omega.r*_q.qy - _omega.q*_q.qz; \ - _hr.qy += _omega.q*_q.qi - _omega.r*_q.qx + _omega.p*_q.qz; \ - _hr.qz += _omega.r*_q.qi + _omega.q*_q.qx - _omega.p*_q.qy; \ - \ - ldiv_t _div = ldiv(_hr.qi, ((1< PI_INTEG_EULER) _a -= TWO_PI_INTEG_EULER; \ - while (_a < -PI_INTEG_EULER) _a += TWO_PI_INTEG_EULER; \ +#define INTEG_EULER_NORMALIZE(_a) { \ + while (_a > PI_INTEG_EULER) _a -= TWO_PI_INTEG_EULER; \ + while (_a < -PI_INTEG_EULER) _a += TWO_PI_INTEG_EULER; \ } void ahrs_init(void) { @@ -78,7 +78,7 @@ void ahrs_align(void) { get_phi_theta_measurement_fom_accel(&ahrs_impl.hi_res_euler.phi, &ahrs_impl.hi_res_euler.theta, ahrs_aligner.lp_accel); get_psi_measurement_from_mag(&ahrs_impl.hi_res_euler.psi, - ahrs_impl.hi_res_euler.phi/F_UPDATE, ahrs_impl.hi_res_euler.theta/F_UPDATE, ahrs_aligner.lp_mag); + ahrs_impl.hi_res_euler.phi/F_UPDATE, ahrs_impl.hi_res_euler.theta/F_UPDATE, ahrs_aligner.lp_mag); EULERS_COPY(ahrs_impl.measure, ahrs_impl.hi_res_euler); EULERS_COPY(ahrs_impl.measurement, ahrs_impl.hi_res_euler); diff --git a/sw/airborne/subsystems/gps/gps_mtk.c b/sw/airborne/subsystems/gps/gps_mtk.c index aaa96859e6..79a157db86 100644 --- a/sw/airborne/subsystems/gps/gps_mtk.c +++ b/sw/airborne/subsystems/gps/gps_mtk.c @@ -386,6 +386,8 @@ static bool_t user_gps_configure(bool_t cpt) { case 1: MtkSend_CFG(MTK_DIY_OUTPUT_RATE); return FALSE; + default: + break; } return TRUE; /* Continue, except for the last case */ } diff --git a/sw/airborne/subsystems/imu/imu_aspirin.h b/sw/airborne/subsystems/imu/imu_aspirin.h index f14a8f0bc7..39f8e5cd89 100644 --- a/sw/airborne/subsystems/imu/imu_aspirin.h +++ b/sw/airborne/subsystems/imu/imu_aspirin.h @@ -32,9 +32,27 @@ #include "peripherals/hmc5843.h" #include "peripherals/adxl345.h" +#ifdef IMU_ASPIRIN_VERSION_1_0 #define IMU_MAG_X_CHAN 0 #define IMU_MAG_Y_CHAN 1 #define IMU_MAG_Z_CHAN 2 +#if !defined IMU_MAG_X_SIGN & !defined IMU_MAG_Y_SIGN & !defined IMU_MAG_Z_SIGN +#define IMU_MAG_X_SIGN 1 +#define IMU_MAG_Y_SIGN 1 +#define IMU_MAG_Z_SIGN 1 +#endif +#endif + +#ifdef IMU_ASPIRIN_VERSION_1_5 +#define IMU_MAG_X_CHAN 2 +#define IMU_MAG_Y_CHAN 0 +#define IMU_MAG_Z_CHAN 1 +#if !defined IMU_MAG_X_SIGN & !defined IMU_MAG_Y_SIGN & !defined IMU_MAG_Z_SIGN +#define IMU_MAG_X_SIGN 1 +#define IMU_MAG_Y_SIGN -1 +#define IMU_MAG_Z_SIGN 1 +#endif +#endif #if !defined IMU_GYRO_P_SIGN & !defined IMU_GYRO_Q_SIGN & !defined IMU_GYRO_R_SIGN #define IMU_GYRO_P_SIGN 1 @@ -46,11 +64,6 @@ #define IMU_ACCEL_Y_SIGN 1 #define IMU_ACCEL_Z_SIGN 1 #endif -#if !defined IMU_MAG_X_SIGN & !defined IMU_MAG_Y_SIGN & !defined IMU_MAG_Z_SIGN -#define IMU_MAG_X_SIGN 1 -#define IMU_MAG_Y_SIGN 1 -#define IMU_MAG_Z_SIGN 1 -#endif enum AspirinStatus { AspirinStatusUninit, diff --git a/sw/airborne/subsystems/ins.c b/sw/airborne/subsystems/ins.c index d25b367a84..c5b87519bf 100644 --- a/sw/airborne/subsystems/ins.c +++ b/sw/airborne/subsystems/ins.c @@ -91,16 +91,16 @@ void ins_init() { ins_ltp_initialised = TRUE; /** FIXME: should use the same code than MOVE_WP in firmwares/rotorcraft/datalink.c */ - struct LlaCoor_i llh; /* Height above the ellipsoid */ - llh.lat = INT32_RAD_OF_DEG(NAV_LAT0); - llh.lon = INT32_RAD_OF_DEG(NAV_LON0); + struct LlaCoor_i llh_nav0; /* Height above the ellipsoid */ + llh_nav0.lat = INT32_RAD_OF_DEG(NAV_LAT0); + llh_nav0.lon = INT32_RAD_OF_DEG(NAV_LON0); /* NAV_ALT0 = ground alt above msl, NAV_MSL0 = geoid-height (msl) over ellipsoid */ - llh.alt = NAV_ALT0 + NAV_MSL0; + llh_nav0.alt = NAV_ALT0 + NAV_MSL0; - struct EcefCoor_i nav_init; - ecef_of_lla_i(&nav_init, &llh); + struct EcefCoor_i ecef_nav0; + ecef_of_lla_i(&ecef_nav0, &llh_nav0); - ltp_def_from_ecef_i(&ins_ltp_def, &nav_init); + ltp_def_from_ecef_i(&ins_ltp_def, &ecef_nav0); ins_ltp_def.hmsl = NAV_ALT0; #else ins_ltp_initialised = FALSE; diff --git a/sw/airborne/subsystems/navigation/spiral.c b/sw/airborne/subsystems/navigation/spiral.c index e05b26df5e..745ae53a8e 100644 --- a/sw/airborne/subsystems/navigation/spiral.c +++ b/sw/airborne/subsystems/navigation/spiral.c @@ -90,13 +90,9 @@ bool_t SpiralNav(void) TransCurrentY = estimator_y - WaypointY(Center); DistanceFromCenter = sqrt(TransCurrentX*TransCurrentX+TransCurrentY*TransCurrentY); - bool_t InCircle = TRUE; float DistanceStartEstim; float CircleAlpha; - if(DistanceFromCenter > Spiralradius) - InCircle = FALSE; - switch(CSpiralStatus) { case Outside: diff --git a/sw/ground_segment/tmtc/settings.ml b/sw/ground_segment/tmtc/settings.ml index 5d6d464dfc..0244c11d15 100644 --- a/sw/ground_segment/tmtc/settings.ml +++ b/sw/ground_segment/tmtc/settings.ml @@ -49,10 +49,10 @@ let one_ac = fun (notebook:GPack.notebook) ac_name -> let vs = ["ac_id", Pprz.String ac_id; "index", Pprz.Int idx] in if classify_float value = FP_normal || classify_float value =FP_zero then - let vs' = ("value", Pprz.Float value) :: vs in - Ground_Pprz.message_send "dl" "DL_SETTING" vs' + let vs' = ("value", Pprz.Float value) :: vs in + Ground_Pprz.message_send "dl" "DL_SETTING" vs' else - Ground_Pprz.message_send "dl" "GET_DL_SETTING" vs in + Ground_Pprz.message_send "dl" "GET_DL_SETTING" vs in (* Build the buttons and sliders *) let xml = Xml.parse_file xml_file in diff --git a/sw/simulator/flight_gear.h b/sw/simulator/flight_gear.h index b5515c89cb..c1d098876f 100644 --- a/sw/simulator/flight_gear.h +++ b/sw/simulator/flight_gear.h @@ -211,9 +211,15 @@ struct FGNetMiniFDM { #define FG_NET_GUI_VERSION 7 #define FG_NET_GUI_MAX_TANKS 4 +// FIXME: Flightgear on OSX is still 32 bit get rid +// off these pragmas when it goes to 64 bit. #ifdef __x86_64__ #pragma pack(push) +#ifdef __APPLE__ #pragma pack(4) +#else +#pragma pack(8) +#endif #endif struct FGNetGUI { uint32_t version; // increment when data values change @@ -249,7 +255,7 @@ struct FGNetGUI { float course_deviation_deg; // degrees off target course float gs_deviation_deg; // degrees off target glide slope }; -#ifdef __x86_64__ +#ifdef __x86_64__ && __APPLE__ #pragma pack(push) #pragma pack(pop) #endif diff --git a/sw/simulator/sim.ml b/sw/simulator/sim.ml index 287e69fb3e..a3af693611 100644 --- a/sw/simulator/sim.ml +++ b/sw/simulator/sim.ml @@ -53,28 +53,28 @@ let cb_register = fun closure -> module type AIRCRAFT = - sig - val init : int -> GPack.box -> unit +sig + val init : int -> GPack.box -> unit (** [init ac_id box] *) - val boot : Stdlib.value -> unit + val boot : Stdlib.value -> unit (** [boot time_acceleration] *) - val commands : pprz_t array -> unit - (** Called once at init *) + val commands : pprz_t array -> unit + (** Called once at init *) - val infrared_and_airspeed : float -> float -> float -> float -> unit - (** [infrared ir_left ir_front ir_top air_speed] Called on timer *) + val infrared_and_airspeed : float -> float -> float -> float -> unit + (** [infrared ir_left ir_front ir_top air_speed] Called on timer *) - val attitude_and_rates : float -> float -> float -> float -> float -> float ->unit + val attitude_and_rates : float -> float -> float -> float -> float -> float ->unit (** [ahrs phi theta psi p q r] Called on timer *) - val gps : Gps.state -> unit - (** [gps state] Called on timer *) - end + val gps : Gps.state -> unit + (** [gps state] Called on timer *) +end module type AIRCRAFT_ITL = - functor (A : Data.MISSION) -> functor (FM: FlightModel.SIG) -> AIRCRAFT + functor (A : Data.MISSION) -> functor (FM: FlightModel.SIG) -> AIRCRAFT external fg_sizeof : unit -> int = "fg_sizeof" external fg_msg : string -> float -> float -> float -> float -> float -> float -> unit = "fg_msg_bytecode" "fg_msg_native" @@ -118,9 +118,9 @@ module Make(AircraftItl : AIRCRAFT_ITL) = struct let ground_alt = Srtm.add_path (Env.paparazzi_home ^ "/data/srtm"); try - float (Srtm.of_wgs84 !pos0) + float (Srtm.of_wgs84 !pos0) with Srtm.Tile_not_found x -> - float_attrib flight_plan "ground_alt" in + float_attrib flight_plan "ground_alt" in ref ground_alt let main () = @@ -171,18 +171,18 @@ module Make(AircraftItl : AIRCRAFT_ITL) = struct let ask_for_world_env = fun () -> try - let (x, y, z) = FlightModel.get_xyz !state in + let (x, y, z) = FlightModel.get_xyz !state in - let gps_sol = compute_gps_state (x,y,z) (FlightModel.get_time !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); - "long", float ((Rad>>Deg)gps_sol.Gps.wgs84.posn_long); - "alt", float gps_sol.Gps.alt ] in - Ground_Pprz.message_req "sim" "WORLD_ENV" values world_update + 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); + "long", float ((Rad>>Deg)gps_sol.Gps.wgs84.posn_long); + "alt", float gps_sol.Gps.alt ] in + Ground_Pprz.message_req "sim" "WORLD_ENV" values world_update with - exc -> fprintf stderr "Error in sim: %s\n%!" (Printexc.to_string exc) + exc -> fprintf stderr "Error in sim: %s\n%!" (Printexc.to_string exc) in ignore (GMain.Timeout.add 1000 (fun () -> ask_for_world_env (); true)); @@ -191,15 +191,15 @@ module Make(AircraftItl : AIRCRAFT_ITL) = struct let fm_task = fun () -> FM.do_commands !state commands; let agl = - if !noground then max_float - else - match !last_gps_state with - Some s -> - begin - try s.Gps.alt -. float (Srtm.of_wgs84 s.Gps.wgs84) with - _ -> s.Gps.alt - end - | None -> 0. in + if !noground then max_float + else + match !last_gps_state with + Some s -> + begin + try s.Gps.alt -. float (Srtm.of_wgs84 s.Gps.wgs84) with + _ -> s.Gps.alt + end + | None -> 0. in FM.state_update !state FM.nominal_airspeed (!wind_x, !wind_y, !wind_z) agl fm_period and ir_task = fun () -> @@ -231,33 +231,33 @@ module Make(AircraftItl : AIRCRAFT_ITL) = struct (** Sending to Flight Gear *) let fg_task = fun socket buffer () -> match !last_gps_state with - None -> () - | Some s -> - let lat = s.Gps.wgs84.Latlong.posn_lat - and lon = s.Gps.wgs84.Latlong.posn_long - and alt = s.Gps.alt -(* and theta_ = s.Gps.course *) - and (phi, theta, psi) = FlightModel.get_attitude !state in - fg_msg buffer lat lon alt phi theta psi; -(** for i = 0 to String.length buffer - 1 do fprintf stderr "%x " (Char.code buffer.[i]) done; fprintf stderr "\n"; **) - try - ignore (Unix.send socket buffer 0 (String.length buffer) []) - with - Unix.Unix_error (e,f,a) -> Printf.fprintf stderr "Error fg: %s (%s(%s))\n" (Unix.error_message e) f a + None -> () + | Some s -> + let lat = s.Gps.wgs84.Latlong.posn_lat + and lon = s.Gps.wgs84.Latlong.posn_long + and alt = s.Gps.alt + (* and theta_ = s.Gps.course *) + and (phi, theta, psi) = FlightModel.get_attitude !state in + fg_msg buffer lat lon alt phi theta psi; + (** for i = 0 to String.length buffer - 1 do fprintf stderr "%x " (Char.code buffer.[i]) done; fprintf stderr "\n"; **) + try + ignore (Unix.send socket buffer 0 (String.length buffer) []) + with + Unix.Unix_error (e,f,a) -> Printf.fprintf stderr "Error fg: %s (%s(%s))\n" (Unix.error_message e) f a in let set_pos = fun _ -> let current_pos = Latlong.string_of !pos0 in begin - match GToolbox.input_string ~title:"Setting geographic position" ~text:current_pos "Geographic position" with - Some s -> pos0 := Latlong.of_string s - | _ -> () + match GToolbox.input_string ~title:"Setting geographic position" ~text:current_pos "Geographic position" with + Some s -> pos0 := Latlong.of_string s + | _ -> () end; begin - let text = string_of_float !alt0 in - match GToolbox.input_string ~title:"Setting initial altitude" ~text "Geographic altitude" with - Some s -> alt0 := float_of_string s - | _ -> () + let text = string_of_float !alt0 in + match GToolbox.input_string ~title:"Setting initial altitude" ~text "Geographic altitude" with + Some s -> alt0 := float_of_string s + | _ -> () end in @@ -270,14 +270,14 @@ module Make(AircraftItl : AIRCRAFT_ITL) = struct (** Connection to Flight Gear client *) if !fg_client <> "" then - try - let inet_addr = Unix.inet_addr_of_string !fg_client in - let socket = Unix.socket Unix.PF_INET Unix.SOCK_DGRAM 0 in - Unix.connect socket (Unix.ADDR_INET (inet_addr, 5501)); - let buffer = String.create (fg_sizeof ()) in - Stdlib.timer ~scale:time_scale fg_period (fg_task socket buffer) - with - e -> fprintf stderr "Error while connecting to fg: %s" (Printexc.to_string e) + try + let inet_addr = Unix.inet_addr_of_string !fg_client in + let socket = Unix.socket Unix.PF_INET Unix.SOCK_DGRAM 0 in + Unix.connect socket (Unix.ADDR_INET (inet_addr, 5501)); + let buffer = String.create (fg_sizeof ()) in + Stdlib.timer ~scale:time_scale fg_period (fg_task socket buffer) + 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 @@ -295,8 +295,8 @@ module Make(AircraftItl : AIRCRAFT_ITL) = struct if not !autoboot then begin let s = GButton.button ~label:"Boot" ~packing:(hbox#pack) () in let callback = fun () -> - set_pos_and_boot (); - s#misc#set_sensitive false in + set_pos_and_boot (); + s#misc#set_sensitive false in ignore (s#connect#clicked ~callback) end else set_pos_and_boot (); @@ -304,17 +304,17 @@ module Make(AircraftItl : AIRCRAFT_ITL) = struct if not !autolaunch then begin let t = GButton.button ~label:"Launch" ~packing:hbox#pack () in let callback = fun () -> - take_off (); - t#misc#set_sensitive false in + take_off (); + t#misc#set_sensitive false in ignore (t#connect#clicked ~callback); (* Monitor an AUTO2 launch to disable the button *) let monitor = fun () -> - if FlightModel.get_air_speed !state > 0. then begin - t#misc#set_sensitive false; - false - end else - true in + if FlightModel.get_air_speed !state > 0. then begin + t#misc#set_sensitive false; + false + end else + true in ignore (GMain.Timeout.add 1000 monitor) end else take_off (); diff --git a/sw/tools/gen_settings.ml b/sw/tools/gen_settings.ml index 8d2042dc9e..d722e01f0a 100644 --- a/sw/tools/gen_settings.ml +++ b/sw/tools/gen_settings.ml @@ -59,7 +59,7 @@ let print_dl_settings = fun settings -> List.iter (fun s -> try - modules := StringSet.add (ExtXml.attrib s "module") !modules + modules := StringSet.add (ExtXml.attrib s "module") !modules with ExtXml.Error e -> () ) settings; @@ -78,15 +78,15 @@ let print_dl_settings = fun settings -> List.iter (fun s -> let v = ExtXml.attrib s "var" in - begin - try - let h = ExtXml.attrib s "handler" and - m = ExtXml.attrib s "module" in - lprintf "case %d: %s_%s( _value ); _value = %s; break;\\\n" !idx (Filename.basename m) h v - with - ExtXml.Error e -> lprintf "case %d: %s = _value; break;\\\n" !idx v - end; - incr idx + begin + try + let h = ExtXml.attrib s "handler" and + m = ExtXml.attrib s "module" in + lprintf "case %d: %s_%s( _value ); _value = %s; break;\\\n" !idx (Filename.basename m) h v + with + ExtXml.Error e -> lprintf "case %d: %s = _value; break;\\\n" !idx v + end; + incr idx ) settings; lprintf "default: break;\\\n"; @@ -108,8 +108,8 @@ let print_dl_settings = fun settings -> right (); List.iter (fun s -> - let v = ExtXml.attrib s "var" in - lprintf "case %d: var = %s; break;\\\n" !idx v; incr idx) + let v = ExtXml.attrib s "var" in + lprintf "case %d: var = %s; break;\\\n" !idx v; incr idx) settings; lprintf "default: var = 0.; break;\\\n"; left (); @@ -177,13 +177,13 @@ let print_persistent_settings = fun settings -> (fun s -> let v = ExtXml.attrib s "var" in begin - try - let h = ExtXml.attrib s "handler" and - m = ExtXml.attrib s "module" in - lprintf "%s_%s( pers_settings.s_%d );\n" (Filename.basename m) h !idx ; -(* lprintf "%s = pers_settings.s_%d;\n" v !idx *) (* do we want to set the value too or just call the handler ? *) - with - ExtXml.Error e -> lprintf "%s = pers_settings.s_%d;\n" v !idx + try + let h = ExtXml.attrib s "handler" and + m = ExtXml.attrib s "module" in + lprintf "%s_%s( pers_settings.s_%d );\n" (Filename.basename m) h !idx ; + (* lprintf "%s = pers_settings.s_%d;\n" v !idx *) (* do we want to set the value too or just call the handler ? *) + with + ExtXml.Error e -> lprintf "%s = pers_settings.s_%d;\n" v !idx end; incr idx) pers_settings; @@ -252,7 +252,7 @@ let join_xml_files = fun xml_files -> let xml = Xml.parse_file xml_file in let these_rc_settings = try Xml.children (ExtXml.child xml "rc_settings") with - Not_found -> [] in + Not_found -> [] in let these_dl_settings = try Xml.children (ExtXml.child xml "dl_settings") with Not_found -> [] in