diff --git a/Makefile b/Makefile index e61763d022..3f979175ee 100644 --- a/Makefile +++ b/Makefile @@ -243,7 +243,6 @@ clean: $(Q)make -C sw/ext clean $(Q)find . -name '*~' -exec rm -f {} \; $(Q)rm -f paparazzi sw/simulator/launchsitl - $(Q)rm -rf tests/results/* cleanspaces: find ./sw/airborne -name '*.[ch]' -exec sed -i {} -e 's/[ \t]*$$//' \; @@ -279,8 +278,5 @@ sw/simulator/launchsitl: chmod a+x $@ test: all replace_current_conf_xml - cd tests; $(MAKE) $(@) - -test_all_example_airframes: replace_current_conf_xml - cd tests; $(MAKE) $(@) TARGET_BOARD=examples + cd tests; $(MAKE) test diff --git a/Makefile.ac b/Makefile.ac index 3d04b1aa22..35c980c5cf 100644 --- a/Makefile.ac +++ b/Makefile.ac @@ -38,7 +38,7 @@ PERIODIC_FREQ = 60 endif AIRFRAME_H=$(AC_GENERATED)/airframe.h -PERIODIC_H=$(AC_GENERATED)/periodic.h +PERIODIC_H=$(AC_GENERATED)/periodic_telemetry.h RADIO_H=$(AC_GENERATED)/radio.h FLIGHT_PLAN_H=$(AC_GENERATED)/flight_plan.h FLIGHT_PLAN_XML=$(ACINCLUDE)/flight_plan.xml @@ -46,6 +46,7 @@ SETTINGS_H=$(AC_GENERATED)/settings.h SETTINGS_XMLS=$(patsubst %,$(CONF)/%,$(SETTINGS)) SETTINGS_XML=$(ACINCLUDE)/settings.xml SETTINGS_MODULES=$(ACINCLUDE)/settings_modules.xml +SETTINGS_TELEMETRY=$(ACINCLUDE)/settings_telemetry.xml MAKEFILE_AC=$(ACINCLUDE)/Makefile.ac SETTINGS_FILE=$(SETTINGS:settings%=%) #TUNING_FILE=$(subst ,_,$(SETTINGS:settings/%.xml=%)).h @@ -99,7 +100,7 @@ $(RADIO_H) : $(CONF)/$(RADIO) $(CONF_XML) $(TOOLS)/gen_radio.out $(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)$(TOOLS)/gen_periodic.out $(CONF)/$(AIRFRAME_XML) $(MESSAGES_XML) $(CONF)/$(TELEMETRY) $(PERIODIC_FREQ) $(SETTINGS_TELEMETRY) > $@ $(Q)chmod a+r $@ $(Q)cp $< $(AIRCRAFT_CONF_DIR) $(Q)cp $(CONF)/$(TELEMETRY) $(AIRCRAFT_CONF_DIR)/telemetry @@ -117,10 +118,10 @@ $(FLIGHT_PLAN_XML) : $(CONF)/$(FLIGHT_PLAN) $(CONF_XML) $(TOOLS)/gen_flight_plan $(Q)$(TOOLS)/gen_flight_plan.out -dump $< > $@ $(Q)chmod a+r $@ -$(SETTINGS_H) : $(SETTINGS_XMLS) $(CONF_XML) $(SETTINGS_MODULES) $(TOOLS)/gen_settings.out +$(SETTINGS_H) : $(SETTINGS_XMLS) $(CONF_XML) $(SETTINGS_MODULES) $(SETTINGS_TELEMETRY) $(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)$(TOOLS)/gen_settings.out $(SETTINGS_XML) $(SETTINGS_XMLS) $(SETTINGS_MODULES) $(SETTINGS_TELEMETRY) > $@ $(Q)chmod a+r $@ $(Q)cp $(SETTINGS_XMLS) $(AIRCRAFT_CONF_DIR)/settings @@ -136,6 +137,7 @@ $(MODULES_H) : $(CONF)/$(AIRFRAME_XML) $(TOOLS)/gen_modules.out $(CONF)/modules/ $(Q)chmod a+r $@ $(SETTINGS_MODULES) : $(MODULES_H) +$(SETTINGS_TELEMETRY) : $(PERIODIC_H) %.ac_h : $(TOOLS)/gen_aircraft.out $(Q)if (expr "$(AIRCRAFT)"); then : ; else echo "AIRCRAFT undefined: type 'make AIRCRAFT=AircraftName ...'"; exit 1; fi diff --git a/conf/airframes/CDW/ChimuLisaFw.xml b/conf/airframes/CDW/ChimuLisaFw.xml index 49bb81b77a..c41fbb30a9 100644 --- a/conf/airframes/CDW/ChimuLisaFw.xml +++ b/conf/airframes/CDW/ChimuLisaFw.xml @@ -66,7 +66,7 @@
- + @@ -77,7 +77,7 @@ - + @@ -85,21 +85,21 @@
- + - + - - + +
diff --git a/conf/airframes/CDW/ChimuTinyFw.xml b/conf/airframes/CDW/ChimuTinyFw.xml index 8bb3dc7a19..75af2eac19 100644 --- a/conf/airframes/CDW/ChimuTinyFw.xml +++ b/conf/airframes/CDW/ChimuTinyFw.xml @@ -90,7 +90,7 @@
- + @@ -101,7 +101,7 @@ - + @@ -109,7 +109,7 @@
- + @@ -117,13 +117,13 @@ - + - - + +
diff --git a/conf/airframes/CDW/ChimuTinyFwSpi.xml b/conf/airframes/CDW/ChimuTinyFwSpi.xml index 530b6bc7f4..fd896e3c2a 100644 --- a/conf/airframes/CDW/ChimuTinyFwSpi.xml +++ b/conf/airframes/CDW/ChimuTinyFwSpi.xml @@ -90,7 +90,7 @@
- + @@ -101,7 +101,7 @@ - + @@ -109,7 +109,7 @@
- + @@ -117,13 +117,13 @@ - + - - + +
diff --git a/conf/airframes/CDW/debug_i2c.xml b/conf/airframes/CDW/debug_i2c.xml index 896a7c8eaa..8405c3add6 100644 --- a/conf/airframes/CDW/debug_i2c.xml +++ b/conf/airframes/CDW/debug_i2c.xml @@ -84,9 +84,9 @@ - - - + + +
@@ -115,17 +115,17 @@ - - - + + + - - - + + + - - - + + + @@ -172,12 +172,12 @@ - - + + @@ -189,10 +189,10 @@
- - - - + + + +
diff --git a/conf/airframes/ENAC/fixed-wing/firestorm.xml b/conf/airframes/ENAC/fixed-wing/firestorm.xml index c281de4dc1..8f1f2e60a9 100644 --- a/conf/airframes/ENAC/fixed-wing/firestorm.xml +++ b/conf/airframes/ENAC/fixed-wing/firestorm.xml @@ -149,7 +149,7 @@ - + @@ -160,12 +160,12 @@ - + - + @@ -175,23 +175,23 @@
- + - + - - + + - - + +
diff --git a/conf/airframes/ENAC/fixed-wing/funjet2.xml b/conf/airframes/ENAC/fixed-wing/funjet2.xml index 40ed286e60..fc1eea3acf 100644 --- a/conf/airframes/ENAC/fixed-wing/funjet2.xml +++ b/conf/airframes/ENAC/fixed-wing/funjet2.xml @@ -144,7 +144,7 @@
- + @@ -155,12 +155,12 @@ - + - + @@ -170,15 +170,15 @@
- + - - + + - + diff --git a/conf/airframes/ENAC/fixed-wing/funjet2_nc.xml b/conf/airframes/ENAC/fixed-wing/funjet2_nc.xml index c37c57e674..b81515dc1d 100644 --- a/conf/airframes/ENAC/fixed-wing/funjet2_nc.xml +++ b/conf/airframes/ENAC/fixed-wing/funjet2_nc.xml @@ -149,7 +149,7 @@
- + @@ -160,14 +160,14 @@ - + - - - + + + @@ -190,20 +190,20 @@
- + - - - - - + + + + + - + - + diff --git a/conf/airframes/ENAC/fixed-wing/funjet2_new.xml b/conf/airframes/ENAC/fixed-wing/funjet2_new.xml index 1b8c04bc0d..34c951909d 100644 --- a/conf/airframes/ENAC/fixed-wing/funjet2_new.xml +++ b/conf/airframes/ENAC/fixed-wing/funjet2_new.xml @@ -149,7 +149,7 @@
- + @@ -160,14 +160,14 @@ - - + + - - - + + + @@ -190,20 +190,20 @@
- + - - - + + + - - - + + + diff --git a/conf/airframes/ENAC/fixed-wing/funjet3.xml b/conf/airframes/ENAC/fixed-wing/funjet3.xml index 7994869e47..4474096979 100644 --- a/conf/airframes/ENAC/fixed-wing/funjet3.xml +++ b/conf/airframes/ENAC/fixed-wing/funjet3.xml @@ -120,7 +120,7 @@
- + @@ -133,15 +133,15 @@ - - - + + + - - - + + + @@ -167,20 +167,20 @@
- + - - - + + + - + - + diff --git a/conf/airframes/ENAC/fixed-wing/merlin.xml b/conf/airframes/ENAC/fixed-wing/merlin.xml index aff770ec3b..42b93e31db 100644 --- a/conf/airframes/ENAC/fixed-wing/merlin.xml +++ b/conf/airframes/ENAC/fixed-wing/merlin.xml @@ -119,7 +119,7 @@
- + @@ -130,14 +130,14 @@ - + - - - + + + @@ -151,20 +151,20 @@
- + - - - - - + + + + + - + - + diff --git a/conf/airframes/ENAC/fixed-wing/minimag1.xml b/conf/airframes/ENAC/fixed-wing/minimag1.xml index 98be9ac59d..a416db1dc2 100644 --- a/conf/airframes/ENAC/fixed-wing/minimag1.xml +++ b/conf/airframes/ENAC/fixed-wing/minimag1.xml @@ -131,7 +131,7 @@
- + @@ -142,12 +142,12 @@ - + - + @@ -156,7 +156,7 @@
- + @@ -164,7 +164,7 @@ - +
diff --git a/conf/airframes/ENAC/fixed-wing/obsolete/drops.xml b/conf/airframes/ENAC/fixed-wing/obsolete/drops.xml index d31460909d..558226830c 100644 --- a/conf/airframes/ENAC/fixed-wing/obsolete/drops.xml +++ b/conf/airframes/ENAC/fixed-wing/obsolete/drops.xml @@ -132,7 +132,7 @@ on - + @@ -143,12 +143,12 @@ on - + - + @@ -158,23 +158,23 @@ on
- + - - + + - - + + - +
diff --git a/conf/airframes/ENAC/fixed-wing/obsolete/funjet1.xml b/conf/airframes/ENAC/fixed-wing/obsolete/funjet1.xml index 6b13ce095a..8d1e2ca662 100644 --- a/conf/airframes/ENAC/fixed-wing/obsolete/funjet1.xml +++ b/conf/airframes/ENAC/fixed-wing/obsolete/funjet1.xml @@ -115,7 +115,7 @@ - + @@ -126,12 +126,12 @@ - + - + @@ -142,23 +142,23 @@
- + - + - - + + - - + +
diff --git a/conf/airframes/ENAC/fixed-wing/obsolete/malolo_sim.xml b/conf/airframes/ENAC/fixed-wing/obsolete/malolo_sim.xml index f85500fd6a..daddc4fc3a 100644 --- a/conf/airframes/ENAC/fixed-wing/obsolete/malolo_sim.xml +++ b/conf/airframes/ENAC/fixed-wing/obsolete/malolo_sim.xml @@ -113,7 +113,7 @@ - + @@ -124,12 +124,12 @@ - + - + @@ -139,23 +139,23 @@
- + - + - + - +
diff --git a/conf/airframes/ENAC/fixed-wing/obsolete/slayer2.xml b/conf/airframes/ENAC/fixed-wing/obsolete/slayer2.xml index 05f6d33121..454e24bb65 100644 --- a/conf/airframes/ENAC/fixed-wing/obsolete/slayer2.xml +++ b/conf/airframes/ENAC/fixed-wing/obsolete/slayer2.xml @@ -113,7 +113,7 @@
- + @@ -124,13 +124,13 @@ - + - + @@ -140,21 +140,21 @@
- + - + - - + +
diff --git a/conf/airframes/ENAC/fixed-wing/obsolete/solarstorm.xml b/conf/airframes/ENAC/fixed-wing/obsolete/solarstorm.xml index 2db888b270..cf30dd8658 100644 --- a/conf/airframes/ENAC/fixed-wing/obsolete/solarstorm.xml +++ b/conf/airframes/ENAC/fixed-wing/obsolete/solarstorm.xml @@ -118,7 +118,7 @@ - + @@ -129,12 +129,12 @@ - + - + @@ -144,29 +144,29 @@
- + - + - - + + - - + +
- +
diff --git a/conf/airframes/ENAC/fixed-wing/obsolete/spocII.xml b/conf/airframes/ENAC/fixed-wing/obsolete/spocII.xml index dccb44c269..a36cb2fa2f 100644 --- a/conf/airframes/ENAC/fixed-wing/obsolete/spocII.xml +++ b/conf/airframes/ENAC/fixed-wing/obsolete/spocII.xml @@ -120,7 +120,7 @@ - + @@ -131,12 +131,12 @@ - + - + @@ -146,23 +146,23 @@
- + - + - - + + - - + +
diff --git a/conf/airframes/ENAC/fixed-wing/overview.xml b/conf/airframes/ENAC/fixed-wing/overview.xml index eb26eb4613..d98916856e 100644 --- a/conf/airframes/ENAC/fixed-wing/overview.xml +++ b/conf/airframes/ENAC/fixed-wing/overview.xml @@ -119,7 +119,7 @@
- + @@ -130,12 +130,12 @@ - + - + @@ -145,15 +145,15 @@
- + - - + + - + diff --git a/conf/airframes/ENAC/fixed-wing/soarzi.xml b/conf/airframes/ENAC/fixed-wing/soarzi.xml index fc8011f4aa..9766aaf447 100644 --- a/conf/airframes/ENAC/fixed-wing/soarzi.xml +++ b/conf/airframes/ENAC/fixed-wing/soarzi.xml @@ -110,7 +110,7 @@ - + @@ -121,12 +121,12 @@ - + - + @@ -136,7 +136,7 @@
- + @@ -144,7 +144,7 @@ - + diff --git a/conf/airframes/ENAC/fixed-wing/spocIII-1.xml b/conf/airframes/ENAC/fixed-wing/spocIII-1.xml index 30477c3b21..5feea6c8a7 100644 --- a/conf/airframes/ENAC/fixed-wing/spocIII-1.xml +++ b/conf/airframes/ENAC/fixed-wing/spocIII-1.xml @@ -121,7 +121,7 @@ - + @@ -132,12 +132,12 @@ - + - + @@ -147,23 +147,23 @@
- + - + - - + + - - + +
diff --git a/conf/airframes/ENAC/fixed-wing/spocIII-2.xml b/conf/airframes/ENAC/fixed-wing/spocIII-2.xml index 8ca2f3ebe7..872c679760 100644 --- a/conf/airframes/ENAC/fixed-wing/spocIII-2.xml +++ b/conf/airframes/ENAC/fixed-wing/spocIII-2.xml @@ -124,7 +124,7 @@
- + @@ -139,15 +139,15 @@ - - - + + + - - - + + + @@ -174,21 +174,21 @@
- + - - - + + + - - - + + + diff --git a/conf/airframes/ENAC/fixed-wing/spocIII-3.xml b/conf/airframes/ENAC/fixed-wing/spocIII-3.xml index 631d75a1f0..61c1e445c5 100644 --- a/conf/airframes/ENAC/fixed-wing/spocIII-3.xml +++ b/conf/airframes/ENAC/fixed-wing/spocIII-3.xml @@ -127,7 +127,7 @@
- + @@ -142,15 +142,15 @@ - - - + + + - - - + + + @@ -177,21 +177,21 @@
- + - - - + + + - - - + + + diff --git a/conf/airframes/ENAC/fixed-wing/twinjet2.xml b/conf/airframes/ENAC/fixed-wing/twinjet2.xml index 7ae81eb513..6e6449025c 100644 --- a/conf/airframes/ENAC/fixed-wing/twinjet2.xml +++ b/conf/airframes/ENAC/fixed-wing/twinjet2.xml @@ -131,7 +131,7 @@ - + @@ -142,15 +142,15 @@ - - - + + + - - - + + + @@ -164,21 +164,21 @@
- + - + - - - + + + - - - + + + diff --git a/conf/airframes/ENAC/fixed-wing/weasel.xml b/conf/airframes/ENAC/fixed-wing/weasel.xml index 655d81553d..6fc2dbab9d 100644 --- a/conf/airframes/ENAC/fixed-wing/weasel.xml +++ b/conf/airframes/ENAC/fixed-wing/weasel.xml @@ -144,7 +144,7 @@
- + @@ -157,15 +157,15 @@ - - - + + + - - - + + + @@ -191,20 +191,20 @@
- + - - - + + + - + - + diff --git a/conf/airframes/ENAC/quadrotor/blender.xml b/conf/airframes/ENAC/quadrotor/blender.xml index d7e52bbdf9..e8401c7ef6 100644 --- a/conf/airframes/ENAC/quadrotor/blender.xml +++ b/conf/airframes/ENAC/quadrotor/blender.xml @@ -130,9 +130,9 @@ - - - + + +
@@ -161,17 +161,17 @@ - - - + + + - - - + + + - - - + + + @@ -196,8 +196,8 @@ - - + + @@ -206,10 +206,10 @@
- - - - + + + +
diff --git a/conf/airframes/ENAC/quadrotor/booz2_g1.xml b/conf/airframes/ENAC/quadrotor/booz2_g1.xml index 3232d17180..2c55323d36 100644 --- a/conf/airframes/ENAC/quadrotor/booz2_g1.xml +++ b/conf/airframes/ENAC/quadrotor/booz2_g1.xml @@ -105,9 +105,9 @@ - - - + + +
@@ -136,17 +136,17 @@ - - - + + + - - - + + + - - - + + + @@ -170,8 +170,8 @@ - - + + @@ -182,10 +182,10 @@
- - - - + + + +
diff --git a/conf/airframes/ENAC/quadrotor/g1_vision.xml b/conf/airframes/ENAC/quadrotor/g1_vision.xml index b346f87f90..1a9fd10b02 100644 --- a/conf/airframes/ENAC/quadrotor/g1_vision.xml +++ b/conf/airframes/ENAC/quadrotor/g1_vision.xml @@ -79,9 +79,9 @@ - - - + + +
@@ -110,17 +110,17 @@ - - - + + + - - - + + + - - - + + + @@ -152,8 +152,8 @@ - - + + @@ -164,10 +164,10 @@
- - - - + + + +
diff --git a/conf/airframes/ENAC/quadrotor/mkk1-vision.xml b/conf/airframes/ENAC/quadrotor/mkk1-vision.xml index d67ba5f0be..653ae0fafe 100644 --- a/conf/airframes/ENAC/quadrotor/mkk1-vision.xml +++ b/conf/airframes/ENAC/quadrotor/mkk1-vision.xml @@ -99,9 +99,9 @@ - - - + + +
@@ -111,9 +111,9 @@ - - - + + +
@@ -143,17 +143,17 @@ - - - + + + - - - + + + - - - + + + @@ -186,8 +186,8 @@ - - + + @@ -197,10 +197,10 @@
- - - - + + + +
diff --git a/conf/airframes/ENAC/quadrotor/mkk1.xml b/conf/airframes/ENAC/quadrotor/mkk1.xml index 5ea9bfa549..752a5d2aa5 100644 --- a/conf/airframes/ENAC/quadrotor/mkk1.xml +++ b/conf/airframes/ENAC/quadrotor/mkk1.xml @@ -129,9 +129,9 @@ - - - + + +
@@ -141,9 +141,9 @@ - - - + + +
@@ -173,17 +173,17 @@ - - - + + + - - - + + + - - - + + + @@ -206,8 +206,8 @@ - - + + @@ -217,10 +217,10 @@
- - - - + + + +
diff --git a/conf/airframes/ENAC/quadrotor/navgo.xml b/conf/airframes/ENAC/quadrotor/navgo.xml index e9ae9e1699..1a4ac65bc3 100644 --- a/conf/airframes/ENAC/quadrotor/navgo.xml +++ b/conf/airframes/ENAC/quadrotor/navgo.xml @@ -125,9 +125,9 @@ - - - + + +
@@ -156,17 +156,17 @@ - - - + + + - - - + + + - - - + + + @@ -186,8 +186,8 @@ - - + + @@ -196,10 +196,10 @@
- - - - + + + +
diff --git a/conf/airframes/ENAC/quadrotor/nova1.xml b/conf/airframes/ENAC/quadrotor/nova1.xml index 545c1038e8..6b7a49cf36 100644 --- a/conf/airframes/ENAC/quadrotor/nova1.xml +++ b/conf/airframes/ENAC/quadrotor/nova1.xml @@ -100,9 +100,9 @@ - - - + + +
@@ -112,9 +112,9 @@ - - - + + +
@@ -144,17 +144,17 @@ - - - + + + - - - + + + - - - + + + @@ -177,8 +177,8 @@ - - + + @@ -188,10 +188,10 @@
- - - - + + + +
diff --git a/conf/airframes/LAAS/mmlaas_N1.xml b/conf/airframes/LAAS/mmlaas_N1.xml index 795c167978..d56a35d931 100644 --- a/conf/airframes/LAAS/mmlaas_N1.xml +++ b/conf/airframes/LAAS/mmlaas_N1.xml @@ -140,7 +140,7 @@ - + @@ -151,12 +151,12 @@ - + - + @@ -166,15 +166,15 @@
- + - + - +
@@ -182,7 +182,7 @@
- +
diff --git a/conf/airframes/LAAS/mmlaas_N2.xml b/conf/airframes/LAAS/mmlaas_N2.xml index d2804f4425..d5f35f384d 100644 --- a/conf/airframes/LAAS/mmlaas_N2.xml +++ b/conf/airframes/LAAS/mmlaas_N2.xml @@ -136,7 +136,7 @@ - + @@ -147,12 +147,12 @@ - + - + @@ -162,15 +162,15 @@
- + - + - +
@@ -178,7 +178,7 @@
- +
diff --git a/conf/airframes/LAAS/mmlaas_N3.xml b/conf/airframes/LAAS/mmlaas_N3.xml index 4c3654119e..8eb4d5dde1 100644 --- a/conf/airframes/LAAS/mmlaas_N3.xml +++ b/conf/airframes/LAAS/mmlaas_N3.xml @@ -136,7 +136,7 @@ - + @@ -147,12 +147,12 @@ - + - + @@ -162,15 +162,15 @@
- + - + - +
@@ -178,7 +178,7 @@
- +
diff --git a/conf/airframes/NoVa_L.xml b/conf/airframes/NoVa_L.xml index 6a995299f0..09e9ba1a0e 100644 --- a/conf/airframes/NoVa_L.xml +++ b/conf/airframes/NoVa_L.xml @@ -112,9 +112,9 @@ - - - + + + @@ -143,17 +143,17 @@ - - - + + + - - - + + + - - - + + + @@ -200,12 +200,12 @@ - - + + @@ -217,10 +217,10 @@
- - - - + + + +
diff --git a/conf/airframes/PPZUAV/fixed-wing/ppzimu_tiny.xml b/conf/airframes/PPZUAV/fixed-wing/ppzimu_tiny.xml index b2aa803eda..602b5dd20d 100644 --- a/conf/airframes/PPZUAV/fixed-wing/ppzimu_tiny.xml +++ b/conf/airframes/PPZUAV/fixed-wing/ppzimu_tiny.xml @@ -127,7 +127,7 @@
- + @@ -138,7 +138,7 @@ - + @@ -146,7 +146,7 @@
- + @@ -154,14 +154,14 @@ - + - +
diff --git a/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_asctec_example.xml b/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_asctec_example.xml index 8e8f29094a..039210f933 100644 --- a/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_asctec_example.xml +++ b/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_asctec_example.xml @@ -76,9 +76,9 @@ - - - + + +
@@ -108,30 +108,30 @@ - - - + + + - - - + + + - - - + + + @@ -160,9 +160,9 @@ - - - + + + @@ -171,9 +171,9 @@
- - - + + +
diff --git a/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_mkk_example.xml b/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_mkk_example.xml index 378aa2f8ea..9dcfcbfb62 100644 --- a/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_mkk_example.xml +++ b/conf/airframes/PPZUAV/quadrotor/ppzuav_booz2_mkk_example.xml @@ -76,9 +76,9 @@ - - - + + + @@ -109,31 +109,31 @@ - - - + + + - - - + + + - - - + + + @@ -178,9 +178,9 @@ - - - + + + @@ -189,9 +189,9 @@
- - - + + +
diff --git a/conf/airframes/Poine/booz2_a1.xml b/conf/airframes/Poine/booz2_a1.xml index b65915ef45..4fed1a2abe 100644 --- a/conf/airframes/Poine/booz2_a1.xml +++ b/conf/airframes/Poine/booz2_a1.xml @@ -90,9 +90,9 @@ - - - + + + @@ -122,17 +122,17 @@ - - - + + + - - - + + + - - - + + + @@ -151,9 +151,9 @@ - - - + + + @@ -163,9 +163,9 @@
- - - + + +
diff --git a/conf/airframes/Poine/booz2_a1p.xml b/conf/airframes/Poine/booz2_a1p.xml index 097c2993de..b400829f6e 100644 --- a/conf/airframes/Poine/booz2_a1p.xml +++ b/conf/airframes/Poine/booz2_a1p.xml @@ -88,9 +88,9 @@ - - - + + +
@@ -120,17 +120,17 @@ - - - + + + - - - + + + - - - + + + @@ -155,9 +155,9 @@ - - - + + + @@ -167,9 +167,9 @@
- - - + + +
diff --git a/conf/airframes/Poine/booz2_a7.xml b/conf/airframes/Poine/booz2_a7.xml index 9faac66fac..aee822cb0a 100644 --- a/conf/airframes/Poine/booz2_a7.xml +++ b/conf/airframes/Poine/booz2_a7.xml @@ -84,9 +84,9 @@ - - - + + +
@@ -115,17 +115,17 @@ - - - + + + - - - + + + - - - + + + @@ -172,12 +172,12 @@ - - + + @@ -189,10 +189,10 @@
- - - - + + + +
diff --git a/conf/airframes/Poine/easy_glider1.xml b/conf/airframes/Poine/easy_glider1.xml index 3bd44a7ea7..6c489be107 100644 --- a/conf/airframes/Poine/easy_glider1.xml +++ b/conf/airframes/Poine/easy_glider1.xml @@ -94,7 +94,7 @@ - + @@ -105,7 +105,7 @@ - + @@ -113,21 +113,21 @@
- + - + - - + +
diff --git a/conf/airframes/Poine/funjet42.xml b/conf/airframes/Poine/funjet42.xml index 5d97a1cb11..bd61934340 100644 --- a/conf/airframes/Poine/funjet42.xml +++ b/conf/airframes/Poine/funjet42.xml @@ -118,7 +118,7 @@
- + @@ -127,12 +127,12 @@ - + - + @@ -141,14 +141,14 @@
- + - + diff --git a/conf/airframes/Poine/h_hex.xml b/conf/airframes/Poine/h_hex.xml index df12e1bb22..c6c3678804 100644 --- a/conf/airframes/Poine/h_hex.xml +++ b/conf/airframes/Poine/h_hex.xml @@ -86,9 +86,9 @@ - - - + + +
@@ -117,17 +117,17 @@ - - - + + + - - - + + + - - - + + + @@ -146,9 +146,9 @@ - - - + + + @@ -158,9 +158,9 @@
- - - + + +
diff --git a/conf/airframes/Poine/swift_1.xml b/conf/airframes/Poine/swift_1.xml index 3d34bdc37a..970c7cf8e4 100644 --- a/conf/airframes/Poine/swift_1.xml +++ b/conf/airframes/Poine/swift_1.xml @@ -112,7 +112,7 @@
- + @@ -121,12 +121,12 @@ - + - + @@ -135,14 +135,14 @@
- + - + diff --git a/conf/airframes/TestHardware/LisaL_v1.1_aspirin_v1.5_overo_rc.xml b/conf/airframes/TestHardware/LisaL_v1.1_aspirin_v1.5_overo_rc.xml index fe79b77174..c27f0e6d59 100644 --- a/conf/airframes/TestHardware/LisaL_v1.1_aspirin_v1.5_overo_rc.xml +++ b/conf/airframes/TestHardware/LisaL_v1.1_aspirin_v1.5_overo_rc.xml @@ -4,20 +4,282 @@ Powered via a plug 12V pack Lisa/L v1.1 board XBee connected to UART2 configured at 38400 - Aspirin v1.5 - overo + Booz2 v1.2 + GPS connected to UART1 (Since this is inside in a metal box it won't ever get a solution) --> - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+ + + + +
+ +
+ + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + +
+ + +
+ + + + +
+ +
+ +
+ +
+ + + +
+
diff --git a/conf/airframes/UofAdelaide/A1000_BOOZ.xml b/conf/airframes/UofAdelaide/A1000_BOOZ.xml index a1de5fec40..aab64eeeab 100644 --- a/conf/airframes/UofAdelaide/A1000_BOOZ.xml +++ b/conf/airframes/UofAdelaide/A1000_BOOZ.xml @@ -152,13 +152,13 @@ second attempt - - - + + + - - - + + + @@ -166,9 +166,9 @@ second attempt + + + -->
@@ -196,17 +196,17 @@ second attempt - - - + + + - - - + + + - - - + + + @@ -225,9 +225,9 @@ second attempt - - - + + + @@ -236,9 +236,9 @@ second attempt
- - - + + +
diff --git a/conf/airframes/UofAdelaide/A1000_LISA.xml b/conf/airframes/UofAdelaide/A1000_LISA.xml index 54ab42de05..ebd6bd5bbe 100644 --- a/conf/airframes/UofAdelaide/A1000_LISA.xml +++ b/conf/airframes/UofAdelaide/A1000_LISA.xml @@ -84,9 +84,9 @@ - - - + + +
@@ -115,13 +115,13 @@ + --> - - - + + + - - - + + + - - - + + + @@ -162,9 +162,9 @@ - - - + + + @@ -174,9 +174,9 @@
- - - + + +
diff --git a/conf/airframes/UofAdelaide/A1000_NOVA.xml b/conf/airframes/UofAdelaide/A1000_NOVA.xml index f6da7f4fcc..5bc4f2fbc9 100644 --- a/conf/airframes/UofAdelaide/A1000_NOVA.xml +++ b/conf/airframes/UofAdelaide/A1000_NOVA.xml @@ -79,13 +79,13 @@ - - - + + + - - - + + + @@ -119,30 +119,30 @@ - - - + + + - - - + + + - - - + + + @@ -185,8 +185,8 @@ - - + + @@ -196,11 +196,11 @@
- - - - - + + + + +
diff --git a/conf/airframes/UofAdelaide/booz2_NoVa_001_1000.xml b/conf/airframes/UofAdelaide/booz2_NoVa_001_1000.xml index 550ef036c3..062a08ed32 100644 --- a/conf/airframes/UofAdelaide/booz2_NoVa_001_1000.xml +++ b/conf/airframes/UofAdelaide/booz2_NoVa_001_1000.xml @@ -79,13 +79,13 @@ - - - + + + - - - + + + @@ -119,30 +119,30 @@ - - - + + + - - - + + + - - - + + + @@ -185,8 +185,8 @@ - - + + @@ -196,11 +196,11 @@
- - - - - + + + + +
diff --git a/conf/airframes/UofAdelaide/booz2_a1000.xml b/conf/airframes/UofAdelaide/booz2_a1000.xml index f46a9fbbe9..b42cb89a90 100755 --- a/conf/airframes/UofAdelaide/booz2_a1000.xml +++ b/conf/airframes/UofAdelaide/booz2_a1000.xml @@ -151,13 +151,13 @@ second attempt - - - + + + - - - + + + @@ -165,9 +165,9 @@ second attempt + + + -->
@@ -196,17 +196,17 @@ second attempt - - - + + + - - - + + + - - - + + + @@ -226,9 +226,9 @@ second attempt - - - + + + @@ -238,9 +238,9 @@ second attempt
- - - + + +
diff --git a/conf/airframes/UofAdelaide/lisa_a1000.xml b/conf/airframes/UofAdelaide/lisa_a1000.xml index ac45acf0c9..50be06bc31 100644 --- a/conf/airframes/UofAdelaide/lisa_a1000.xml +++ b/conf/airframes/UofAdelaide/lisa_a1000.xml @@ -81,9 +81,9 @@ - - - + + +
@@ -112,17 +112,17 @@ - - - + + + - - - + + + - - - + + + @@ -141,9 +141,9 @@ - - - + + + @@ -153,9 +153,9 @@
- - - + + +
diff --git a/conf/airframes/booz2_flixr.xml b/conf/airframes/booz2_flixr.xml index 232a49dbb7..3c2805605c 100644 --- a/conf/airframes/booz2_flixr.xml +++ b/conf/airframes/booz2_flixr.xml @@ -127,13 +127,13 @@ - - - + + + - - - + + + @@ -167,17 +167,17 @@ - - - + + + - - - + + + - - - + + + @@ -197,9 +197,9 @@ - - - + + + @@ -208,9 +208,9 @@
- - - + + +
diff --git a/conf/airframes/booz2_ppzuav.xml b/conf/airframes/booz2_ppzuav.xml index 09f4cfc87c..602e744aa7 100644 --- a/conf/airframes/booz2_ppzuav.xml +++ b/conf/airframes/booz2_ppzuav.xml @@ -64,13 +64,13 @@ - - - + + + - - - + + + @@ -104,30 +104,30 @@ - - - + + + - - - + + + - - - + + + @@ -160,8 +160,8 @@ - - + + @@ -171,11 +171,11 @@
- - - - - + + + + +
diff --git a/conf/airframes/delta_wing_minimal_example.xml b/conf/airframes/delta_wing_minimal_example.xml index 866a3f2fd6..e3f3099c32 100644 --- a/conf/airframes/delta_wing_minimal_example.xml +++ b/conf/airframes/delta_wing_minimal_example.xml @@ -57,8 +57,8 @@ - - + +
@@ -100,7 +100,7 @@
- + @@ -109,12 +109,12 @@ - + - + @@ -123,14 +123,14 @@
- + - + diff --git a/conf/airframes/demo_module.xml b/conf/airframes/demo_module.xml index e43fc6cfb6..a4ee7bea79 100644 --- a/conf/airframes/demo_module.xml +++ b/conf/airframes/demo_module.xml @@ -93,7 +93,7 @@
- + @@ -103,12 +103,12 @@ - + - + @@ -116,19 +116,19 @@
- + - + - - + +
diff --git a/conf/airframes/easy_glider_example.xml b/conf/airframes/easy_glider_example.xml index d0b63868ad..ceba4c1e4c 100644 --- a/conf/airframes/easy_glider_example.xml +++ b/conf/airframes/easy_glider_example.xml @@ -7,8 +7,8 @@ - - + + @@ -36,8 +36,8 @@ - - + +
@@ -87,7 +87,7 @@ - + @@ -98,7 +98,7 @@ - + @@ -106,21 +106,21 @@
- + - + - - + +
diff --git a/conf/airframes/easystar_ets_example.xml b/conf/airframes/easystar_ets_example.xml index af8095d052..7dae136c0d 100644 --- a/conf/airframes/easystar_ets_example.xml +++ b/conf/airframes/easystar_ets_example.xml @@ -43,7 +43,7 @@ - + @@ -114,7 +114,7 @@
- + @@ -123,7 +123,7 @@ - + @@ -133,7 +133,7 @@ - + @@ -141,15 +141,15 @@
- + - + - - + +
diff --git a/conf/airframes/easystar_example.xml b/conf/airframes/easystar_example.xml index 7cc5bd6002..337a9c6e5a 100644 --- a/conf/airframes/easystar_example.xml +++ b/conf/airframes/easystar_example.xml @@ -36,7 +36,7 @@ - + @@ -108,7 +108,7 @@
- + @@ -117,10 +117,10 @@ - + - + @@ -128,15 +128,15 @@
- + - + - - + +
diff --git a/conf/airframes/esden/jt_lisam.xml b/conf/airframes/esden/jt_lisam.xml index ea97bc4dfa..86b1693f8a 100644 --- a/conf/airframes/esden/jt_lisam.xml +++ b/conf/airframes/esden/jt_lisam.xml @@ -75,9 +75,9 @@ - - - + + +
@@ -108,17 +108,17 @@ - - - + + + - - - + + + - - - + + + @@ -137,9 +137,9 @@ - - - + + + @@ -157,9 +157,9 @@
- - - + + +
diff --git a/conf/airframes/esden/lisa_asctec.xml b/conf/airframes/esden/lisa_asctec.xml index be0b2d3e07..8c847c59bb 100644 --- a/conf/airframes/esden/lisa_asctec.xml +++ b/conf/airframes/esden/lisa_asctec.xml @@ -91,9 +91,9 @@ - - - + + +
@@ -122,17 +122,17 @@ - - - + + + - - - + + + - - - + + + @@ -151,9 +151,9 @@ - - - + + + @@ -163,9 +163,9 @@
- - - + + +
diff --git a/conf/airframes/esden/lisa_asctec_aspirin.xml b/conf/airframes/esden/lisa_asctec_aspirin.xml index 010fddb963..ae66c2ab02 100644 --- a/conf/airframes/esden/lisa_asctec_aspirin.xml +++ b/conf/airframes/esden/lisa_asctec_aspirin.xml @@ -91,9 +91,9 @@ - - - + + +
@@ -122,17 +122,17 @@ - - - + + + - - - + + + - - - + + + @@ -151,9 +151,9 @@ - - - + + + @@ -163,9 +163,9 @@
- - - + + +
diff --git a/conf/airframes/esden/lisa_m_pwm.xml b/conf/airframes/esden/lisa_m_pwm.xml index 2d927048d0..7d12fe3094 100644 --- a/conf/airframes/esden/lisa_m_pwm.xml +++ b/conf/airframes/esden/lisa_m_pwm.xml @@ -105,9 +105,9 @@ - - - + + +
@@ -136,17 +136,17 @@ - - - + + + - - - + + + - - - + + + @@ -165,9 +165,9 @@ - - - + + + @@ -183,9 +183,9 @@
- - - + + +
diff --git a/conf/airframes/esden/lisa_pwm_aspirin.xml b/conf/airframes/esden/lisa_pwm_aspirin.xml index 214b5a246c..8f1250065d 100644 --- a/conf/airframes/esden/lisa_pwm_aspirin.xml +++ b/conf/airframes/esden/lisa_pwm_aspirin.xml @@ -79,9 +79,9 @@ - - - + + +
@@ -110,17 +110,17 @@ - - - + + + - - - + + + - - - + + + @@ -146,9 +146,9 @@ - - - + + + @@ -158,9 +158,9 @@
- - - + + +
diff --git a/conf/airframes/esden/synerani_4B.xml b/conf/airframes/esden/synerani_4B.xml index 455243644f..fdd7b1a817 100644 --- a/conf/airframes/esden/synerani_4B.xml +++ b/conf/airframes/esden/synerani_4B.xml @@ -82,9 +82,9 @@ - - - + + +
@@ -113,17 +113,17 @@ - - - + + + - - - + + + - - - + + + @@ -149,9 +149,9 @@ - - - + + + @@ -161,9 +161,9 @@
- - - + + +
diff --git a/conf/airframes/example_twog_analogimu.xml b/conf/airframes/example_twog_analogimu.xml index 606c0d78d1..5a67ac371f 100644 --- a/conf/airframes/example_twog_analogimu.xml +++ b/conf/airframes/example_twog_analogimu.xml @@ -15,7 +15,7 @@ - + @@ -117,7 +117,7 @@ - + @@ -128,12 +128,12 @@ - + - + @@ -143,7 +143,7 @@
- + @@ -151,7 +151,7 @@ - + diff --git a/conf/airframes/flixr_discovery.xml b/conf/airframes/flixr_discovery.xml index fd0541916f..9a3adda068 100644 --- a/conf/airframes/flixr_discovery.xml +++ b/conf/airframes/flixr_discovery.xml @@ -80,8 +80,8 @@ http://paparazzi.enac.fr/w/index.php?title=Theory_of_Operation - - + + @@ -120,8 +120,8 @@ http://paparazzi.enac.fr/w/index.php?title=Theory_of_Operation - - + + @@ -251,7 +251,7 @@ http://paparazzi.enac.fr/w/index.php?title=Theory_of_Operation - + @@ -266,18 +266,18 @@ http://paparazzi.enac.fr/w/index.php?title=Theory_of_Operation - - - + + + - - - - + + + + @@ -307,7 +307,7 @@ http://paparazzi.enac.fr/w/index.php?title=Theory_of_Operation
- + @@ -320,11 +320,11 @@ http://paparazzi.enac.fr/w/index.php?title=Theory_of_Operation - - + + - + @@ -332,11 +332,11 @@ http://paparazzi.enac.fr/w/index.php?title=Theory_of_Operation - + - - + + diff --git a/conf/airframes/fraser_lisa_m_rotorcraft.xml b/conf/airframes/fraser_lisa_m_rotorcraft.xml index 26ff8f7cd3..ad20c68d1c 100644 --- a/conf/airframes/fraser_lisa_m_rotorcraft.xml +++ b/conf/airframes/fraser_lisa_m_rotorcraft.xml @@ -128,13 +128,13 @@ - - - + + + - - - + + + @@ -172,22 +172,22 @@ - - - + + + - - - + + + - - - + + + - - - + + +
@@ -196,9 +196,9 @@ - - - + + + @@ -207,9 +207,9 @@
- - - + + +
diff --git a/conf/airframes/funjet_cam_example.xml b/conf/airframes/funjet_cam_example.xml index aa792206d6..d78157b832 100644 --- a/conf/airframes/funjet_cam_example.xml +++ b/conf/airframes/funjet_cam_example.xml @@ -78,8 +78,8 @@ - - + +
@@ -129,7 +129,7 @@
- + @@ -140,12 +140,12 @@ - + - + @@ -154,14 +154,14 @@
- + - + diff --git a/conf/airframes/funjet_example.xml b/conf/airframes/funjet_example.xml index be1f4bee5b..de17994437 100644 --- a/conf/airframes/funjet_example.xml +++ b/conf/airframes/funjet_example.xml @@ -69,8 +69,8 @@ - - + +
@@ -120,7 +120,7 @@
- + @@ -131,12 +131,12 @@ - + - + @@ -145,14 +145,14 @@
- + - + diff --git a/conf/airframes/jsbsim.xml b/conf/airframes/jsbsim.xml index 1706dacc79..afbd4bdac3 100644 --- a/conf/airframes/jsbsim.xml +++ b/conf/airframes/jsbsim.xml @@ -103,7 +103,7 @@ - + @@ -114,12 +114,12 @@ - + - + @@ -129,19 +129,19 @@
- + - + - - + +
diff --git a/conf/airframes/mentor_tum.xml b/conf/airframes/mentor_tum.xml index a1e72b9e4c..b5a39da16a 100644 --- a/conf/airframes/mentor_tum.xml +++ b/conf/airframes/mentor_tum.xml @@ -52,11 +52,11 @@ - + - + @@ -82,8 +82,8 @@ - - + + @@ -142,7 +142,7 @@
- + @@ -153,12 +153,12 @@ - + - + @@ -167,20 +167,20 @@
- + - + - - + +
diff --git a/conf/airframes/microjet_example.xml b/conf/airframes/microjet_example.xml index 9278c83c29..3c8f5b8ef3 100644 --- a/conf/airframes/microjet_example.xml +++ b/conf/airframes/microjet_example.xml @@ -37,8 +37,8 @@ - - + +
@@ -101,7 +101,7 @@
- + @@ -112,7 +112,7 @@ - + @@ -120,22 +120,22 @@
- + - + - - + +
diff --git a/conf/airframes/mm/extra/press_t.xml b/conf/airframes/mm/extra/press_t.xml index 62011a757b..fbc2bf3f31 100644 --- a/conf/airframes/mm/extra/press_t.xml +++ b/conf/airframes/mm/extra/press_t.xml @@ -109,7 +109,7 @@ - + @@ -120,12 +120,12 @@ - + - + @@ -135,20 +135,20 @@
- + - + - +
diff --git a/conf/airframes/mm/extra/probe_t.xml b/conf/airframes/mm/extra/probe_t.xml index 5abe57d195..3a825469f9 100644 --- a/conf/airframes/mm/extra/probe_t.xml +++ b/conf/airframes/mm/extra/probe_t.xml @@ -129,7 +129,7 @@ - + @@ -140,12 +140,12 @@ - + - + @@ -155,20 +155,20 @@
- + - + - +
diff --git a/conf/airframes/mm/extra/turbine_trigger.xml b/conf/airframes/mm/extra/turbine_trigger.xml index d213fd0fdf..962034a273 100644 --- a/conf/airframes/mm/extra/turbine_trigger.xml +++ b/conf/airframes/mm/extra/turbine_trigger.xml @@ -114,7 +114,7 @@
- + @@ -122,10 +122,10 @@ - + - + @@ -133,13 +133,13 @@
- + - +
diff --git a/conf/airframes/mm/fixed-wing/drops.xml b/conf/airframes/mm/fixed-wing/drops.xml index 03dedd2394..fcd566968e 100644 --- a/conf/airframes/mm/fixed-wing/drops.xml +++ b/conf/airframes/mm/fixed-wing/drops.xml @@ -148,7 +148,7 @@ - + @@ -159,12 +159,12 @@ - + - + @@ -174,22 +174,22 @@
- + - - + + - - - + + + diff --git a/conf/airframes/mm/fixed-wing/funjet43.xml b/conf/airframes/mm/fixed-wing/funjet43.xml index af60e2c2c6..ee2a9decbe 100644 --- a/conf/airframes/mm/fixed-wing/funjet43.xml +++ b/conf/airframes/mm/fixed-wing/funjet43.xml @@ -132,7 +132,7 @@
- + @@ -141,14 +141,14 @@ - + - + @@ -157,14 +157,14 @@
- + - + diff --git a/conf/airframes/mm/fixed-wing/funjetdca.xml b/conf/airframes/mm/fixed-wing/funjetdca.xml index a54d336b4d..ecae589dab 100644 --- a/conf/airframes/mm/fixed-wing/funjetdca.xml +++ b/conf/airframes/mm/fixed-wing/funjetdca.xml @@ -142,7 +142,7 @@ - + @@ -153,12 +153,12 @@ - + - + @@ -168,20 +168,20 @@
- + - + - +
diff --git a/conf/airframes/mm/fixed-wing/funjetdcb.xml b/conf/airframes/mm/fixed-wing/funjetdcb.xml index 3b9f7d933b..66bf71f34b 100644 --- a/conf/airframes/mm/fixed-wing/funjetdcb.xml +++ b/conf/airframes/mm/fixed-wing/funjetdcb.xml @@ -142,7 +142,7 @@ - + @@ -153,12 +153,12 @@ - + - + @@ -168,20 +168,20 @@
- + - + - +
diff --git a/conf/airframes/mm/fixed-wing/funjetdcc.xml b/conf/airframes/mm/fixed-wing/funjetdcc.xml index f1c911241d..060a0fe0df 100644 --- a/conf/airframes/mm/fixed-wing/funjetdcc.xml +++ b/conf/airframes/mm/fixed-wing/funjetdcc.xml @@ -142,7 +142,7 @@ - + @@ -153,12 +153,12 @@ - + - + @@ -168,20 +168,20 @@
- + - + - +
diff --git a/conf/airframes/mm/fixed-wing/funjeteth1.xml b/conf/airframes/mm/fixed-wing/funjeteth1.xml index 5aed5f95b8..ce27ab3d70 100644 --- a/conf/airframes/mm/fixed-wing/funjeteth1.xml +++ b/conf/airframes/mm/fixed-wing/funjeteth1.xml @@ -105,7 +105,7 @@ - + @@ -116,12 +116,12 @@ - + - + @@ -131,20 +131,20 @@
- + - + - +
diff --git a/conf/airframes/mm/fixed-wing/funjeteth2.xml b/conf/airframes/mm/fixed-wing/funjeteth2.xml index 696bba2a46..9380acb59c 100644 --- a/conf/airframes/mm/fixed-wing/funjeteth2.xml +++ b/conf/airframes/mm/fixed-wing/funjeteth2.xml @@ -106,7 +106,7 @@ - + @@ -117,12 +117,12 @@ - + - + @@ -132,20 +132,20 @@
- + - + - +
diff --git a/conf/airframes/mm/fixed-wing/funjetfmi1.xml b/conf/airframes/mm/fixed-wing/funjetfmi1.xml index 8dd2155c64..b61c373043 100644 --- a/conf/airframes/mm/fixed-wing/funjetfmi1.xml +++ b/conf/airframes/mm/fixed-wing/funjetfmi1.xml @@ -104,7 +104,7 @@ - + @@ -115,12 +115,12 @@ - + - + @@ -130,20 +130,20 @@
- + - + - +
diff --git a/conf/airframes/mm/fixed-wing/funjetfmi2.xml b/conf/airframes/mm/fixed-wing/funjetfmi2.xml index 14bfe029e2..0f1a1e5497 100644 --- a/conf/airframes/mm/fixed-wing/funjetfmi2.xml +++ b/conf/airframes/mm/fixed-wing/funjetfmi2.xml @@ -103,7 +103,7 @@ - + @@ -114,12 +114,12 @@ - + - + @@ -129,20 +129,20 @@
- + - + - +
diff --git a/conf/airframes/mm/fixed-wing/funjetfmi3.xml b/conf/airframes/mm/fixed-wing/funjetfmi3.xml index 86ff520fa6..c9e1cf65e8 100644 --- a/conf/airframes/mm/fixed-wing/funjetfmi3.xml +++ b/conf/airframes/mm/fixed-wing/funjetfmi3.xml @@ -103,7 +103,7 @@ - + @@ -114,12 +114,12 @@ - + - + @@ -129,20 +129,20 @@
- + - + - +
diff --git a/conf/airframes/mm/fixed-wing/funjetgfi1.xml b/conf/airframes/mm/fixed-wing/funjetgfi1.xml index 57ffd69a91..a889cc65ca 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi1.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi1.xml @@ -102,7 +102,7 @@
- + @@ -113,12 +113,12 @@ - + - + @@ -128,19 +128,19 @@
- + - + - +
diff --git a/conf/airframes/mm/fixed-wing/funjetgfi3.xml b/conf/airframes/mm/fixed-wing/funjetgfi3.xml index 6f8b1cd526..13302fb736 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi3.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi3.xml @@ -101,7 +101,7 @@
- + @@ -112,12 +112,12 @@ - + - + @@ -127,14 +127,14 @@
- + - + diff --git a/conf/airframes/mm/fixed-wing/funjetgfi4.xml b/conf/airframes/mm/fixed-wing/funjetgfi4.xml index c3686fff8e..c1de946238 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi4.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi4.xml @@ -101,7 +101,7 @@ - + @@ -112,12 +112,12 @@ - + - + @@ -127,20 +127,20 @@
- + - + - +
diff --git a/conf/airframes/mm/fixed-wing/funjetgfi5.xml b/conf/airframes/mm/fixed-wing/funjetgfi5.xml index 465e07119b..4fc37cc3b8 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi5.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi5.xml @@ -103,7 +103,7 @@ - + @@ -114,12 +114,12 @@ - + - + @@ -129,20 +129,20 @@
- + - + - +
diff --git a/conf/airframes/mm/fixed-wing/funjetgfi6.xml b/conf/airframes/mm/fixed-wing/funjetgfi6.xml index 1051312984..9df7592ba8 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi6.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi6.xml @@ -103,7 +103,7 @@ - + @@ -114,12 +114,12 @@ - + - + @@ -129,20 +129,20 @@
- + - + - +
diff --git a/conf/airframes/mm/fixed-wing/funjetgfi7.xml b/conf/airframes/mm/fixed-wing/funjetgfi7.xml index 8d44915973..869bb9a981 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi7.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi7.xml @@ -103,7 +103,7 @@ - + @@ -114,12 +114,12 @@ - + - + @@ -129,20 +129,20 @@
- + - + - +
diff --git a/conf/airframes/mm/fixed-wing/funjetgfi8.xml b/conf/airframes/mm/fixed-wing/funjetgfi8.xml index 7a9da170de..57b1e4ede7 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi8.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi8.xml @@ -138,7 +138,7 @@ - + @@ -149,12 +149,12 @@ - + - + @@ -163,14 +163,14 @@
- + - + diff --git a/conf/airframes/mm/fixed-wing/funjetgfi9.xml b/conf/airframes/mm/fixed-wing/funjetgfi9.xml index 0333184611..3fbb93ee36 100644 --- a/conf/airframes/mm/fixed-wing/funjetgfi9.xml +++ b/conf/airframes/mm/fixed-wing/funjetgfi9.xml @@ -103,7 +103,7 @@ - + @@ -114,12 +114,12 @@ - + - + @@ -129,20 +129,20 @@
- + - + - +
diff --git a/conf/airframes/mm/fixed-wing/funjetlisa.xml b/conf/airframes/mm/fixed-wing/funjetlisa.xml index d1367b4bd5..e2386465d9 100644 --- a/conf/airframes/mm/fixed-wing/funjetlisa.xml +++ b/conf/airframes/mm/fixed-wing/funjetlisa.xml @@ -119,7 +119,7 @@
- + @@ -128,12 +128,12 @@ - + - + @@ -142,14 +142,14 @@
- + - + diff --git a/conf/airframes/mm/fixed-wing/funjetlisam.xml b/conf/airframes/mm/fixed-wing/funjetlisam.xml index ddcef511ad..503d2cb20c 100644 --- a/conf/airframes/mm/fixed-wing/funjetlisam.xml +++ b/conf/airframes/mm/fixed-wing/funjetlisam.xml @@ -119,7 +119,7 @@
- + @@ -128,12 +128,12 @@ - + - + @@ -142,14 +142,14 @@
- + - + diff --git a/conf/airframes/mm/fixed-wing/funjetmm.xml b/conf/airframes/mm/fixed-wing/funjetmm.xml index bf03e24173..f7fca1b037 100644 --- a/conf/airframes/mm/fixed-wing/funjetmm.xml +++ b/conf/airframes/mm/fixed-wing/funjetmm.xml @@ -174,7 +174,7 @@ - + @@ -185,12 +185,12 @@ - + - + @@ -200,20 +200,20 @@
- + - + - +
diff --git a/conf/airframes/mm/fixed-wing/funjetmm2.xml b/conf/airframes/mm/fixed-wing/funjetmm2.xml index 19f5f2b100..2e24ad138c 100644 --- a/conf/airframes/mm/fixed-wing/funjetmm2.xml +++ b/conf/airframes/mm/fixed-wing/funjetmm2.xml @@ -109,7 +109,7 @@ - + @@ -120,12 +120,12 @@ - + - + @@ -135,20 +135,20 @@
- + - + - +
diff --git a/conf/airframes/mm/fixed-wing/fw_ins_arduimu.xml b/conf/airframes/mm/fixed-wing/fw_ins_arduimu.xml index 33ab31ed52..8d69163c7b 100644 --- a/conf/airframes/mm/fixed-wing/fw_ins_arduimu.xml +++ b/conf/airframes/mm/fixed-wing/fw_ins_arduimu.xml @@ -134,7 +134,7 @@ - + @@ -145,12 +145,12 @@ - + - + @@ -160,20 +160,20 @@
- + - + - +
diff --git a/conf/airframes/mm/fixed-wing/merlin.xml b/conf/airframes/mm/fixed-wing/merlin.xml index 4a88b9f934..a582746903 100644 --- a/conf/airframes/mm/fixed-wing/merlin.xml +++ b/conf/airframes/mm/fixed-wing/merlin.xml @@ -98,7 +98,7 @@
- + @@ -109,12 +109,12 @@ - + - + @@ -123,20 +123,20 @@
- + - + - +
diff --git a/conf/airframes/mm/fixed-wing/miniwing.xml b/conf/airframes/mm/fixed-wing/miniwing.xml index ee409af625..d877733960 100644 --- a/conf/airframes/mm/fixed-wing/miniwing.xml +++ b/conf/airframes/mm/fixed-wing/miniwing.xml @@ -101,7 +101,7 @@ - + @@ -112,12 +112,12 @@ - + - + @@ -127,20 +127,20 @@
- + - + - +
diff --git a/conf/airframes/mm/fixed-wing/slowfast.xml b/conf/airframes/mm/fixed-wing/slowfast.xml index ec9501ac9c..0b5e9f2acf 100644 --- a/conf/airframes/mm/fixed-wing/slowfast.xml +++ b/conf/airframes/mm/fixed-wing/slowfast.xml @@ -132,7 +132,7 @@ - + @@ -143,12 +143,12 @@ - + - + @@ -158,20 +158,20 @@
- + - + - - + +
diff --git a/conf/airframes/mm/fixed-wing/slowfast2.xml b/conf/airframes/mm/fixed-wing/slowfast2.xml index 1a78cadf50..eb123ba784 100644 --- a/conf/airframes/mm/fixed-wing/slowfast2.xml +++ b/conf/airframes/mm/fixed-wing/slowfast2.xml @@ -138,7 +138,7 @@ - + @@ -149,12 +149,12 @@ - + - + @@ -174,20 +174,20 @@
- + - + - - + +
diff --git a/conf/airframes/mm/fixed-wing/twinstarmm.xml b/conf/airframes/mm/fixed-wing/twinstarmm.xml index df6e4bcf0b..2ec04ed767 100644 --- a/conf/airframes/mm/fixed-wing/twinstarmm.xml +++ b/conf/airframes/mm/fixed-wing/twinstarmm.xml @@ -125,7 +125,7 @@
- + @@ -136,12 +136,12 @@ - + - + @@ -152,20 +152,20 @@
- + - - + + - +
diff --git a/conf/airframes/mm/hangar/black_one.xml b/conf/airframes/mm/hangar/black_one.xml index 5525d58319..7bbc9f1281 100644 --- a/conf/airframes/mm/hangar/black_one.xml +++ b/conf/airframes/mm/hangar/black_one.xml @@ -123,7 +123,7 @@
- + @@ -134,12 +134,12 @@ - + - + @@ -149,7 +149,7 @@
- + @@ -157,7 +157,7 @@ - + diff --git a/conf/airframes/mm/hangar/glass_one1.xml b/conf/airframes/mm/hangar/glass_one1.xml index 5ed8fc2512..5dbbf8e3fa 100644 --- a/conf/airframes/mm/hangar/glass_one1.xml +++ b/conf/airframes/mm/hangar/glass_one1.xml @@ -112,7 +112,7 @@
- + @@ -123,12 +123,12 @@ - + - + @@ -146,7 +146,7 @@ - + diff --git a/conf/airframes/mm/hangar/glass_one2.xml b/conf/airframes/mm/hangar/glass_one2.xml index 1c376bbd29..8c693facc8 100644 --- a/conf/airframes/mm/hangar/glass_one2.xml +++ b/conf/airframes/mm/hangar/glass_one2.xml @@ -96,7 +96,7 @@
- + @@ -107,12 +107,12 @@ - + - + @@ -122,7 +122,7 @@
- + @@ -130,7 +130,7 @@ - + diff --git a/conf/airframes/mm/hangar/glass_one3.xml b/conf/airframes/mm/hangar/glass_one3.xml index 50528eafac..99dd864100 100644 --- a/conf/airframes/mm/hangar/glass_one3.xml +++ b/conf/airframes/mm/hangar/glass_one3.xml @@ -113,7 +113,7 @@
- + @@ -124,12 +124,12 @@ - + - + @@ -139,7 +139,7 @@
- + @@ -147,7 +147,7 @@ - + diff --git a/conf/airframes/mm/hangar/lila.xml b/conf/airframes/mm/hangar/lila.xml index 788907070f..f0bb6c24df 100644 --- a/conf/airframes/mm/hangar/lila.xml +++ b/conf/airframes/mm/hangar/lila.xml @@ -115,7 +115,7 @@ - + @@ -126,12 +126,12 @@ - + - + @@ -141,22 +141,22 @@
- + - - + + - - + + - +
diff --git a/conf/airframes/mm/hangar/mac06a.xml b/conf/airframes/mm/hangar/mac06a.xml index 64c144144d..d52fef4707 100644 --- a/conf/airframes/mm/hangar/mac06a.xml +++ b/conf/airframes/mm/hangar/mac06a.xml @@ -108,7 +108,7 @@
- + @@ -119,12 +119,12 @@ - + - + @@ -134,12 +134,12 @@
- + - + diff --git a/conf/airframes/mm/hangar/red_one.xml b/conf/airframes/mm/hangar/red_one.xml index 301e06f331..8bb328e7b8 100644 --- a/conf/airframes/mm/hangar/red_one.xml +++ b/conf/airframes/mm/hangar/red_one.xml @@ -122,7 +122,7 @@
- + @@ -133,12 +133,12 @@ - + - + @@ -148,7 +148,7 @@
- + @@ -156,7 +156,7 @@ - + diff --git a/conf/airframes/mm/rotor/qmk1.xml b/conf/airframes/mm/rotor/qmk1.xml index a680057c38..eb3cf417e2 100644 --- a/conf/airframes/mm/rotor/qmk1.xml +++ b/conf/airframes/mm/rotor/qmk1.xml @@ -91,9 +91,9 @@ - - - + + +
@@ -122,17 +122,17 @@ - - - + + + - - - + + + - - - + + + @@ -152,8 +152,8 @@ - - + + @@ -164,9 +164,9 @@
- - - + + +
diff --git a/conf/airframes/obsolete/booz2_Aron.xml b/conf/airframes/obsolete/booz2_Aron.xml index 80af3ce202..8512e7990a 100644 --- a/conf/airframes/obsolete/booz2_Aron.xml +++ b/conf/airframes/obsolete/booz2_Aron.xml @@ -83,9 +83,9 @@ - - - + + +
@@ -114,17 +114,17 @@ - - - + + + - - - + + + - - - + + + @@ -145,9 +145,9 @@ - - - + + + @@ -155,9 +155,9 @@
- - - + + +
diff --git a/conf/airframes/obsolete/booz2_NoVa.xml b/conf/airframes/obsolete/booz2_NoVa.xml index a9e7ff831d..472114d6a7 100644 --- a/conf/airframes/obsolete/booz2_NoVa.xml +++ b/conf/airframes/obsolete/booz2_NoVa.xml @@ -79,13 +79,13 @@ - - - + + + - - - + + + @@ -119,30 +119,30 @@ - - - + + + - - - + + + - - - + + + @@ -185,8 +185,8 @@ - - + + @@ -196,11 +196,11 @@
- - - - - + + + + +
diff --git a/conf/airframes/obsolete/booz2_NoVa_001.xml b/conf/airframes/obsolete/booz2_NoVa_001.xml index 582d05c7b4..c6e20076fd 100644 --- a/conf/airframes/obsolete/booz2_NoVa_001.xml +++ b/conf/airframes/obsolete/booz2_NoVa_001.xml @@ -79,13 +79,13 @@ - - - + + + - - - + + + @@ -119,30 +119,30 @@ - - - + + + - - - + + + - - - + + + @@ -185,8 +185,8 @@ - - + + @@ -196,11 +196,11 @@
- - - - - + + + + +
diff --git a/conf/airframes/obsolete/booz2_NoVa_002.xml b/conf/airframes/obsolete/booz2_NoVa_002.xml index 27229199c7..c243de3ae4 100644 --- a/conf/airframes/obsolete/booz2_NoVa_002.xml +++ b/conf/airframes/obsolete/booz2_NoVa_002.xml @@ -79,13 +79,13 @@ - - - + + + - - - + + + @@ -119,30 +119,30 @@ - - - + + + - - - + + + - - - + + + @@ -185,8 +185,8 @@ - - + + @@ -196,11 +196,11 @@
- - - - - + + + + +
diff --git a/conf/airframes/obsolete/booz2_a2.xml b/conf/airframes/obsolete/booz2_a2.xml index 95bb96b694..c6dc404e3c 100644 --- a/conf/airframes/obsolete/booz2_a2.xml +++ b/conf/airframes/obsolete/booz2_a2.xml @@ -77,9 +77,9 @@ - - - + + +
@@ -108,17 +108,17 @@ - - - + + + - - - + + + - - - + + + @@ -145,9 +145,9 @@ - - - + + + @@ -155,9 +155,9 @@
- - - + + +
diff --git a/conf/airframes/obsolete/booz2_a3.xml b/conf/airframes/obsolete/booz2_a3.xml index b16d1e39ae..7e7755e84e 100644 --- a/conf/airframes/obsolete/booz2_a3.xml +++ b/conf/airframes/obsolete/booz2_a3.xml @@ -64,9 +64,9 @@ - - - + + +
@@ -95,17 +95,17 @@ - - - + + + - - - + + + - - - + + + @@ -131,8 +131,8 @@ - - + + @@ -140,9 +140,9 @@
- - - + + +
diff --git a/conf/airframes/obsolete/booz2_a4.xml b/conf/airframes/obsolete/booz2_a4.xml index 8d1a6b0822..337c76d244 100644 --- a/conf/airframes/obsolete/booz2_a4.xml +++ b/conf/airframes/obsolete/booz2_a4.xml @@ -66,9 +66,9 @@ - - - + + +
@@ -84,10 +84,10 @@ - - + + - +
@@ -109,8 +109,8 @@ - - + + @@ -118,9 +118,9 @@
- - - + + +
diff --git a/conf/airframes/obsolete/booz2_a5.xml b/conf/airframes/obsolete/booz2_a5.xml index 9b4918ead3..bcdd61a563 100644 --- a/conf/airframes/obsolete/booz2_a5.xml +++ b/conf/airframes/obsolete/booz2_a5.xml @@ -87,9 +87,9 @@ - - - + + +
@@ -118,17 +118,17 @@ - - - + + + - - - + + + - - - + + + @@ -147,9 +147,9 @@ - - - + + + @@ -159,9 +159,9 @@
- - - + + +
diff --git a/conf/airframes/obsolete/booz2_s1.xml b/conf/airframes/obsolete/booz2_s1.xml index 106ad4cb11..9711a48c3f 100644 --- a/conf/airframes/obsolete/booz2_s1.xml +++ b/conf/airframes/obsolete/booz2_s1.xml @@ -78,9 +78,9 @@ - - - + + +
@@ -110,17 +110,17 @@ - - - + + + - - - + + + - - - + + + @@ -138,9 +138,9 @@ - - - + + + @@ -151,9 +151,9 @@
- - - + + +
diff --git a/conf/airframes/obsolete/booz2_x1.xml b/conf/airframes/obsolete/booz2_x1.xml index d24a301207..7ce46bd0d3 100644 --- a/conf/airframes/obsolete/booz2_x1.xml +++ b/conf/airframes/obsolete/booz2_x1.xml @@ -89,9 +89,9 @@ - - - + + +
@@ -121,17 +121,17 @@ - - - + + + - - - + + + - - - + + + @@ -150,9 +150,9 @@ - - - + + + @@ -161,9 +161,9 @@
- - - + + +
diff --git a/conf/airframes/obsolete/easystar2.xml b/conf/airframes/obsolete/easystar2.xml index a129d1f39d..cbda2b48f6 100644 --- a/conf/airframes/obsolete/easystar2.xml +++ b/conf/airframes/obsolete/easystar2.xml @@ -103,7 +103,7 @@
- + @@ -112,7 +112,7 @@ - + @@ -122,7 +122,7 @@ - + @@ -130,15 +130,15 @@
- + - + - - + +
diff --git a/conf/airframes/obsolete/hitl_usb.xml b/conf/airframes/obsolete/hitl_usb.xml index 5a2c64da06..b2d5a21c1b 100644 --- a/conf/airframes/obsolete/hitl_usb.xml +++ b/conf/airframes/obsolete/hitl_usb.xml @@ -46,7 +46,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -65,21 +65,21 @@
- + - + - - + +
diff --git a/conf/airframes/obsolete/kalscott_easystar.xml b/conf/airframes/obsolete/kalscott_easystar.xml index 211b238d28..8fc7177256 100644 --- a/conf/airframes/obsolete/kalscott_easystar.xml +++ b/conf/airframes/obsolete/kalscott_easystar.xml @@ -90,7 +90,7 @@
- + @@ -99,10 +99,10 @@ - + - + @@ -110,15 +110,15 @@
- + - + - - + +
diff --git a/conf/airframes/obsolete/malolo_sim.xml b/conf/airframes/obsolete/malolo_sim.xml index f72cb96d61..9bde735206 100644 --- a/conf/airframes/obsolete/malolo_sim.xml +++ b/conf/airframes/obsolete/malolo_sim.xml @@ -112,7 +112,7 @@ - + @@ -123,12 +123,12 @@ - + - + @@ -138,19 +138,19 @@
- + - + - - + +
diff --git a/conf/airframes/obsolete/microjet5.xml b/conf/airframes/obsolete/microjet5.xml index 5d20dc5d0f..e6390f07fd 100644 --- a/conf/airframes/obsolete/microjet5.xml +++ b/conf/airframes/obsolete/microjet5.xml @@ -109,7 +109,7 @@
- + @@ -120,12 +120,12 @@ - + - + @@ -135,19 +135,19 @@
- + - + - - + +
diff --git a/conf/airframes/obsolete/microjet5_tp_auto.xml b/conf/airframes/obsolete/microjet5_tp_auto.xml index 702715819d..959828e6a7 100644 --- a/conf/airframes/obsolete/microjet5_tp_auto.xml +++ b/conf/airframes/obsolete/microjet5_tp_auto.xml @@ -86,7 +86,7 @@
- + @@ -96,15 +96,15 @@
- + - - - + + + @@ -114,7 +114,7 @@
- + @@ -125,12 +125,12 @@ - + - + diff --git a/conf/airframes/obsolete/microjet6.xml b/conf/airframes/obsolete/microjet6.xml index eb339a907c..cbce102e34 100644 --- a/conf/airframes/obsolete/microjet6.xml +++ b/conf/airframes/obsolete/microjet6.xml @@ -105,7 +105,7 @@ - + @@ -116,12 +116,12 @@ - + - + @@ -131,7 +131,7 @@
- + @@ -139,7 +139,7 @@ - + @@ -162,7 +162,7 @@
- +
diff --git a/conf/airframes/obsolete/microjetI.xml b/conf/airframes/obsolete/microjetI.xml index b5b6cf71c3..1e816a3d29 100644 --- a/conf/airframes/obsolete/microjetI.xml +++ b/conf/airframes/obsolete/microjetI.xml @@ -115,7 +115,7 @@ - + @@ -126,7 +126,7 @@ - + @@ -134,21 +134,21 @@
- + - + - - + +
diff --git a/conf/airframes/obsolete/microjetII.xml b/conf/airframes/obsolete/microjetII.xml index 40d42dcdd2..f522378c6c 100644 --- a/conf/airframes/obsolete/microjetII.xml +++ b/conf/airframes/obsolete/microjetII.xml @@ -117,7 +117,7 @@ - + @@ -128,7 +128,7 @@ - + @@ -136,19 +136,19 @@
- + - + - - + +
diff --git a/conf/airframes/obsolete/microjetIII.xml b/conf/airframes/obsolete/microjetIII.xml index 424a3bce9c..89c5e2b519 100644 --- a/conf/airframes/obsolete/microjetIII.xml +++ b/conf/airframes/obsolete/microjetIII.xml @@ -103,7 +103,7 @@ - + @@ -114,7 +114,7 @@ - + @@ -122,21 +122,21 @@
- + - + - - + +
diff --git a/conf/airframes/obsolete/microjet_raw_makefile.xml b/conf/airframes/obsolete/microjet_raw_makefile.xml index cc7c722062..4de83c91ff 100644 --- a/conf/airframes/obsolete/microjet_raw_makefile.xml +++ b/conf/airframes/obsolete/microjet_raw_makefile.xml @@ -114,7 +114,7 @@
- + @@ -125,12 +125,12 @@ - + - + @@ -140,19 +140,19 @@
- + - + - - + +
diff --git a/conf/airframes/obsolete/minimag1.xml b/conf/airframes/obsolete/minimag1.xml index 666e1bea24..e047ab17d6 100644 --- a/conf/airframes/obsolete/minimag1.xml +++ b/conf/airframes/obsolete/minimag1.xml @@ -102,7 +102,7 @@ - + @@ -113,12 +113,12 @@ - + - + @@ -128,7 +128,7 @@
- + @@ -136,7 +136,7 @@ - + diff --git a/conf/airframes/obsolete/minimag_fs.xml b/conf/airframes/obsolete/minimag_fs.xml index f48b353aea..5fe2a47676 100644 --- a/conf/airframes/obsolete/minimag_fs.xml +++ b/conf/airframes/obsolete/minimag_fs.xml @@ -116,7 +116,7 @@ - + @@ -127,12 +127,12 @@ - + - + @@ -142,14 +142,14 @@
- + - +
diff --git a/conf/airframes/obsolete/mmlaas_N1_carto_cam.xml b/conf/airframes/obsolete/mmlaas_N1_carto_cam.xml index e9efa41b10..be58d5e523 100644 --- a/conf/airframes/obsolete/mmlaas_N1_carto_cam.xml +++ b/conf/airframes/obsolete/mmlaas_N1_carto_cam.xml @@ -101,7 +101,7 @@ - + @@ -112,12 +112,12 @@ - + - + @@ -127,7 +127,7 @@
- + @@ -135,7 +135,7 @@ - + @@ -144,7 +144,7 @@
- +
diff --git a/conf/airframes/obsolete/osam_xsens_twog.xml b/conf/airframes/obsolete/osam_xsens_twog.xml index 4c573d4d2b..425ae845d6 100644 --- a/conf/airframes/obsolete/osam_xsens_twog.xml +++ b/conf/airframes/obsolete/osam_xsens_twog.xml @@ -145,7 +145,7 @@ - + @@ -156,7 +156,7 @@ - + @@ -165,13 +165,13 @@
- + - + diff --git a/conf/airframes/obsolete/slayer1.xml b/conf/airframes/obsolete/slayer1.xml index e104bfbf0a..a097cfc2da 100644 --- a/conf/airframes/obsolete/slayer1.xml +++ b/conf/airframes/obsolete/slayer1.xml @@ -105,7 +105,7 @@
- + @@ -116,12 +116,12 @@ - + - + @@ -131,7 +131,7 @@
- + @@ -139,7 +139,7 @@ - + diff --git a/conf/airframes/obsolete/slayer3.xml b/conf/airframes/obsolete/slayer3.xml index 2cb82585a6..62c18d9fe3 100644 --- a/conf/airframes/obsolete/slayer3.xml +++ b/conf/airframes/obsolete/slayer3.xml @@ -105,7 +105,7 @@
- + @@ -116,12 +116,12 @@ - + - + @@ -131,7 +131,7 @@
- + @@ -140,7 +140,7 @@ - + diff --git a/conf/airframes/obsolete/slayerJH.xml b/conf/airframes/obsolete/slayerJH.xml index 920295fb1b..e1a8f7255b 100644 --- a/conf/airframes/obsolete/slayerJH.xml +++ b/conf/airframes/obsolete/slayerJH.xml @@ -102,7 +102,7 @@
- + @@ -113,7 +113,7 @@ - + @@ -121,18 +121,18 @@
- + - + - - + +
diff --git a/conf/airframes/obsolete/slicer1.xml b/conf/airframes/obsolete/slicer1.xml index 914538a39b..163152da50 100644 --- a/conf/airframes/obsolete/slicer1.xml +++ b/conf/airframes/obsolete/slicer1.xml @@ -116,7 +116,7 @@ - + @@ -127,7 +127,7 @@ - + @@ -135,19 +135,19 @@
- + - + - - + +
diff --git a/conf/airframes/obsolete/slicer2.xml b/conf/airframes/obsolete/slicer2.xml index 1a89a8a100..c8798feae4 100644 --- a/conf/airframes/obsolete/slicer2.xml +++ b/conf/airframes/obsolete/slicer2.xml @@ -110,7 +110,7 @@ - + @@ -121,7 +121,7 @@ - + @@ -129,19 +129,19 @@
- + - + - - + +
diff --git a/conf/airframes/obsolete/spirit.xml b/conf/airframes/obsolete/spirit.xml index 7e839d4829..d3804aaf2a 100644 --- a/conf/airframes/obsolete/spirit.xml +++ b/conf/airframes/obsolete/spirit.xml @@ -112,7 +112,7 @@ - + @@ -123,7 +123,7 @@ - + @@ -131,21 +131,21 @@
- + - + - - + +
diff --git a/conf/airframes/obsolete/spirit_proto.xml b/conf/airframes/obsolete/spirit_proto.xml index ca9971afa2..9ae2acdc93 100644 --- a/conf/airframes/obsolete/spirit_proto.xml +++ b/conf/airframes/obsolete/spirit_proto.xml @@ -101,7 +101,7 @@ - + @@ -112,7 +112,7 @@ - + @@ -120,21 +120,21 @@
- + - + - - + +
diff --git a/conf/airframes/obsolete/storm1.xml b/conf/airframes/obsolete/storm1.xml index 80cdfed726..3ada34c50a 100644 --- a/conf/airframes/obsolete/storm1.xml +++ b/conf/airframes/obsolete/storm1.xml @@ -129,7 +129,7 @@ - + @@ -140,12 +140,12 @@ - + - + @@ -155,7 +155,7 @@
- + @@ -163,7 +163,7 @@ - + diff --git a/conf/airframes/obsolete/tiny2.xml b/conf/airframes/obsolete/tiny2.xml index 494b269a55..8003be219f 100644 --- a/conf/airframes/obsolete/tiny2.xml +++ b/conf/airframes/obsolete/tiny2.xml @@ -101,7 +101,7 @@ - + @@ -112,12 +112,12 @@ - + - + @@ -127,7 +127,7 @@
- + @@ -135,7 +135,7 @@ - + diff --git a/conf/airframes/obsolete/tiny_hitl.xml b/conf/airframes/obsolete/tiny_hitl.xml index e1278378b9..c3f70f7f3b 100644 --- a/conf/airframes/obsolete/tiny_hitl.xml +++ b/conf/airframes/obsolete/tiny_hitl.xml @@ -97,7 +97,7 @@ - + @@ -108,7 +108,7 @@ - + @@ -116,21 +116,21 @@
- + - + - - + +
diff --git a/conf/airframes/obsolete/twinjet1.xml b/conf/airframes/obsolete/twinjet1.xml index 0f70ebc62b..b9d9f5b702 100644 --- a/conf/airframes/obsolete/twinjet1.xml +++ b/conf/airframes/obsolete/twinjet1.xml @@ -80,25 +80,25 @@
- + - + - - + +
- + @@ -109,7 +109,7 @@ - + diff --git a/conf/airframes/obsolete/twinstar1.xml b/conf/airframes/obsolete/twinstar1.xml index 52832ed439..725d44586c 100644 --- a/conf/airframes/obsolete/twinstar1.xml +++ b/conf/airframes/obsolete/twinstar1.xml @@ -70,7 +70,7 @@
- + @@ -82,7 +82,7 @@
- + @@ -90,7 +90,7 @@ - + @@ -110,7 +110,7 @@
- + @@ -121,12 +121,12 @@ - + - + diff --git a/conf/airframes/obsolete/twinstar6.xml b/conf/airframes/obsolete/twinstar6.xml index 8429b9bd93..515270a9d7 100644 --- a/conf/airframes/obsolete/twinstar6.xml +++ b/conf/airframes/obsolete/twinstar6.xml @@ -90,7 +90,7 @@
- + @@ -98,7 +98,7 @@ - +
@@ -119,7 +119,7 @@
- + @@ -130,7 +130,7 @@ - + diff --git a/conf/airframes/obsolete/tyto1.xml b/conf/airframes/obsolete/tyto1.xml index 5da82221f8..9f77189137 100644 --- a/conf/airframes/obsolete/tyto1.xml +++ b/conf/airframes/obsolete/tyto1.xml @@ -119,7 +119,7 @@ - + @@ -130,12 +130,12 @@ - + - + @@ -145,7 +145,7 @@
- + @@ -157,8 +157,8 @@ - - + +
diff --git a/conf/airframes/obsolete/xxx1.xml b/conf/airframes/obsolete/xxx1.xml index a634c1204a..29c376bf5b 100644 --- a/conf/airframes/obsolete/xxx1.xml +++ b/conf/airframes/obsolete/xxx1.xml @@ -115,7 +115,7 @@ - + @@ -126,12 +126,12 @@ - + - + @@ -141,7 +141,7 @@
- + @@ -149,7 +149,7 @@ - + diff --git a/conf/airframes/test_hb.xml b/conf/airframes/test_hb.xml index 8ab20eb739..7026a0513d 100644 --- a/conf/airframes/test_hb.xml +++ b/conf/airframes/test_hb.xml @@ -140,7 +140,7 @@
- + @@ -151,12 +151,12 @@ - + - + @@ -165,14 +165,14 @@
- + - + diff --git a/conf/airframes/twinjet_example.xml b/conf/airframes/twinjet_example.xml index f672895b64..fb86fd0152 100644 --- a/conf/airframes/twinjet_example.xml +++ b/conf/airframes/twinjet_example.xml @@ -69,8 +69,8 @@ - - + +
@@ -107,25 +107,25 @@
- + - + - - + +
- + @@ -136,7 +136,7 @@ - + diff --git a/conf/airframes/twinjet_overo.xml b/conf/airframes/twinjet_overo.xml index 133ce05db0..c24d940e23 100644 --- a/conf/airframes/twinjet_overo.xml +++ b/conf/airframes/twinjet_overo.xml @@ -109,25 +109,25 @@
- + - + - - + +
- + @@ -138,7 +138,7 @@ - + diff --git a/conf/airframes/twinstar_example.xml b/conf/airframes/twinstar_example.xml index 565ac73735..861fd67536 100644 --- a/conf/airframes/twinstar_example.xml +++ b/conf/airframes/twinstar_example.xml @@ -38,10 +38,10 @@ - + - + @@ -78,8 +78,8 @@ - - + + @@ -137,7 +137,7 @@
- + @@ -148,12 +148,12 @@ - + - + @@ -163,15 +163,15 @@
- + - - + +
diff --git a/conf/airframes/usb_test.xml b/conf/airframes/usb_test.xml index 21fcd7e3f3..3946645082 100644 --- a/conf/airframes/usb_test.xml +++ b/conf/airframes/usb_test.xml @@ -119,7 +119,7 @@ - + @@ -130,12 +130,12 @@ - + - + @@ -144,14 +144,14 @@
- + - + diff --git a/conf/boards/lisa_l_1.0.makefile b/conf/boards/lisa_l_1.0.makefile index f6f49af10c..d79070ad43 100644 --- a/conf/boards/lisa_l_1.0.makefile +++ b/conf/boards/lisa_l_1.0.makefile @@ -60,8 +60,16 @@ ifndef SYS_TIME_LED SYS_TIME_LED = 1 endif + +# +# default uart configuration +# +ifndef RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT = UART3 +endif +ifndef RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT = UART5 +endif ifndef MODEM_PORT MODEM_PORT=UART2 diff --git a/conf/boards/lisa_l_1.1.makefile b/conf/boards/lisa_l_1.1.makefile index 6f15ce905f..0fdbf428ea 100644 --- a/conf/boards/lisa_l_1.1.makefile +++ b/conf/boards/lisa_l_1.1.makefile @@ -1,11 +1,115 @@ # Hey Emacs, this is a -*- makefile -*- +# +# lisa_l_1.1.makefile +# +# http://paparazzi.enac.fr/wiki/User/LisaL +# -include $(PAPARAZZI_SRC)/conf/boards/lisa_l_1.0.makefile + +# we are actually still using the Lisa/L 1.0 header file + +BOARD=lisa_l +BOARD_VERSION=1.0 +BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\" + +# ----------------------------------------------------------------------- +ifeq ($(BOARD_PROCESSOR),'omap') + + ARCH = omap + $(TARGET).LDFLAGS += -levent -lm + +# ----------------------------------------------------------------------- +else + + ARCH=stm32 + + $(TARGET).ARCHDIR = $(ARCH) +# not needed? + +endif +# ----------------------------------------------------------------------- + +ifndef FLASH_MODE +FLASH_MODE = JTAG +endif + +# +# +# some default values shared between different firmwares +# +# + +# +# default LED configuration +# +ifndef RADIO_CONTROL_LED +RADIO_CONTROL_LED = 5 +endif + +ifndef BARO_LED +BARO_LED = none +endif + +ifndef AHRS_ALIGNER_LED +AHRS_ALIGNER_LED = 7 +endif + +ifndef GPS_LED +GPS_LED = 3 +endif + +ifndef SYS_TIME_LED +SYS_TIME_LED = 1 +endif + + +# +# default uart configuration +# +ifndef RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT +RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT = UART3 +endif +ifndef RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT +RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT = UART5 +endif + +ifndef MODEM_PORT +MODEM_PORT=UART2 +endif +ifndef MODEM_BAUD +MODEM_BAUD=B57600 +endif + +ifndef GPS_PORT +GPS_PORT=UART1 +endif +ifndef GPS_BAUD +GPS_BAUD=B38400 +endif # # this is the DRDY pin of a max1168 on a booz IMU # -# v1.1 +# v 1.1 # MAX_1168_DRDY_PORT = _GPIOB MAX_1168_DRDY_PORT_SOURCE = PortSourceGPIOB +# v1.1 +#MAX_1168_DRDY_PORT = GPIOB + + +ifndef ADC_IR1 +ADC_IR1 = 1 +ADC_IR1_CHAN = 0 +endif +ifndef ADC_IR2 +ADC_IR2 = 2 +ADC_IR2_CHAN = 1 +endif +ifndef ADC_IR3 +ADC_IR_TOP = 4 +ADC_IR_TOP_CHAN = 3 +endif +ifndef ADC_IR_NB_SAMPLES +ADC_IR_NB_SAMPLES = 16 +endif diff --git a/conf/boards/lisa_m_1.0.makefile b/conf/boards/lisa_m_1.0.makefile index c57c341fb1..f7adea8924 100644 --- a/conf/boards/lisa_m_1.0.makefile +++ b/conf/boards/lisa_m_1.0.makefile @@ -53,6 +53,9 @@ ifndef SYS_TIME_LED SYS_TIME_LED = 1 endif +# +# default uart configuration +# ifndef RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT = UART3 endif @@ -77,17 +80,6 @@ GPS_BAUD=B38400 endif -# -# this is the DRDY pin of a max1168 on a booz IMU -# -# v 1.0 -# -MAX_1168_DRDY_PORT = _GPIOD -MAX_1168_DRDY_PORT_SOURCE = PortSourceGPIOD -# v1.1 -#MAX_1168_DRDY_PORT = GPIOB - - ifndef ADC_IR1 ADC_IR1 = 1 diff --git a/conf/boards/lisa_m_2.0.makefile b/conf/boards/lisa_m_2.0.makefile index 3a69dcf4b3..c42dd56347 100644 --- a/conf/boards/lisa_m_2.0.makefile +++ b/conf/boards/lisa_m_2.0.makefile @@ -1,14 +1,96 @@ # Hey Emacs, this is a -*- makefile -*- +# +# lisa_m_2.0.makefile +# +# http://paparazzi.enac.fr/wiki/Lisa/M +# + +BOARD=lisa_m +BOARD_VERSION=1.0 +BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\" + +ARCH=stm32 +$(TARGET).ARCHDIR = $(ARCH) +# not needed? +$(TARGET).OOCD_INTERFACE=flossjtag +#$(TARGET).OOCD_INTERFACE=jtagkey-tiny + +# ----------------------------------------------------------------------- + +ifndef FLASH_MODE +FLASH_MODE = JTAG +#FLASH_MODE = SERIAL +endif # -# Swap GPS UART with spektrum UART +# +# some default values shared between different firmwares +# +# + + +# +# default LED configuration +# +ifndef RADIO_CONTROL_LED +RADIO_CONTROL_LED = none +endif + +ifndef BARO_LED +BARO_LED = none +endif + +ifndef AHRS_ALIGNER_LED +AHRS_ALIGNER_LED = none +endif + +ifndef GPS_LED +GPS_LED = none +endif + +ifndef SYS_TIME_LED +SYS_TIME_LED = 1 +endif + +# +# default uart configuration # ifndef RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT = UART1 endif +ifndef RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT +RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT = UART5 +endif + +ifndef MODEM_PORT +MODEM_PORT=UART2 +endif +ifndef MODEM_BAUD +MODEM_BAUD=B57600 +endif + ifndef GPS_PORT GPS_PORT=UART3 endif +ifndef GPS_BAUD +GPS_BAUD=B38400 +endif -include $(PAPARAZZI_SRC)/conf/boards/lisa_m_1.0.makefile + + +ifndef ADC_IR1 +ADC_IR1 = 1 +ADC_IR1_CHAN = 0 +endif +ifndef ADC_IR2 +ADC_IR2 = 2 +ADC_IR2_CHAN = 1 +endif +ifndef ADC_IR3 +ADC_IR_TOP = 4 +ADC_IR_TOP_CHAN = 3 +endif +ifndef ADC_IR_NB_SAMPLES +ADC_IR_NB_SAMPLES = 16 +endif diff --git a/conf/boards/navgo_1.0.makefile b/conf/boards/navgo_1.0.makefile index 75b42e53f4..2fad0c60a2 100644 --- a/conf/boards/navgo_1.0.makefile +++ b/conf/boards/navgo_1.0.makefile @@ -44,7 +44,9 @@ SYS_TIME_LED = none endif -### default settings +# +# default uart settings +# ifndef GPS_PORT GPS_PORT = UART0 endif diff --git a/conf/boards/sdlog_1.0.makefile b/conf/boards/sdlog_1.0.makefile new file mode 100644 index 0000000000..ea9f99cc0d --- /dev/null +++ b/conf/boards/sdlog_1.0.makefile @@ -0,0 +1,13 @@ +# +# sdlog_1.0.makefile +# +# Paparazzi SD Logger +# + + +include $(PAPARAZZI_SRC)/conf/boards/tiny_2.11.makefile + +BOARD=sdlog +BOARD_VERSION=1.0 + +BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\" diff --git a/conf/boards/tiny_0.99.makefile b/conf/boards/tiny_0.99.makefile index f3879c0b70..64650b82a1 100644 --- a/conf/boards/tiny_0.99.makefile +++ b/conf/boards/tiny_0.99.makefile @@ -4,17 +4,81 @@ # http://paparazzi.enac.fr/wiki/Tiny_v0.99 # - -include $(PAPARAZZI_SRC)/conf/boards/tiny_2.11.makefile - +ARCH=lpc21 BOARD=tiny BOARD_VERSION=0.99 BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\" -GPS_PORT = UART1 -GPS_LED = none -MODEM_PORT = UART0 +ifndef FLASH_MODE +FLASH_MODE = IAP +endif + + +LPC21ISP_BAUD = 38400 +LPC21ISP_XTAL = 12000 + +# +# default LED configuration +# +ifndef RADIO_CONTROL_LED +RADIO_CONTROL_LED = none +endif + +ifndef BARO_LED +BARO_LED = none +endif + +ifndef AHRS_ALIGNER_LED +AHRS_ALIGNER_LED = none +endif + +ifndef GPS_LED +GPS_LED = none +endif + +ifndef SYS_TIME_LED +SYS_TIME_LED = none +endif + + +# +# default uart settings +# +ifndef GPS_PORT +GPS_PORT = UART1 +endif +ifndef GPS_BAUD +GPS_BAUD = B38400 +endif + +ifndef MODEM_PORT +MODEM_PORT = UART0 +endif +ifndef MODEM_BAUD +MODEM_BAUD = B57600 +endif + + + +ADC_IR_TOP = ADC_0 +ADC_IR1 = ADC_1 +ADC_IR2 = ADC_2 +ADC_IR_NB_SAMPLES = 16 +ADC_GYRO_NB_SAMPLES = 16 + +ADC_GENERIC_NB_SAMPLES = 16 + +# +# you can use different actuators by adding a configure option to your firmware section +# e.g. in your airframe config!) diff --git a/conf/boards/umarim_1.0.makefile b/conf/boards/umarim_1.0.makefile index c1eb9b600e..7a6a7554d8 100644 --- a/conf/boards/umarim_1.0.makefile +++ b/conf/boards/umarim_1.0.makefile @@ -11,6 +11,7 @@ BOARD_VERSION=1.0 BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\" + ifndef FLASH_MODE FLASH_MODE = IAP endif @@ -44,7 +45,9 @@ SYS_TIME_LED = none endif -### default settings +# +# default uart settings +# ifndef GPS_PORT GPS_PORT = UART0 endif @@ -59,9 +62,18 @@ ifndef MODEM_BAUD MODEM_BAUD = B57600 endif + + ADC_GENERIC_NB_SAMPLES = 16 +# +# you can use different actuators by adding a configure option to your firmware section +# e.g. + - + - + diff --git a/conf/radios/TGY9x_jeti.xml b/conf/radios/TGY9x_jeti.xml index 95dc978b86..7636da5b8e 100644 --- a/conf/radios/TGY9x_jeti.xml +++ b/conf/radios/TGY9x_jeti.xml @@ -44,11 +44,11 @@ - + - - + + diff --git a/conf/settings/basic.xml b/conf/settings/basic.xml index 42d515d640..2ecedc22b3 100644 --- a/conf/settings/basic.xml +++ b/conf/settings/basic.xml @@ -21,8 +21,6 @@ - - diff --git a/conf/settings/basic_infrared.xml b/conf/settings/basic_infrared.xml index 37dd032afe..7de7a7c5df 100644 --- a/conf/settings/basic_infrared.xml +++ b/conf/settings/basic_infrared.xml @@ -21,8 +21,6 @@ - - diff --git a/conf/settings/basic_ins.xml b/conf/settings/basic_ins.xml index 787d4a4fc7..70ee43a5f8 100644 --- a/conf/settings/basic_ins.xml +++ b/conf/settings/basic_ins.xml @@ -21,8 +21,6 @@ - - diff --git a/conf/settings/flight_params.xml b/conf/settings/flight_params.xml index 62f6d2411b..f30232fea1 100644 --- a/conf/settings/flight_params.xml +++ b/conf/settings/flight_params.xml @@ -26,10 +26,6 @@ - - - - diff --git a/conf/settings/fw_h_ctl_a_settings.xml b/conf/settings/fw_h_ctl_a_settings.xml index 4defb5ded3..22631d80a9 100644 --- a/conf/settings/fw_h_ctl_a_settings.xml +++ b/conf/settings/fw_h_ctl_a_settings.xml @@ -5,12 +5,12 @@ - - - - - - + + + + + + diff --git a/conf/settings/lisa.xml b/conf/settings/lisa.xml index 4ab6fa9e0c..8fd1c470a0 100644 --- a/conf/settings/lisa.xml +++ b/conf/settings/lisa.xml @@ -24,7 +24,6 @@ - diff --git a/conf/settings/settings_UofAdelaide.xml b/conf/settings/settings_UofAdelaide.xml index 16ebab381e..7f08414008 100644 --- a/conf/settings/settings_UofAdelaide.xml +++ b/conf/settings/settings_UofAdelaide.xml @@ -15,11 +15,6 @@ - - - - - @@ -33,9 +28,9 @@ - - - + + + @@ -55,9 +50,9 @@ - - - + + + @@ -66,11 +61,10 @@ - - - - - + + + + diff --git a/conf/settings/settings_booz2.xml b/conf/settings/settings_booz2.xml index 97cff2e7b1..f5be37c77f 100644 --- a/conf/settings/settings_booz2.xml +++ b/conf/settings/settings_booz2.xml @@ -4,11 +4,6 @@ - - - - - @@ -22,9 +17,9 @@ - - - + + + @@ -44,9 +39,9 @@ - - - + + + @@ -55,11 +50,10 @@ - - - - - + + + + diff --git a/conf/settings/settings_booz2_jtm.xml b/conf/settings/settings_booz2_jtm.xml index 3441e55d55..6c4cf7431e 100644 --- a/conf/settings/settings_booz2_jtm.xml +++ b/conf/settings/settings_booz2_jtm.xml @@ -4,11 +4,6 @@ - - - - - @@ -22,9 +17,9 @@ - - - + + + @@ -44,9 +39,9 @@ - - - + + + @@ -55,11 +50,10 @@ - - - - - + + + + diff --git a/conf/settings/settings_test_passthrough.xml b/conf/settings/settings_test_passthrough.xml index 15bb5a8b3b..e0b47ec936 100644 --- a/conf/settings/settings_test_passthrough.xml +++ b/conf/settings/settings_test_passthrough.xml @@ -2,11 +2,6 @@ - - - - - diff --git a/conf/settings/tl.xml b/conf/settings/tl.xml deleted file mode 100644 index 0d4f84e356..0000000000 --- a/conf/settings/tl.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/conf/settings/tuning.xml b/conf/settings/tuning.xml index 5309586e6e..cd01556f46 100644 --- a/conf/settings/tuning.xml +++ b/conf/settings/tuning.xml @@ -17,8 +17,6 @@ - - @@ -39,17 +37,17 @@ - - + + - - + + - + @@ -58,9 +56,7 @@ - - - + @@ -72,12 +68,12 @@ - + - + @@ -89,7 +85,7 @@ - + diff --git a/conf/settings/tuningJH.xml b/conf/settings/tuningJH.xml index a4907a95fb..a5c19d6133 100644 --- a/conf/settings/tuningJH.xml +++ b/conf/settings/tuningJH.xml @@ -17,7 +17,6 @@ - @@ -38,19 +37,19 @@ - + - - + + - + @@ -61,7 +60,7 @@ - + @@ -73,7 +72,7 @@ - + @@ -84,7 +83,7 @@ - + diff --git a/conf/settings/tuning_ctl_adaptive.xml b/conf/settings/tuning_ctl_adaptive.xml index c51a014118..ff57cd5608 100644 --- a/conf/settings/tuning_ctl_adaptive.xml +++ b/conf/settings/tuning_ctl_adaptive.xml @@ -12,12 +12,12 @@ - - - - - - + + + + + + @@ -26,32 +26,32 @@ - - - - + + + + - + - - + + - - - + + + - + @@ -63,7 +63,7 @@ - + diff --git a/conf/settings/tuning_ctl_new.xml b/conf/settings/tuning_ctl_new.xml index 3b87c1c32d..b290ac9997 100644 --- a/conf/settings/tuning_ctl_new.xml +++ b/conf/settings/tuning_ctl_new.xml @@ -12,12 +12,12 @@ - - - - - - + + + + + + @@ -26,14 +26,14 @@ - - - - + + + + - + @@ -46,20 +46,20 @@ - - - + + + - - - + + + - + @@ -71,7 +71,7 @@ - + diff --git a/conf/settings/tuning_infrared.xml b/conf/settings/tuning_infrared.xml index 92f0b23bd3..982584f6c5 100644 --- a/conf/settings/tuning_infrared.xml +++ b/conf/settings/tuning_infrared.xml @@ -17,8 +17,6 @@ - - @@ -49,19 +47,19 @@ - - + + - - + + - + @@ -72,7 +70,7 @@ - + @@ -84,12 +82,12 @@ - + - + @@ -101,7 +99,7 @@ - + diff --git a/conf/settings/tuning_ins.xml b/conf/settings/tuning_ins.xml index 57af459d9b..596fc50ac9 100644 --- a/conf/settings/tuning_ins.xml +++ b/conf/settings/tuning_ins.xml @@ -17,8 +17,6 @@ - - @@ -45,19 +43,19 @@ - + - - + + - + @@ -73,7 +71,7 @@ - + @@ -85,12 +83,12 @@ - + - + @@ -102,7 +100,7 @@ - + diff --git a/conf/settings/tuning_ins_dcm.xml b/conf/settings/tuning_ins_dcm.xml index 4691283559..17d61c9bf4 100644 --- a/conf/settings/tuning_ins_dcm.xml +++ b/conf/settings/tuning_ins_dcm.xml @@ -17,8 +17,6 @@ - - @@ -47,19 +45,19 @@ - + - - + + - + @@ -70,7 +68,7 @@ - + @@ -82,12 +80,12 @@ - + - + @@ -99,7 +97,7 @@ - + diff --git a/conf/settings/tuning_loiter.xml b/conf/settings/tuning_loiter.xml index 7dd510d56c..ec1a77d63f 100644 --- a/conf/settings/tuning_loiter.xml +++ b/conf/settings/tuning_loiter.xml @@ -17,8 +17,6 @@ - - @@ -52,19 +50,19 @@ - - + + - - + + - + @@ -75,7 +73,7 @@ - + @@ -87,12 +85,12 @@ - + - + @@ -104,7 +102,7 @@ - + diff --git a/conf/settings/tuning_pers.xml b/conf/settings/tuning_pers.xml index 68c7e55a7a..b5092cefdb 100644 --- a/conf/settings/tuning_pers.xml +++ b/conf/settings/tuning_pers.xml @@ -17,8 +17,6 @@ - - @@ -49,19 +47,19 @@ - - + + - - + + - + @@ -72,7 +70,7 @@ - + @@ -84,12 +82,12 @@ - + - + @@ -101,7 +99,7 @@ - + diff --git a/conf/settings/tuning_tp_auto.xml b/conf/settings/tuning_tp_auto.xml index 627fb9dd1c..2bf9f895b1 100644 --- a/conf/settings/tuning_tp_auto.xml +++ b/conf/settings/tuning_tp_auto.xml @@ -17,7 +17,6 @@ - @@ -30,10 +29,10 @@ - - + + - + @@ -43,7 +42,7 @@ - + @@ -54,7 +53,7 @@ - + @@ -63,7 +62,7 @@ - + @@ -74,7 +73,7 @@ - + diff --git a/conf/telemetry/aerocomm.xml b/conf/telemetry/aerocomm.xml deleted file mode 100644 index 7870513dfb..0000000000 --- a/conf/telemetry/aerocomm.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/conf/telemetry/booz_minimal.xml b/conf/telemetry/booz_minimal.xml deleted file mode 100644 index 281730aa57..0000000000 --- a/conf/telemetry/booz_minimal.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/conf/telemetry/default.xml b/conf/telemetry/default_fixedwing.xml similarity index 100% rename from conf/telemetry/default.xml rename to conf/telemetry/default_fixedwing.xml diff --git a/conf/telemetry/telemetry_booz2.xml b/conf/telemetry/default_rotorcraft.xml similarity index 96% rename from conf/telemetry/telemetry_booz2.xml rename to conf/telemetry/default_rotorcraft.xml index b646ab0f60..0dbf65895c 100644 --- a/conf/telemetry/telemetry_booz2.xml +++ b/conf/telemetry/default_rotorcraft.xml @@ -5,7 +5,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -72,7 +72,7 @@ - + @@ -83,7 +83,7 @@ - + diff --git a/conf/telemetry/telemetry_wt.xml b/conf/telemetry/dummy.xml similarity index 53% rename from conf/telemetry/telemetry_wt.xml rename to conf/telemetry/dummy.xml index 6c0ff16376..aba543f60a 100644 --- a/conf/telemetry/telemetry_wt.xml +++ b/conf/telemetry/dummy.xml @@ -2,12 +2,19 @@ - - + + + + + + + + + diff --git a/conf/telemetry/fw_h_ctl_a.xml b/conf/telemetry/fixedwing_control_new.xml similarity index 100% rename from conf/telemetry/fw_h_ctl_a.xml rename to conf/telemetry/fixedwing_control_new.xml diff --git a/conf/telemetry/hitl.xml b/conf/telemetry/hitl_fixedwing.xml similarity index 100% rename from conf/telemetry/hitl.xml rename to conf/telemetry/hitl_fixedwing.xml diff --git a/conf/telemetry/minimal.xml b/conf/telemetry/minimal.xml deleted file mode 100644 index 3789235f91..0000000000 --- a/conf/telemetry/minimal.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/conf/telemetry/nova_telemetry.xml b/conf/telemetry/nova_telemetry.xml deleted file mode 100644 index 7280fc7966..0000000000 --- a/conf/telemetry/nova_telemetry.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/conf/telemetry/osam_imu.xml b/conf/telemetry/osam_imu.xml deleted file mode 100644 index 22efef2abc..0000000000 --- a/conf/telemetry/osam_imu.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/conf/telemetry/telemetry.dtd b/conf/telemetry/telemetry.dtd index 99e0bb35a1..e20c46fe1a 100644 --- a/conf/telemetry/telemetry.dtd +++ b/conf/telemetry/telemetry.dtd @@ -6,11 +6,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/conf/telemetry/telemetry_whirly.xml b/conf/telemetry/telemetry_whirly.xml deleted file mode 100644 index f729f4c4f4..0000000000 --- a/conf/telemetry/telemetry_whirly.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/conf/telemetry/tl.xml b/conf/telemetry/tl.xml deleted file mode 100644 index f82332f4c9..0000000000 --- a/conf/telemetry/tl.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/conf/telemetry/ugv.xml b/conf/telemetry/ugv.xml deleted file mode 100644 index bb153041b8..0000000000 --- a/conf/telemetry/ugv.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/conf/telemetry/xbee868.xml b/conf/telemetry/xbee868.xml old mode 100755 new mode 100644 diff --git a/sw/airborne/arch/lpc21/test/bootloader/crt.S b/sw/airborne/arch/lpc21/test/bootloader/crt.S index ef39c02bb7..c7bfadd2d3 100644 --- a/sw/airborne/arch/lpc21/test/bootloader/crt.S +++ b/sw/airborne/arch/lpc21/test/bootloader/crt.S @@ -30,12 +30,15 @@ #ifdef PROC_LPCH2148 #define BOARD_LPCH2148 #endif +#ifdef PROC_LOGGER +#define BOARD_LOGGER +#endif #ifdef BOARD_TINYJ /* TINY Jeremy old MOSI P0.19 */ /* .set BOOT_PIN, 0x00080000 */ /* TINY Jeremy old SCK P0.17 */ -.set BOOT_PIN, 0x00020000 +.set BOOT_PIN, 0x00020000 #else #ifdef BOARD_TINY /* TINY old LPC_SSEL P0.20 */ @@ -49,12 +52,17 @@ /* Olimex LPC-H2148 P1.24 */ .set BOOT_PIN, 0x04000000 #else +#ifdef BOARD_LOGGER +/* SD-Logger P0.29 */ +.set BOOT_PIN, 0x20000000 +#else /* Vbus P0.23 */ .set BOOT_PIN, 0x00800000 #endif #endif #endif #endif +#endif /* Stack Sizes */ .set UND_STACK_SIZE, 0x00000040 /* stack for "undefined instruction" interrupts is 4 bytes */ @@ -114,6 +122,7 @@ AppS_Addr: .word APP_START Reset_Handler: #ifndef BOARD_LPCH2148 +#ifndef BOARD_LOGGER /* check status of the USB in P0.xx */ ldr r0, =IOPIN0 /* load gpio addr */ ldr r1,[r0] /* get data */ @@ -122,6 +131,16 @@ Reset_Handler: cmp r1, r2 /* compare bits */ beq Bootloader /* beq */ ldr PC, AppS_Addr +#else + /* check status of the USB in P0.xx */ + ldr r0, =IOPIN0 /* load gpio addr */ + ldr r1,[r0] /* get data */ + ldr r2, =BOOT_PIN /* get boot pin */ + and r1, r1, r2 /* clear all other bits */ + cmp r1, r2 /* compare bits */ + bne Bootloader /* beq */ + ldr PC, AppS_Addr +#endif #else /* check status of the USB in P1.24 */ ldr r0, =PINSEL2 /* load mode addr */ diff --git a/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.h b/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.h index 98ee76912d..346b9bed16 100644 --- a/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.h +++ b/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.h @@ -54,7 +54,7 @@ /* reverse some channels to suit Paparazzi conventions */ /* the maximum number of channels a Spektrum can transmit is 12 */ #ifndef RADIO_CONTROL_SPEKTRUM_SIGNS -#define RADIO_CONTROL_SPEKTRUM_SIGNS {1,1,-1,1,1,-1,1,1,1,1,1,1} +#define RADIO_CONTROL_SPEKTRUM_SIGNS {1,-1,-1,-1,1,-1,1,1,1,1,1,1} #endif /* really for a 9 channel transmitter diff --git a/sw/airborne/boards/lisa_l/baro_board.c b/sw/airborne/boards/lisa_l/baro_board.c index ae69b7ca61..eb49429c3d 100644 --- a/sw/airborne/boards/lisa_l/baro_board.c +++ b/sw/airborne/boards/lisa_l/baro_board.c @@ -71,9 +71,9 @@ void baro_board_send_config_abs(void) { #pragma message "Using High LisaL Baro Gain: Do not use below 1000hPa" baro_board_write_to_register(BARO_ABS_ADDR, 0x01, 0x86, 0x83); #else -#pragma message "Using Low LisaL Baro Gain, capable of measuring below 1000hPa or more" +#pragma message "Using Low LisaL Baro Gain, capable of measuring below 1000hPa or more" //config register should be 0x84 in low countries, or 0x86 in normal countries - baro_board_write_to_register(BARO_ABS_ADDR, 0x01, 0x84, 0x83); + baro_board_write_to_register(BARO_ABS_ADDR, 0x01, 0x84, 0x83); #endif } diff --git a/sw/airborne/boards/sdlog_1.0.h b/sw/airborne/boards/sdlog_1.0.h new file mode 100644 index 0000000000..973d773670 --- /dev/null +++ b/sw/airborne/boards/sdlog_1.0.h @@ -0,0 +1,196 @@ +/* board definition file for Paparazzi SD-Logger v1.0 */ + +#ifndef CONFIG_SD_LOGGER_PPRZ_H +#define CONFIG_SD_LOGGER_PPRZ_H + +#ifdef SITL +/* Dummy definitions: adc are unused anyway */ +#define AdcBank0(x) (x) +#define AdcBank1(x) (x) +#endif /* SITL */ + +/* Master oscillator freq. */ +#define FOSC (12000000) + +/* PLL multiplier */ +#define PLL_MUL (5) + +/* CPU clock freq. */ +#define CCLK (FOSC * PLL_MUL) + +/* current @7V, Tiny2.11, Funjet4, no LED + PCLK max min + 15MHz 99mA 92mA + 30MHz 105mA 98mA + 60MHz 116mA 108mA +*/ + +#ifdef USE_USB_HIGH_PCLK +/* Peripheral bus speed mask 0x00-> 4, 0x01-> 1, 0x02-> 2 */ +/* change both PBSD_BITS/VAL 15MHz, 60MHz, 30MHz */ +#define PBSD_BITS 0x02 +#define PBSD_VAL 2 +#else +/* Peripheral bus speed mask 0x00->4, 0x01-> 1, 0x02 -> 2 */ +#define PBSD_BITS 0x00 +#define PBSD_VAL 4 +#endif + +/* Peripheral bus clock freq. */ +#define PCLK (CCLK / PBSD_VAL) + +#define LED_1_BANK 1 +#define LED_1_PIN 17 + +#define LED_2_BANK 1 +#define LED_2_PIN 16 + +#define LED_3_BANK 1 +#define LED_3_PIN 23 + +#define LED_4_BANK 1 +#define LED_4_PIN 18 + +#define POWER_SWITCH_LED 4 + +#define LED_5_BANK 1 +#define LED_5_PIN 22 + +#define CAM_SWITCH_LED 5 + +#define LED_GPS_RESET_BANK 1 +#define LED_GPS_RESET_PIN 21 + +#define Configure_GPS_RESET_Pin() LED_INIT(GPS_RESET) +#define Set_GPS_RESET_Pin_LOW() LED_ON(GPS_RESET) +#define Open_GPS_RESET_Pin() ClearBit(LED_DIR(GPS_RESET), LED_PIN(GPS_RESET)) + +/* P0.5 aka MAT0.1 */ +#define SERVO_CLOCK_PIN 5 +#define SERVO_CLOCK_PINSEL PINSEL0 +#define SERVO_CLOCK_PINSEL_VAL 0x02 +#define SERVO_CLOCK_PINSEL_BIT 10 +/* p1.20 */ +#define SERVO_RESET_PIN 20 + +/* PPM : rc rx on P0.6*/ +#define PPM_PINSEL PINSEL0 +#define PPM_PINSEL_VAL 0x02 +#define PPM_PINSEL_BIT 12 +#define PPM_CRI TIR_CR2I +#define PPM_CCR_CRF TCCR_CR2_F +#define PPM_CCR_CRR TCCR_CR2_R +#define PPM_CCR_CRI TCCR_CR2_I +#define PPM_CR T0CR2 + +/* ADC */ + +#define ADC_0 AdcBank1(6) +#ifdef USE_ADC_0 +#ifndef USE_AD1 +#define USE_AD1 +#endif +#define USE_AD1_6 +#endif + +#define ADC_1 AdcBank1(7) +#ifdef USE_ADC_1 +#ifndef USE_AD1 +#define USE_AD1 +#endif +#define USE_AD1_7 +#endif + + +#define ADC_2 AdcBank0(4) +#ifdef USE_ADC_2 +#ifndef USE_AD0 +#define USE_AD0 +#endif +#define USE_AD0_4 +#endif + +#define ADC_3 AdcBank0(6) +#ifdef USE_ADC_3 +#ifndef USE_AD0 +#define USE_AD0 +#endif +#define USE_AD0_6 +#endif + +#define ADC_4 AdcBank0(3) +#ifdef USE_ADC_4 +#ifndef USE_AD0 +#define USE_AD0 +#endif +#define USE_AD0_3 +#endif + +#define ADC_5 AdcBank0(2) +#ifdef USE_ADC_5 +#ifndef USE_AD0 +#define USE_AD0 +#endif +#define USE_AD0_2 +#endif + +#define ADC_6 AdcBank0(1) +#ifdef USE_ADC_6 +#ifndef USE_AD0 +#define USE_AD0 +#endif +#define USE_AD0_1 +#endif + +#define ADC_7 AdcBank1(3) +#ifdef USE_ADC_7 +#ifndef USE_AD1 +#define USE_AD1 +#endif +#define USE_AD1_3 +#endif + +/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/ +#ifndef ADC_CHANNEL_VSUPPLY +#define ADC_CHANNEL_VSUPPLY AdcBank1(5) +#ifndef USE_AD1 +#define USE_AD1 +#endif +#define USE_AD1_5 +#endif + + +#define DefaultVoltageOfAdc(adc) (0.01787109375*adc) + +#define SPI_SELECT_SLAVE0_PORT 0 +#define SPI_SELECT_SLAVE0_PIN 20 + +#define SPI1_DRDY_PINSEL PINSEL1 +#define SPI1_DRDY_PINSEL_BIT 0 +#define SPI1_DRDY_PINSEL_VAL 1 +#define SPI1_DRDY_EINT 0 +#define SPI1_DRDY_VIC_IT VIC_EINT0 + +/* micro SD connected to SPI0 */ +#define SPI_CHANNEL 0 + +/************ BANK 0 *************/ + +/* STOP button P0.3 */ +#define LOG_STOP_KEY 29 + +/* POWER DETECT 5V P0.10 */ +#define POWER_DETECT_PIN 10 + +/************ BANK 1 *************/ + +/* STOP button P1.20 */ +#define CARD_DETECT_PIN 20 + + +#define LED_GREEN 3 +#define LED_YELLOW 2 +#define LED_RED 1 + + +#endif /* CONFIG_SD_LOGGER_PPRZ_H */ diff --git a/sw/airborne/firmwares/fixedwing/ap_downlink.c b/sw/airborne/firmwares/fixedwing/ap_downlink.c index 2ca6a53dd5..df13ea5d92 100644 --- a/sw/airborne/firmwares/fixedwing/ap_downlink.c +++ b/sw/airborne/firmwares/fixedwing/ap_downlink.c @@ -1,6 +1,4 @@ /* - * Paparazzi $Id$ - * * Copyright (C) 2011 Gautier Hattenberger * * This file is part of paparazzi. @@ -22,14 +20,10 @@ * */ -#include "firmwares/fixedwing/ap_downlink.h" -#include "generated/airframe.h" - -#ifdef AP -#ifndef TELEMETRY_MODE_AP -#define TELEMETRY_MODE_AP 0 -#endif -uint8_t telemetry_mode_Ap_DefaultChannel = TELEMETRY_MODE_AP; -#endif /** AP */ +/* PERIODIC_C_AP is defined before generated/periodic_telemetry.h + * in order to implement telemetry_mode_Ap_* + */ +#define PERIODIC_C_AP +#include "generated/periodic_telemetry.h" diff --git a/sw/airborne/firmwares/fixedwing/ap_downlink.h b/sw/airborne/firmwares/fixedwing/ap_downlink.h index f51437dff2..0953cad086 100644 --- a/sw/airborne/firmwares/fixedwing/ap_downlink.h +++ b/sw/airborne/firmwares/fixedwing/ap_downlink.h @@ -45,9 +45,7 @@ #include "subsystems/datalink/downlink.h" #include "messages.h" -#include "generated/periodic.h" - -//#include "generated/modules.h" +#include "generated/periodic_telemetry.h" #if defined DOWNLINK #define Downlink(x) x @@ -55,11 +53,6 @@ #define Downlink(x) {} #endif -#ifdef AP -/** Telemetry mode for AP process: index in the telemetry.xml file */ -extern uint8_t telemetry_mode_Ap_DefaultChannel; -#endif - #define PERIODIC_SEND_ALIVE(_trans, _dev) DOWNLINK_SEND_ALIVE(_trans, _dev, 16, MD5SUM); #define PERIODIC_SEND_BAT(_trans, _dev) { \ @@ -86,7 +79,7 @@ extern uint8_t telemetry_mode_Ap_DefaultChannel; #define PERIODIC_SEND_DOWNLINK(_trans, _dev) { \ static uint16_t last; \ - uint16_t rate = (downlink_nb_bytes - last) / PERIOD_DOWNLINK_Ap_DefaultChannel_0; \ + uint16_t rate = (downlink_nb_bytes - last) / PERIOD_DOWNLINK_Ap_0; \ last = downlink_nb_bytes; \ DOWNLINK_SEND_DOWNLINK(_trans, _dev, &downlink_nb_ovrn, &rate, &downlink_nb_msgs); \ } diff --git a/sw/airborne/firmwares/fixedwing/fbw_downlink.c b/sw/airborne/firmwares/fixedwing/fbw_downlink.c index 46ba54f928..73cdb003ed 100644 --- a/sw/airborne/firmwares/fixedwing/fbw_downlink.c +++ b/sw/airborne/firmwares/fixedwing/fbw_downlink.c @@ -1,6 +1,4 @@ /* - * Paparazzi $Id$ - * * Copyright (C) 2011 Gautier Hattenberger * * This file is part of paparazzi. @@ -22,14 +20,10 @@ * */ -#include "firmwares/fixedwing/fbw_downlink.h" -#include "generated/airframe.h" - -#ifdef FBW -#ifndef TELEMETRY_MODE_FBW -#define TELEMETRY_MODE_FBW 0 -#endif -uint8_t telemetry_mode_Fbw_DefaultChannel = TELEMETRY_MODE_FBW; -#endif /** AP */ +/* PERIODIC_C_FBW is defined before generated/periodic_telemetry.h + * in order to implement telemetry_mode_Fbw_* + */ +#define PERIODIC_C_FBW +#include "generated/periodic_telemetry.h" diff --git a/sw/airborne/firmwares/fixedwing/fbw_downlink.h b/sw/airborne/firmwares/fixedwing/fbw_downlink.h index 929d03075e..38609e9082 100644 --- a/sw/airborne/firmwares/fixedwing/fbw_downlink.h +++ b/sw/airborne/firmwares/fixedwing/fbw_downlink.h @@ -37,7 +37,7 @@ #include #include "messages.h" -#include "generated/periodic.h" +#include "generated/periodic_telemetry.h" #include "generated/airframe.h" #include "commands.h" #include "actuators.h" @@ -53,11 +53,6 @@ #endif #include "subsystems/datalink/downlink.h" -#ifdef FBW -/** Telemetry mode for FBW process: index in the telemetry.xml file */ -extern uint8_t telemetry_mode_Fbw_DefaultChannel; -#endif - #define PERIODIC_SEND_COMMANDS(_trans, _dev) DOWNLINK_SEND_COMMANDS(_trans, _dev, COMMANDS_NB, commands) #ifdef RADIO_CONTROL diff --git a/sw/airborne/firmwares/fixedwing/guidance/guidance_v.c b/sw/airborne/firmwares/fixedwing/guidance/guidance_v.c index 7e401d26ed..3159b7b32a 100644 --- a/sw/airborne/firmwares/fixedwing/guidance/guidance_v.c +++ b/sw/airborne/firmwares/fixedwing/guidance/guidance_v.c @@ -50,6 +50,10 @@ float v_ctl_climb_setpoint; uint8_t v_ctl_climb_mode; uint8_t v_ctl_auto_throttle_submode; +#ifndef V_CTL_AUTO_THROTTLE_DGAIN +#define V_CTL_AUTO_THROTTLE_DGAIN 0. +#endif + /* "auto throttle" inner loop parameters */ float v_ctl_auto_throttle_cruise_throttle; float v_ctl_auto_throttle_nominal_cruise_throttle; @@ -108,6 +112,7 @@ float v_ctl_auto_groundspeed_sum_err; #define V_CTL_AUTO_AGR_CLIMB_GAIN 2.0 // altitude gain multiplier while in aggressive climb mode #endif +#pragma message "CAUTION! ALL control gains have to be positive now!" #ifndef V_CTL_ALTITUDE_PRE_CLIMB_CORRECTION #define V_CTL_ALTITUDE_PRE_CLIMB_CORRECTION 1.0f @@ -136,11 +141,10 @@ void v_ctl_init( void ) { v_ctl_auto_throttle_min_cruise_throttle = V_CTL_AUTO_THROTTLE_MIN_CRUISE_THROTTLE; v_ctl_auto_throttle_max_cruise_throttle = V_CTL_AUTO_THROTTLE_MAX_CRUISE_THROTTLE; v_ctl_auto_throttle_cruise_throttle = v_ctl_auto_throttle_nominal_cruise_throttle; - v_ctl_auto_throttle_climb_throttle_increment = - V_CTL_AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT; + v_ctl_auto_throttle_climb_throttle_increment = V_CTL_AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT; v_ctl_auto_throttle_pgain = V_CTL_AUTO_THROTTLE_PGAIN; v_ctl_auto_throttle_igain = V_CTL_AUTO_THROTTLE_IGAIN; - v_ctl_auto_throttle_dgain = 0.; + v_ctl_auto_throttle_dgain = V_CTL_AUTO_THROTTLE_DGAIN; v_ctl_auto_throttle_sum_err = 0.; v_ctl_auto_throttle_pitch_of_vz_pgain = V_CTL_AUTO_THROTTLE_PITCH_OF_VZ_PGAIN; v_ctl_auto_throttle_pitch_of_vz_dgain = V_CTL_AUTO_THROTTLE_PITCH_OF_VZ_DGAIN; @@ -206,7 +210,7 @@ void v_ctl_altitude_loop( void ) { } #endif - v_ctl_altitude_error = estimator_z - v_ctl_altitude_setpoint; + v_ctl_altitude_error = v_ctl_altitude_setpoint - estimator_z; v_ctl_climb_setpoint = altitude_pgain_boost * v_ctl_altitude_pgain * v_ctl_altitude_error + v_ctl_altitude_pre_climb * v_ctl_altitude_pre_climb_correction; BoundAbs(v_ctl_climb_setpoint, v_ctl_altitude_max_climb); @@ -257,7 +261,7 @@ inline static void v_ctl_climb_auto_throttle_loop(void) { last_err = err; float controlled_throttle = v_ctl_auto_throttle_cruise_throttle + v_ctl_auto_throttle_climb_throttle_increment * v_ctl_climb_setpoint - + v_ctl_auto_throttle_pgain * + - v_ctl_auto_throttle_pgain * (err + v_ctl_auto_throttle_igain * v_ctl_auto_throttle_sum_err + v_ctl_auto_throttle_dgain * d_err); @@ -327,7 +331,7 @@ inline static void v_ctl_climb_auto_throttle_loop(void) { float err = estimator_z_dot - v_ctl_climb_setpoint; v_ctl_auto_pitch_sum_err += err; BoundAbs(v_ctl_auto_pitch_sum_err, V_CTL_AUTO_PITCH_MAX_SUM_ERR); - v_ctl_pitch_of_vz = v_ctl_auto_pitch_pgain * + v_ctl_pitch_of_vz = -v_ctl_auto_pitch_pgain * (err + v_ctl_auto_pitch_igain * v_ctl_auto_pitch_sum_err); // Ground speed control loop (input: groundspeed error, output: airspeed controlled) @@ -369,7 +373,7 @@ inline static void v_ctl_climb_auto_pitch_loop(void) { v_ctl_throttle_setpoint = nav_throttle_setpoint; v_ctl_auto_pitch_sum_err += err; BoundAbs(v_ctl_auto_pitch_sum_err, V_CTL_AUTO_PITCH_MAX_SUM_ERR); - nav_pitch = v_ctl_auto_pitch_pgain * + nav_pitch = -v_ctl_auto_pitch_pgain * (err + v_ctl_auto_pitch_igain * v_ctl_auto_pitch_sum_err); Bound(nav_pitch, V_CTL_AUTO_PITCH_MIN_PITCH, V_CTL_AUTO_PITCH_MAX_PITCH); } diff --git a/sw/airborne/firmwares/fixedwing/guidance/guidance_v_n.c b/sw/airborne/firmwares/fixedwing/guidance/guidance_v_n.c index 38b90db444..2fbdb722c5 100644 --- a/sw/airborne/firmwares/fixedwing/guidance/guidance_v_n.c +++ b/sw/airborne/firmwares/fixedwing/guidance/guidance_v_n.c @@ -49,6 +49,10 @@ float v_ctl_climb_setpoint; uint8_t v_ctl_climb_mode; uint8_t v_ctl_auto_throttle_submode; +#ifndef V_CTL_AUTO_THROTTLE_DGAIN +#define V_CTL_AUTO_THROTTLE_DGAIN 0. +#endif + /* "auto throttle" inner loop parameters */ float v_ctl_auto_throttle_cruise_throttle; float v_ctl_auto_throttle_nominal_cruise_throttle; @@ -110,6 +114,7 @@ float v_ctl_auto_groundspeed_sum_err; #define V_CTL_AUTO_GROUNDSPEED_MAX_SUM_ERR 100 #endif +#pragma message "CAUTION! ALL control gains have to be positive now!" void v_ctl_init( void ) { /* mode */ @@ -135,7 +140,7 @@ void v_ctl_init( void ) { v_ctl_auto_throttle_climb_throttle_increment = V_CTL_AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT; v_ctl_auto_throttle_pgain = V_CTL_AUTO_THROTTLE_PGAIN; v_ctl_auto_throttle_igain = V_CTL_AUTO_THROTTLE_IGAIN; - v_ctl_auto_throttle_dgain = 0.; + v_ctl_auto_throttle_dgain = V_CTL_AUTO_THROTTLE_DGAIN; v_ctl_auto_throttle_sum_err = 0.; v_ctl_auto_throttle_pitch_of_vz_pgain = V_CTL_AUTO_THROTTLE_PITCH_OF_VZ_PGAIN; v_ctl_auto_throttle_pitch_of_vz_dgain = V_CTL_AUTO_THROTTLE_PITCH_OF_VZ_DGAIN; @@ -183,7 +188,7 @@ void v_ctl_altitude_loop( void ) { //static float last_lead_input = 0.; // Altitude error - v_ctl_altitude_error = estimator_z - v_ctl_altitude_setpoint; + v_ctl_altitude_error = v_ctl_altitude_setpoint - estimator_z; v_ctl_climb_setpoint = v_ctl_altitude_pgain * v_ctl_altitude_error + v_ctl_altitude_pre_climb; // Lead controller @@ -207,13 +212,13 @@ static inline void v_ctl_set_pitch ( void ) { v_ctl_auto_pitch_sum_err = 0; // Compute errors - float err = estimator_z_dot - v_ctl_climb_setpoint; + float err = v_ctl_climb_setpoint - estimator_z_dot; float d_err = err - last_err; last_err = err; - if (v_ctl_auto_pitch_igain < 0.) { + if (v_ctl_auto_pitch_igain > 0.) { v_ctl_auto_pitch_sum_err += err*(1./60.); - BoundAbs(v_ctl_auto_pitch_sum_err, V_CTL_AUTO_PITCH_MAX_SUM_ERR / (-v_ctl_auto_pitch_igain)); + BoundAbs(v_ctl_auto_pitch_sum_err, V_CTL_AUTO_PITCH_MAX_SUM_ERR / v_ctl_auto_pitch_igain); } // PI loop + feedforward ctl @@ -232,13 +237,13 @@ static inline void v_ctl_set_throttle( void ) { v_ctl_auto_throttle_sum_err = 0; // Compute errors - float err = estimator_z_dot - v_ctl_climb_setpoint; + float err = v_ctl_climb_setpoint - estimator_z_dot; float d_err = err - last_err; last_err = err; - if (v_ctl_auto_throttle_igain < 0.) { + if (v_ctl_auto_throttle_igain > 0.) { v_ctl_auto_throttle_sum_err += err*(1./60.); - BoundAbs(v_ctl_auto_throttle_sum_err, V_CTL_AUTO_THROTTLE_MAX_SUM_ERR / (-v_ctl_auto_throttle_igain)); + BoundAbs(v_ctl_auto_throttle_sum_err, V_CTL_AUTO_THROTTLE_MAX_SUM_ERR / v_ctl_auto_throttle_igain); } // PID loop + feedforward ctl @@ -262,26 +267,26 @@ static inline void v_ctl_set_airspeed( void ) { Bound(v_ctl_auto_airspeed_setpoint, V_CTL_AIRSPEED_MIN, V_CTL_AIRSPEED_MAX); // Compute errors - float err_vz = estimator_z_dot - v_ctl_climb_setpoint; + float err_vz = v_ctl_climb_setpoint - estimator_z_dot; float d_err_vz = (err_vz - last_err_vz)*AIRSPEED_LOOP_PERIOD; last_err_vz = err_vz; - if (v_ctl_auto_throttle_igain < 0.) { + if (v_ctl_auto_throttle_igain > 0.) { v_ctl_auto_throttle_sum_err += err_vz*AIRSPEED_LOOP_PERIOD; - BoundAbs(v_ctl_auto_throttle_sum_err, V_CTL_AUTO_THROTTLE_MAX_SUM_ERR / (-v_ctl_auto_throttle_igain)); + BoundAbs(v_ctl_auto_throttle_sum_err, V_CTL_AUTO_THROTTLE_MAX_SUM_ERR / v_ctl_auto_throttle_igain); } - if (v_ctl_auto_pitch_igain < 0.) { + if (v_ctl_auto_pitch_igain > 0.) { v_ctl_auto_pitch_sum_err += err_vz*AIRSPEED_LOOP_PERIOD; - BoundAbs(v_ctl_auto_pitch_sum_err, V_CTL_AUTO_PITCH_MAX_SUM_ERR / (-v_ctl_auto_pitch_igain)); + BoundAbs(v_ctl_auto_pitch_sum_err, V_CTL_AUTO_PITCH_MAX_SUM_ERR / v_ctl_auto_pitch_igain); } float err_airspeed = v_ctl_auto_airspeed_setpoint - estimator_airspeed; float d_err_airspeed = (err_airspeed - last_err_as)*AIRSPEED_LOOP_PERIOD; last_err_as = err_airspeed; - if (v_ctl_auto_airspeed_throttle_igain > 0.) { // ! sign + if (v_ctl_auto_airspeed_throttle_igain > 0.) { v_ctl_auto_airspeed_throttle_sum_err += err_airspeed*AIRSPEED_LOOP_PERIOD; BoundAbs(v_ctl_auto_airspeed_throttle_sum_err, V_CTL_AUTO_AIRSPEED_THROTTLE_MAX_SUM_ERR / v_ctl_auto_airspeed_throttle_igain); } - if (v_ctl_auto_airspeed_pitch_igain > 0.) { // ! sign + if (v_ctl_auto_airspeed_pitch_igain > 0.) { v_ctl_auto_airspeed_pitch_sum_err += err_airspeed*AIRSPEED_LOOP_PERIOD; BoundAbs(v_ctl_auto_airspeed_pitch_sum_err, V_CTL_AUTO_AIRSPEED_PITCH_MAX_SUM_ERR / v_ctl_auto_airspeed_pitch_igain); } diff --git a/sw/airborne/firmwares/fixedwing/main_ap.c b/sw/airborne/firmwares/fixedwing/main_ap.c index 4ef83114b6..081e1c84f2 100644 --- a/sw/airborne/firmwares/fixedwing/main_ap.c +++ b/sw/airborne/firmwares/fixedwing/main_ap.c @@ -81,6 +81,11 @@ #include "gpio.h" #include "led.h" +#if defined RADIO_CONTROL +#pragma message "CAUTION! radio control roll channel input has been changed to follow aerospace sign conventions.\n You will have to change your radio control xml file to get a positive value when banking right!" +#endif + + #if USE_AHRS #if USE_IMU @@ -350,7 +355,7 @@ static inline void telecommand_task( void ) { */ if (pprz_mode == PPRZ_MODE_AUTO1) { /** Roll is bounded between [-AUTO1_MAX_ROLL;AUTO1_MAX_ROLL] */ - h_ctl_roll_setpoint = FLOAT_OF_PPRZ(fbw_state->channels[RADIO_ROLL], 0., -AUTO1_MAX_ROLL); + h_ctl_roll_setpoint = FLOAT_OF_PPRZ(fbw_state->channels[RADIO_ROLL], 0., AUTO1_MAX_ROLL); /** Pitch is bounded between [-AUTO1_MAX_PITCH;AUTO1_MAX_PITCH] */ h_ctl_pitch_setpoint = FLOAT_OF_PPRZ(fbw_state->channels[RADIO_PITCH], 0., AUTO1_MAX_PITCH); @@ -445,7 +450,7 @@ void navigation_task( void ) { CallTCAS(); #endif -#ifndef PERIOD_NAVIGATION_DefaultChannel_0 // If not sent periodically (in default 0 mode) +#ifndef PERIOD_NAVIGATION_0 // If not sent periodically (in default 0 mode) SEND_NAVIGATION(DefaultChannel, DefaultDevice); #endif @@ -505,7 +510,7 @@ void attitude_loop( void ) { 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; - ap_state->commands[COMMAND_ROLL] = h_ctl_aileron_setpoint; + ap_state->commands[COMMAND_ROLL] = -h_ctl_aileron_setpoint; ap_state->commands[COMMAND_PITCH] = h_ctl_elevator_setpoint; diff --git a/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.c b/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.c index 5c02751a26..cf9a09ff90 100644 --- a/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.c +++ b/sw/airborne/firmwares/fixedwing/stabilization/stabilization_adaptive.c @@ -116,6 +116,8 @@ inline static void h_ctl_pitch_loop( void ); #define H_CTL_COURSE_DGAIN 0. #endif +#pragma message "CAUTION! ALL control gains have to be positive now!" + // Some default roll gains // H_CTL_ROLL_ATTITUDE_GAIN needs to be define in airframe #ifndef H_CTL_ROLL_RATE_GAIN @@ -203,7 +205,7 @@ void h_ctl_course_loop ( void ) { static float last_err; // Ground path error - float err = estimator_hspeed_dir - h_ctl_course_setpoint; + float err = h_ctl_course_setpoint - estimator_hspeed_dir; NormRadAngle(err); float d_err = err - last_err; @@ -277,50 +279,44 @@ inline static void h_ctl_roll_loop( void ) { #ifdef USE_KFF_UPDATE // update Kff gains - h_ctl_roll_Kffa -= KFFA_UPDATE * h_ctl_ref_roll_accel * cmd_fb / (H_CTL_REF_MAX_P_DOT*H_CTL_REF_MAX_P_DOT); - h_ctl_roll_Kffd -= KFFD_UPDATE * h_ctl_ref_roll_rate * cmd_fb / (H_CTL_REF_MAX_P*H_CTL_REF_MAX_P); + h_ctl_roll_Kffa += KFFA_UPDATE * h_ctl_ref_roll_accel * cmd_fb / (H_CTL_REF_MAX_P_DOT*H_CTL_REF_MAX_P_DOT); + h_ctl_roll_Kffd += KFFD_UPDATE * h_ctl_ref_roll_rate * cmd_fb / (H_CTL_REF_MAX_P*H_CTL_REF_MAX_P); #ifdef SITL printf("%f %f %f\n", h_ctl_roll_Kffa, h_ctl_roll_Kffd, cmd_fb); #endif - h_ctl_roll_Kffa = Min(h_ctl_roll_Kffa, 0); - h_ctl_roll_Kffd = Min(h_ctl_roll_Kffd, 0); + h_ctl_roll_Kffa = Max(h_ctl_roll_Kffa, 0); + h_ctl_roll_Kffd = Max(h_ctl_roll_Kffd, 0); #endif // Compute errors - float err = estimator_phi - h_ctl_ref_roll_angle; + float err = h_ctl_ref_roll_angle - estimator_phi; #ifdef SITL static float last_err = 0; estimator_p = (err - last_err)/(1/60.); last_err = err; #endif - float d_err = estimator_p - h_ctl_ref_roll_rate; + float d_err = h_ctl_ref_roll_rate - estimator_p; if (pprz_mode == PPRZ_MODE_MANUAL || launch == 0) { h_ctl_roll_sum_err = 0.; } else { - if (h_ctl_roll_igain < 0.) { + if (h_ctl_roll_igain > 0.) { h_ctl_roll_sum_err += err * H_CTL_REF_DT; - BoundAbs(h_ctl_roll_sum_err, (- H_CTL_ROLL_SUM_ERR_MAX / h_ctl_roll_igain)); + BoundAbs(h_ctl_roll_sum_err, H_CTL_ROLL_SUM_ERR_MAX / h_ctl_roll_igain); } else { h_ctl_roll_sum_err = 0.; } } - cmd_fb = h_ctl_roll_attitude_gain * err;// + h_ctl_roll_rate_gain * d_err; - float cmd = h_ctl_roll_Kffa * h_ctl_ref_roll_accel - + h_ctl_roll_Kffd * h_ctl_ref_roll_rate + cmd_fb = h_ctl_roll_attitude_gain * err; + float cmd = - h_ctl_roll_Kffa * h_ctl_ref_roll_accel + - h_ctl_roll_Kffd * h_ctl_ref_roll_rate - cmd_fb - h_ctl_roll_rate_gain * d_err - h_ctl_roll_igain * h_ctl_roll_sum_err + v_ctl_throttle_setpoint * h_ctl_aileron_of_throttle; -// float cmd = h_ctl_roll_Kffa * h_ctl_ref_roll_accel -// + h_ctl_roll_Kffd * h_ctl_ref_roll_rate -// - h_ctl_roll_attitude_gain * err -// - h_ctl_roll_rate_gain * d_err -// - h_ctl_roll_igain * h_ctl_roll_sum_err -// + v_ctl_throttle_setpoint * h_ctl_aileron_of_throttle; -// + cmd /= airspeed_ratio2; // Set aileron commands @@ -390,9 +386,9 @@ inline static void h_ctl_pitch_loop( void ) { #endif // Compute errors - float err = estimator_theta - h_ctl_ref_pitch_angle; + float err = h_ctl_ref_pitch_angle - estimator_theta; #if USE_GYRO_PITCH_RATE - float d_err = estimator_q - h_ctl_ref_pitch_rate; + float d_err = h_ctl_ref_pitch_rate - estimator_q; #else // soft derivation float d_err = (err - last_err)/H_CTL_REF_DT - h_ctl_ref_pitch_rate; last_err = err; @@ -402,16 +398,16 @@ inline static void h_ctl_pitch_loop( void ) { h_ctl_pitch_sum_err = 0.; } else { - if (h_ctl_pitch_igain < 0.) { + if (h_ctl_pitch_igain > 0.) { h_ctl_pitch_sum_err += err * H_CTL_REF_DT; - BoundAbs(h_ctl_pitch_sum_err, (- H_CTL_PITCH_SUM_ERR_MAX / h_ctl_pitch_igain)); + BoundAbs(h_ctl_pitch_sum_err, H_CTL_PITCH_SUM_ERR_MAX / h_ctl_pitch_igain); } else { h_ctl_pitch_sum_err = 0.; } } - float cmd = h_ctl_pitch_Kffa * h_ctl_ref_pitch_accel - + h_ctl_pitch_Kffd * h_ctl_ref_pitch_rate + float cmd = - h_ctl_pitch_Kffa * h_ctl_ref_pitch_accel + - h_ctl_pitch_Kffd * h_ctl_ref_pitch_rate + h_ctl_pitch_pgain * err + h_ctl_pitch_dgain * d_err + h_ctl_pitch_igain * 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 97bde53917..a97544bd21 100644 --- a/sw/airborne/firmwares/fixedwing/stabilization/stabilization_attitude.c +++ b/sw/airborne/firmwares/fixedwing/stabilization/stabilization_attitude.c @@ -37,6 +37,7 @@ #include "firmwares/fixedwing/guidance/guidance_v.h" #include "firmwares/fixedwing/autopilot.h" +#pragma message "CAUTION! ALL control gains have to be positive now!" /* outer loop parameters */ float h_ctl_course_setpoint; /* rad, CW/north */ @@ -238,7 +239,7 @@ void h_ctl_course_loop ( void ) { h_ctl_course_heading_mode = 0; } */ -#endif +#endif //STRONG_WIND float d_err = err - last_err; last_err = err; @@ -248,7 +249,7 @@ void h_ctl_course_loop ( void ) { #ifdef H_CTL_COURSE_SLEW_INCREMENT /* slew severe course changes (i.e. waypoint moves, block changes or perpendicular routes) */ static float h_ctl_course_slew_rate = 0.; - float nav_angle_saturation = -(h_ctl_roll_max_setpoint/h_ctl_course_pgain); /* heading error corresponding to max_roll */ + float nav_angle_saturation = h_ctl_roll_max_setpoint/h_ctl_course_pgain; /* heading error corresponding to max_roll */ float half_nav_angle_saturation = nav_angle_saturation / 2.; if (launch) { /* prevent accumulator run-up on the ground */ if (err > half_nav_angle_saturation) { @@ -270,7 +271,7 @@ void h_ctl_course_loop ( void ) { float speed_depend_nav = estimator_hspeed_mod/NOMINAL_AIRSPEED; Bound(speed_depend_nav, 0.66, 1.5); - float cmd = h_ctl_course_pgain * speed_depend_nav * (err + d_err * h_ctl_course_dgain); + float cmd = -h_ctl_course_pgain * speed_depend_nav * (err + d_err * h_ctl_course_dgain); @@ -280,11 +281,11 @@ void h_ctl_course_loop ( void ) { if (v_ctl_auto_throttle_submode == V_CTL_AUTO_THROTTLE_AGRESSIVE || V_CTL_AUTO_THROTTLE_BLENDED) { BoundAbs(cmd, h_ctl_roll_max_setpoint); /* bound cmd before NAV_RATIO and again after */ if (v_ctl_altitude_error < 0) { - nav_ratio = AGR_CLIMB_NAV_RATIO + (1 - AGR_CLIMB_NAV_RATIO) * (1 - (fabs(v_ctl_altitude_error) - AGR_BLEND_END) / (AGR_BLEND_START - AGR_BLEND_END)); - Bound (nav_ratio, AGR_CLIMB_NAV_RATIO, 1); + nav_ratio = AGR_CLIMB_NAV_RATIO + (1 - AGR_CLIMB_NAV_RATIO) * (1 - (fabs(v_ctl_altitude_error) - AGR_BLEND_END) / (AGR_BLEND_START - AGR_BLEND_END)); + Bound (nav_ratio, AGR_CLIMB_NAV_RATIO, 1); } else { - nav_ratio = AGR_DESCENT_NAV_RATIO + (1 - AGR_DESCENT_NAV_RATIO) * (1 - (fabs(v_ctl_altitude_error) - AGR_BLEND_END) / (AGR_BLEND_START - AGR_BLEND_END)); - Bound (nav_ratio, AGR_DESCENT_NAV_RATIO, 1); + nav_ratio = AGR_DESCENT_NAV_RATIO + (1 - AGR_DESCENT_NAV_RATIO) * (1 - (fabs(v_ctl_altitude_error) - AGR_BLEND_END) / (AGR_BLEND_START - AGR_BLEND_END)); + Bound (nav_ratio, AGR_DESCENT_NAV_RATIO, 1); } cmd *= nav_ratio; } @@ -320,8 +321,8 @@ inline static void h_ctl_roll_loop( void ) { estimator_p = (err - last_err)/(1/60.); last_err = err; #endif - float cmd = - h_ctl_roll_attitude_gain * err - - h_ctl_roll_rate_gain * estimator_p + float cmd = h_ctl_roll_attitude_gain * err + + h_ctl_roll_rate_gain * estimator_p + v_ctl_throttle_setpoint * h_ctl_aileron_of_throttle; h_ctl_aileron_setpoint = TRIM_PPRZ(cmd); @@ -421,9 +422,7 @@ inline static void h_ctl_pitch_loop( void ) { if (h_ctl_elevator_of_roll <0.) h_ctl_elevator_of_roll = 0.; - h_ctl_pitch_loop_setpoint = - h_ctl_pitch_setpoint - - h_ctl_elevator_of_roll / h_ctl_pitch_pgain * fabs(estimator_phi); + h_ctl_pitch_loop_setpoint = h_ctl_pitch_setpoint + h_ctl_elevator_of_roll / h_ctl_pitch_pgain * fabs(estimator_phi); float err = 0; @@ -446,7 +445,7 @@ inline static void h_ctl_pitch_loop( void ) { float d_err = err - last_err; last_err = err; - float cmd = h_ctl_pitch_pgain * (err + h_ctl_pitch_dgain * d_err); + float cmd = -h_ctl_pitch_pgain * (err + h_ctl_pitch_dgain * d_err); #ifdef LOITER_TRIM cmd += loiter(); #endif diff --git a/sw/airborne/firmwares/logger/main_logger.c b/sw/airborne/firmwares/logger/main_logger.c index 27c54ddca7..bf3af136e2 100644 --- a/sw/airborne/firmwares/logger/main_logger.c +++ b/sw/airborne/firmwares/logger/main_logger.c @@ -104,6 +104,31 @@ #define LOG_STOP_KEY 7 #endif +/* +#ifndef POWER_DETECT_PIN +// Pin 0.10 +#define POWER_DETECT_PIN 6 +#endif + +#ifndef CARD_DETECT_PIN +// Pin 1.20 +#define CARD_DETECT_PIN 20 +#endif +*/ + +#ifndef LED_GREEN +#define LED_GREEN 3 +#endif + +#ifndef LED_YELLOW +#define LED_YELLOW 2 +#endif + +#ifndef LED_RED +#define LED_RED 1 +#endif + + /* USB Vbus (= P0.23) */ #define VBUS_PIN 23 @@ -391,7 +416,7 @@ int do_log(void) } /* write to SD until key is pressed */ - while ((IO0PIN & _BV(LOG_STOP_KEY))>>LOG_STOP_KEY) + while ((IO0PIN & (1<>LOG_STOP_KEY) { #ifdef USE_MAX11040 @@ -469,6 +494,40 @@ int main(void) int waitloop, ledcount; main_init(); +#ifdef _DEBUG_BOARD_ + while(1) + { + if (IO0PIN & (1 << LOG_STOP_KEY)) + { + LED_ON(LED_YELLOW); + } + else + { + LED_OFF(LED_YELLOW); + } + + if (IO1PIN & (1 << CARD_DETECT_PIN)) + { + LED_OFF(LED_GREEN); + } + else + { + LED_ON(LED_GREEN); + } + + if (IO0PIN & (1 << POWER_DETECT_PIN)) +// if (IO0PIN & (1 << VBUS_PIN)) + { + LED_ON(LED_RED); + } + else + { + LED_OFF(LED_RED); + } + } +#endif + + while(1) { LED_ON(2); diff --git a/sw/airborne/firmwares/rotorcraft/actuators.h b/sw/airborne/firmwares/rotorcraft/actuators.h index 23d7988fa4..e8d0c056d1 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators.h +++ b/sw/airborne/firmwares/rotorcraft/actuators.h @@ -1,9 +1,32 @@ +/* + * Copyright (C) 2010-2012 The Paparazzi Team + * + * This file is part of paparazzi. + * + * paparazzi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * paparazzi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * 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. + */ + +/** @file actuators.h + * Generic Actuators API. + */ + #ifndef ACTUATORS_H #define ACTUATORS_H //#include ACTUATORS -//#include "booz2_servos_direct_hw.h" -//#include "booz2_control_surfaces.h" #include "std.h" diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.c b/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.c index fc55a64aa2..3a2e203e2e 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.c +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.c @@ -1,3 +1,28 @@ +/* + * Copyright (C) 2008-2009 Antoine Drouin + * + * This file is part of paparazzi. + * + * paparazzi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * paparazzi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * 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. + */ + +/** @file actuators_asctec.c + * Actuators driver for Asctec motor controllers. + */ + #include "firmwares/rotorcraft/actuators.h" #include "firmwares/rotorcraft/actuators/actuators_asctec.h" diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.h b/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.h index 9b9dc58916..8a7ddddeef 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.h +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_asctec.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,26 +19,30 @@ * Boston, MA 02111-1307, USA. */ +/** @file actuators_asctec.h + * Actuators driver for Asctec motor controllers. + */ + #ifndef ACTUATORS_ASCTEC_H #define ACTUATORS_ASCTEC_H #include "mcu_periph/i2c.h" enum actuators_astec_cmd { NONE, - TEST, - REVERSE, - SET_ADDR }; + TEST, + REVERSE, + SET_ADDR }; enum actuators_astec_addr { FRONT, - BACK, - LEFT, - RIGHT }; + BACK, + LEFT, + RIGHT }; /* this is for the v1 protocol which does its own mixing */ enum actuators_astec_cmds { PITCH, - ROLL, - YAW, - THRUST, + ROLL, + YAW, + THRUST, CMD_NB }; struct ActuatorsAsctec { @@ -56,16 +58,16 @@ struct ActuatorsAsctec { extern struct ActuatorsAsctec actuators_asctec; #define actuators_asctec_SetCommand(_v) { \ - actuators_asctec.cmd = _v; \ -} + actuators_asctec.cmd = _v; \ + } -#define actuators_asctec_SetNewAddr(_v) { \ - actuators_asctec.new_addr = _v; \ -} +#define actuators_asctec_SetNewAddr(_v) { \ + actuators_asctec.new_addr = _v; \ + } -#define actuators_asctec_SetCurAddr(_v) { \ - actuators_asctec.cur_addr = _v; \ -} +#define actuators_asctec_SetCurAddr(_v) { \ + actuators_asctec.cur_addr = _v; \ + } #endif /* ACTUATORS_ASCTEC_H */ diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.c b/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.c index 57289b61dc..3a037eba0d 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.c +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,6 +19,10 @@ * Boston, MA 02111-1307, USA. */ +/** @file actuators_mkk.c + * Actuators driver for Mikrokopter motor controllers. + */ + #include "firmwares/rotorcraft/actuators.h" #include "firmwares/rotorcraft/actuators/actuators_mkk.h" diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.h b/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.h index 77b36eb980..a4e5e41f76 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.h +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_mkk.h @@ -1,6 +1,4 @@ /* - * $Id: actuators_mkk.h 3847 2009-08-02 21:47:31Z poine $ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,6 +19,10 @@ * Boston, MA 02111-1307, USA. */ +/** @file actuators_mkk.h + * Actuators driver for Mikrokopter motor controllers. + */ + #ifndef ACTUATORS_MKK_H #define ACTUATORS_MKK_H diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.c b/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.c index 4647b682f6..d794984c8b 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.c +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.c @@ -1,7 +1,5 @@ /* - * $Id$ - * - * Copyright (C) 2010 The Paparazzi Team + * Copyright (C) 2010-2012 The Paparazzi Team * * This file is part of paparazzi. * @@ -21,6 +19,10 @@ * Boston, MA 02111-1307, USA. */ +/** @file actuators_pwm_supervision.h + * PWM actuators with supervision. + */ + #include "firmwares/rotorcraft/actuators.h" #include "firmwares/rotorcraft/commands.h" #include "actuators_pwm_supervision.h" @@ -33,8 +35,9 @@ #define actuators actuators_pwm_values #define Actuator(_x) actuators_pwm_values[_x] -#define ActuatorsCommit() do { } while(0); +#define ActuatorsCommit() {} +/** actuator PWM values in usec. */ int32_t actuators_pwm_values[ACTUATORS_PWM_NB]; void actuators_init(void) @@ -43,28 +46,16 @@ void actuators_init(void) actuators_pwm_arch_init(); } -#define PWM_GAIN_SCALE 2 - void actuators_set(bool_t motors_on) { - int32_t pwm_commands[COMMANDS_NB]; - int32_t pwm_commands_pprz[COMMANDS_NB]; - int32_t booz2_commands[COMMANDS_NB]; - pwm_commands[COMMAND_ROLL] = commands[COMMAND_ROLL] * PWM_GAIN_SCALE; - pwm_commands[COMMAND_PITCH] = commands[COMMAND_PITCH] * PWM_GAIN_SCALE; - pwm_commands[COMMAND_YAW] = commands[COMMAND_YAW] * PWM_GAIN_SCALE; - pwm_commands[COMMAND_THRUST] = (commands[COMMAND_THRUST] * ((SUPERVISION_MAX_MOTOR - SUPERVISION_MIN_MOTOR) / 200)) + SUPERVISION_MIN_MOTOR; + /* set normal control surface actuators, i.e. servos */ + SetActuatorsFromCommands(commands); - pwm_commands_pprz[COMMAND_ROLL] = commands[COMMAND_ROLL] * (MAX_PPRZ / 100); - pwm_commands_pprz[COMMAND_PITCH] = commands[COMMAND_PITCH] * (MAX_PPRZ / 100); - pwm_commands_pprz[COMMAND_YAW] = commands[COMMAND_YAW] * (MAX_PPRZ / 100); - - supervision_run(motors_on, FALSE, pwm_commands); - - SetActuatorsFromCommands(pwm_commands_pprz); + /* run supervision for actuators (motor controllers) that need mixing */ + supervision_run(motors_on, FALSE, commands); for (int i = 0; i < SUPERVISION_NB_MOTOR; i++) { - actuators_pwm_values[i] = supervision.commands[i]; + actuators_pwm_values[i] = supervision.commands[i]; } actuators_pwm_commit(); diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.h b/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.h index cf10740cc2..eead17f8c9 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.h +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_pwm_supervision.h @@ -1,7 +1,5 @@ /* - * $Id: actuators_pwm_supervision$ - * - * Copyright (C) 2010 The Paparazzi Team + * Copyright (C) 2010-2012 The Paparazzi Team * * This file is part of paparazzi. * @@ -19,7 +17,10 @@ * 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. - * + */ + +/** @file actuators_pwm_supervision.h + * PWM actuators with supervision. */ #ifndef ACTUATORS_PWM_SUPERVISION_H diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.c b/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.c index 7948a7b5db..b7a3aec3fa 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.c +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.c @@ -19,6 +19,10 @@ * Boston, MA 02111-1307, USA. */ +/** @file actuators_skiron.c + * Skiron motor speed controller by Michel. + */ + #include "firmwares/rotorcraft/actuators.h" #include "firmwares/rotorcraft/actuators/actuators_skiron.h" diff --git a/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.h b/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.h index 3fc746e967..04c559b6c7 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.h +++ b/sw/airborne/firmwares/rotorcraft/actuators/actuators_skiron.h @@ -19,7 +19,9 @@ * Boston, MA 02111-1307, USA. */ -/* Skiron motor speed controller by Michel */ +/** @file actuators_skiron.h + * Skiron motor speed controller by Michel. + */ #ifndef ACTUATORS_SKIRON_H #define ACTUATORS_SKIRON_H diff --git a/sw/airborne/firmwares/rotorcraft/actuators/arch/stm32/actuators_pwm_arch.c b/sw/airborne/firmwares/rotorcraft/actuators/arch/stm32/actuators_pwm_arch.c index 4766fa4b2f..bfd3ee204f 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/arch/stm32/actuators_pwm_arch.c +++ b/sw/airborne/firmwares/rotorcraft/actuators/arch/stm32/actuators_pwm_arch.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2010 The Paparazzi Team * * This file is part of Paparazzi. @@ -19,7 +17,10 @@ * 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. - * + */ + +/** @file arch/stm32/actuators_pwm_arch.c + * STM32 PWM servos handling */ #include "firmwares/rotorcraft/actuators/actuators_pwm.h" diff --git a/sw/airborne/firmwares/rotorcraft/actuators/arch/stm32/actuators_pwm_arch.h b/sw/airborne/firmwares/rotorcraft/actuators/arch/stm32/actuators_pwm_arch.h index 867cb006e8..480dd466c6 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/arch/stm32/actuators_pwm_arch.h +++ b/sw/airborne/firmwares/rotorcraft/actuators/arch/stm32/actuators_pwm_arch.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2010 The Paparazzi Team * * This file is part of Paparazzi. @@ -19,11 +17,10 @@ * 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. - * */ -/* - * STM32 PWM servos handling +/** @file arch/stm32/actuators_pwm_arch.h + * STM32 PWM servos handling */ #ifndef ACTUATORS_PWM_ARCH_H diff --git a/sw/airborne/firmwares/rotorcraft/actuators/supervision.c b/sw/airborne/firmwares/rotorcraft/actuators/supervision.c index 30ce41af55..41fb17c3cf 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/supervision.c +++ b/sw/airborne/firmwares/rotorcraft/actuators/supervision.c @@ -1,7 +1,5 @@ /* - * $Id$ - * - * Copyright (C) 2008-2010 The Paparazzi Team + * Copyright (C) 2008-2012 The Paparazzi Team * * This file is part of Paparazzi. * @@ -19,7 +17,12 @@ * 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. - * + */ + +/** @file supervision.c + * Supervision. + * Handles the mapping of roll/pitch/yaw commands + * to actual motor commands. */ #include "firmwares/rotorcraft/actuators/supervision.h" @@ -55,6 +58,13 @@ */ #endif +/** total supervision command scale. + * scales a command input [-MAX_PPRZ,MAX_PPRZ] + * to the final supervision motor command with range of + * [0,SUPERVISION_MAX_MOTOR-SUPERVISION_MIN_MOTOR] + */ +#define SUPERVISION_CMD_SCALE (((SUPERVISION_MAX_MOTOR - SUPERVISION_MIN_MOTOR) / MAX_PPRZ) /SUPERVISION_SCALE) + static const int32_t roll_coef[SUPERVISION_NB_MOTOR] = SUPERVISION_ROLL_COEF; static const int32_t pitch_coef[SUPERVISION_NB_MOTOR] = SUPERVISION_PITCH_COEF; static const int32_t yaw_coef[SUPERVISION_NB_MOTOR] = SUPERVISION_YAW_COEF; @@ -147,7 +157,7 @@ void supervision_run(bool_t motors_on, bool_t override_on, int32_t in_cmd[] ) { roll_coef[i] * in_cmd[COMMAND_ROLL] + pitch_coef[i] * in_cmd[COMMAND_PITCH] + yaw_coef[i] * in_cmd[COMMAND_YAW] + - supervision.trim[i]) / SUPERVISION_SCALE; + supervision.trim[i] + SUPERVISION_MIN_MOTOR) * SUPERVISION_CMD_SCALE; if (supervision.commands[i] < min_cmd) min_cmd = supervision.commands[i]; if (supervision.commands[i] > max_cmd) @@ -163,8 +173,8 @@ void supervision_run(bool_t motors_on, bool_t override_on, int32_t in_cmd[] ) { /* For testing motor failure */ if (motors_on && override_on) { for (i = 0; i < SUPERVISION_NB_MOTOR; i++) { - if (supervision.override_enabled[i]) - supervision.commands[i] = supervision.override_value[i]; + if (supervision.override_enabled[i]) + supervision.commands[i] = supervision.override_value[i]; } } bound_commands(); diff --git a/sw/airborne/firmwares/rotorcraft/actuators/supervision.h b/sw/airborne/firmwares/rotorcraft/actuators/supervision.h index e8aa343c0b..66621af8eb 100644 --- a/sw/airborne/firmwares/rotorcraft/actuators/supervision.h +++ b/sw/airborne/firmwares/rotorcraft/actuators/supervision.h @@ -1,3 +1,30 @@ +/* + * Copyright (C) 2008-2012 The Paparazzi Team + * + * This file is part of Paparazzi. + * + * Paparazzi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * Paparazzi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * 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. + */ + +/** @file supervision.h + * Supervision. + * Handles the mapping of roll/pitch/yaw commands + * to actual motor commands. + */ + #ifndef SUPERVISION_H #define SUPERVISION_H diff --git a/sw/airborne/firmwares/rotorcraft/autopilot.h b/sw/airborne/firmwares/rotorcraft/autopilot.h index ad9bc6f23f..82cf02b576 100644 --- a/sw/airborne/firmwares/rotorcraft/autopilot.h +++ b/sw/airborne/firmwares/rotorcraft/autopilot.h @@ -45,7 +45,7 @@ #define AP_MODE_HOVER_CLIMB 10 #define AP_MODE_HOVER_Z_HOLD 11 #define AP_MODE_NAV 12 -#define AP_MODE_RC_DIRECT 13 // Safety Pilot Direct Commands for helicopter direct control: appropriately chosen as mode "13" +#define AP_MODE_RC_DIRECT 13 // Safety Pilot Direct Commands for helicopter direct control: appropriately chosen as mode "13" extern uint8_t autopilot_mode; diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c index 21287d7801..3672a58e1c 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,13 +19,18 @@ * Boston, MA 02111-1307, USA. */ +/** @file firmware/rotorcraft/guidance/guidance_h.c + * Horizontal guidance for rotorcrafts. + * + */ + #define GUIDANCE_H_C -//#define GUIDANCE_H_USE_REF 1 + #include "firmwares/rotorcraft/guidance/guidance_h.h" -#include "subsystems/ahrs.h" #include "firmwares/rotorcraft/stabilization.h" -// #include "booz_fms.h" FIXME +#include "firmwares/rotorcraft/stabilization/stabilization_attitude_rc_setpoint.h" +#include "subsystems/ahrs.h" #include "subsystems/ins.h" #include "firmwares/rotorcraft/navigation.h" @@ -54,19 +57,26 @@ struct Int32Eulers guidance_h_command_body; int32_t guidance_h_pgain; int32_t guidance_h_dgain; int32_t guidance_h_igain; -int32_t guidance_h_ngain; int32_t guidance_h_again; -#ifndef GUIDANCE_H_NGAIN -#define GUIDANCE_H_NGAIN 0 +/* warn if some gains are still negative */ +#if (GUIDANCE_H_PGAIN < 0) || \ + (GUIDANCE_H_DGAIN < 0) || \ + (GUIDANCE_H_IGAIN < 0) +#warning "ALL control gains are now positive!!!" #endif + #ifndef GUIDANCE_H_AGAIN #define GUIDANCE_H_AGAIN 0 +#else +#if (GUIDANCE_H_AGAIN < 0) +#warning "ALL control gains are now positive!!!" +#endif #endif -static inline void guidance_h_hover_run(void); -static inline void guidance_h_nav_run(bool_t in_flight); +static inline void guidance_h_update_reference(bool_t use_ref); +static inline void guidance_h_traj_run(bool_t in_flight); static inline void guidance_h_hover_enter(void); static inline void guidance_h_nav_enter(void); @@ -89,7 +99,6 @@ void guidance_h_init(void) { guidance_h_pgain = GUIDANCE_H_PGAIN; guidance_h_igain = GUIDANCE_H_IGAIN; guidance_h_dgain = GUIDANCE_H_DGAIN; - guidance_h_ngain = GUIDANCE_H_NGAIN; guidance_h_again = GUIDANCE_H_AGAIN; } @@ -99,14 +108,6 @@ void guidance_h_mode_changed(uint8_t new_mode) { if (new_mode == guidance_h_mode) return; - switch ( guidance_h_mode ) { - // case GUIDANCE_H_MODE_RATE: - // stabilization_rate_exit(); - // break; - default: - break; - } - switch (new_mode) { case GUIDANCE_H_MODE_RC_DIRECT: @@ -154,12 +155,12 @@ void guidance_h_read_rc(bool_t in_flight) { break; case GUIDANCE_H_MODE_HOVER: - stabilization_attitude_read_rc_ref(&guidance_h_rc_sp, in_flight); + stabilization_attitude_read_rc_setpoint_eulers(&guidance_h_rc_sp, in_flight); break; case GUIDANCE_H_MODE_NAV: if (radio_control.status == RC_OK) { - stabilization_attitude_read_rc_ref(&guidance_h_rc_sp, in_flight); + stabilization_attitude_read_rc_setpoint_eulers(&guidance_h_rc_sp, in_flight); guidance_h_rc_sp.psi = 0; } else { @@ -189,7 +190,8 @@ void guidance_h_run(bool_t in_flight) { break; case GUIDANCE_H_MODE_HOVER: - guidance_h_hover_run(); + guidance_h_update_reference(FALSE); + guidance_h_traj_run(in_flight); stabilization_attitude_run(in_flight); break; @@ -198,21 +200,20 @@ void guidance_h_run(bool_t in_flight) { if (!in_flight) guidance_h_nav_enter(); if (horizontal_mode == HORIZONTAL_MODE_ATTITUDE) { -#ifndef STABILISATION_ATTITUDE_TYPE_FLOAT - stab_att_sp_euler.phi = nav_roll << (REF_ANGLE_FRAC - INT32_ANGLE_FRAC); - stab_att_sp_euler.theta = nav_pitch << (REF_ANGLE_FRAC - INT32_ANGLE_FRAC); + stab_att_sp_euler.phi = nav_roll; + stab_att_sp_euler.theta = nav_pitch; +#ifdef STABILISATION_ATTITUDE_TYPE_QUAT + INT32_QUAT_OF_EULERS(stab_att_sp_quat, stab_att_sp_euler); + INT32_QUAT_WRAP_SHORTEST(stab_att_sp_quat); #endif } else { INT32_VECT2_NED_OF_ENU(guidance_h_pos_sp, navigation_carrot); -#if GUIDANCE_H_USE_REF - b2_gh_update_ref_from_pos_sp(guidance_h_pos_sp); -#endif -#ifndef STABILISATION_ATTITUDE_TYPE_FLOAT - guidance_h_psi_sp = (nav_heading << (REF_ANGLE_FRAC - INT32_ANGLE_FRAC)); -#endif - //guidance_h_hover_run(); - guidance_h_nav_run(in_flight); + + guidance_h_update_reference(TRUE); + + guidance_h_psi_sp = nav_heading; + guidance_h_traj_run(in_flight); } stabilization_attitude_run(in_flight); break; @@ -221,145 +222,75 @@ void guidance_h_run(bool_t in_flight) { break; } - - } -#define MAX_POS_ERR POS_BFP_OF_REAL(16.) -#define MAX_SPEED_ERR SPEED_BFP_OF_REAL(16.) -#define MAX_POS_ERR_SUM ((int32_t)(MAX_POS_ERR)<< 12) - -// 15 degres -//#define MAX_BANK (65536) -#define MAX_BANK (98000) - -__attribute__ ((always_inline)) static inline void guidance_h_hover_run(void) { - - /* compute position error */ - VECT2_DIFF(guidance_h_pos_err, ins_ltp_pos, guidance_h_pos_sp); - /* saturate it */ - VECT2_STRIM(guidance_h_pos_err, -MAX_POS_ERR, MAX_POS_ERR); - - /* compute speed error */ - VECT2_COPY(guidance_h_speed_err, ins_ltp_speed); - /* saturate it */ - VECT2_STRIM(guidance_h_speed_err, -MAX_SPEED_ERR, MAX_SPEED_ERR); - - /* update pos error integral */ - VECT2_ADD(guidance_h_pos_err_sum, guidance_h_pos_err); - /* saturate it */ - VECT2_STRIM(guidance_h_pos_err_sum, -MAX_POS_ERR_SUM, MAX_POS_ERR_SUM); - - /* run PID */ - // cmd_earth < 15.17 - guidance_h_command_earth.x = - guidance_h_pgain * (guidance_h_pos_err.x << (10 - INT32_POS_FRAC)) + - guidance_h_dgain * (guidance_h_speed_err.x >> (INT32_SPEED_FRAC - 10)) + - guidance_h_igain * (guidance_h_pos_err_sum.x >> (12 + INT32_POS_FRAC - 10)); - guidance_h_command_earth.y = - guidance_h_pgain * (guidance_h_pos_err.y << (10 - INT32_POS_FRAC)) + - guidance_h_dgain * (guidance_h_speed_err.y >> (INT32_SPEED_FRAC - 10)) + - guidance_h_igain * (guidance_h_pos_err_sum.y >> (12 + INT32_POS_FRAC - 10)); - - VECT2_STRIM(guidance_h_command_earth, -MAX_BANK, MAX_BANK); - - /* Rotate to body frame */ - int32_t s_psi, c_psi; - PPRZ_ITRIG_SIN(s_psi, ahrs.ltp_to_body_euler.psi); - PPRZ_ITRIG_COS(c_psi, ahrs.ltp_to_body_euler.psi); - - - // INT32_TRIG_FRAC - 2: 100mm erreur, gain 100 -> 10000 command | 2 degres = 36000, so multiply by 4 - guidance_h_command_body.phi = - ( - s_psi * guidance_h_command_earth.x + c_psi * guidance_h_command_earth.y) - >> (INT32_TRIG_FRAC - 2); - guidance_h_command_body.theta = - - ( c_psi * guidance_h_command_earth.x + s_psi * guidance_h_command_earth.y) - >> (INT32_TRIG_FRAC - 2); - - - guidance_h_command_body.phi += guidance_h_rc_sp.phi; - guidance_h_command_body.theta += guidance_h_rc_sp.theta; - guidance_h_command_body.psi = guidance_h_psi_sp + guidance_h_rc_sp.psi; -#ifndef STABILISATION_ATTITUDE_TYPE_FLOAT - ANGLE_REF_NORMALIZE(guidance_h_command_body.psi); -#endif /* STABILISATION_ATTITUDE_TYPE_FLOAT */ - - EULERS_COPY(stab_att_sp_euler, guidance_h_command_body); - -} - -// 20 degres -> 367002 (0.35 << 20) -#define NAV_MAX_BANK BFP_OF_REAL(0.35,REF_ANGLE_FRAC) -#define HOLD_DISTANCE POS_BFP_OF_REAL(10.) - -__attribute__ ((always_inline)) static inline void guidance_h_nav_run(bool_t in_flight) { - +static inline void guidance_h_update_reference(bool_t use_ref) { /* convert our reference to generic representation */ #if GUIDANCE_H_USE_REF - INT32_VECT2_RSHIFT(guidance_h_pos_ref, b2_gh_pos_ref, (B2_GH_POS_REF_FRAC - INT32_POS_FRAC)); - INT32_VECT2_LSHIFT(guidance_h_speed_ref, b2_gh_speed_ref, (INT32_SPEED_FRAC - B2_GH_SPEED_REF_FRAC)); - INT32_VECT2_LSHIFT(guidance_h_accel_ref, b2_gh_accel_ref, (INT32_ACCEL_FRAC - B2_GH_ACCEL_REF_FRAC)); + if (use_ref) { + b2_gh_update_ref_from_pos_sp(guidance_h_pos_sp); + INT32_VECT2_RSHIFT(guidance_h_pos_ref, b2_gh_pos_ref, (B2_GH_POS_REF_FRAC - INT32_POS_FRAC)); + INT32_VECT2_LSHIFT(guidance_h_speed_ref, b2_gh_speed_ref, (INT32_SPEED_FRAC - B2_GH_SPEED_REF_FRAC)); + INT32_VECT2_LSHIFT(guidance_h_accel_ref, b2_gh_accel_ref, (INT32_ACCEL_FRAC - B2_GH_ACCEL_REF_FRAC)); + } else { + VECT2_COPY(guidance_h_pos_ref, guidance_h_pos_sp); + INT_VECT2_ZERO(guidance_h_speed_ref); + INT_VECT2_ZERO(guidance_h_accel_ref); + } #else VECT2_COPY(guidance_h_pos_ref, guidance_h_pos_sp); INT_VECT2_ZERO(guidance_h_speed_ref); INT_VECT2_ZERO(guidance_h_accel_ref); #endif +} + + +#define MAX_POS_ERR POS_BFP_OF_REAL(16.) +#define MAX_SPEED_ERR SPEED_BFP_OF_REAL(16.) +#define MAX_POS_ERR_SUM ((int32_t)(MAX_POS_ERR)<< 12) + +/* with a pgain of 100 and a scale of 2, + * you get an angle of 5.6 degrees for 1m pos error */ +#define GH_GAIN_SCALE 2 + +// FIXME: set in airframe file, instead of hardcoded value here +/** maximum bank angle: 20 deg */ +#define TRAJ_MAX_BANK BFP_OF_REAL(0.35, INT32_ANGLE_FRAC) + +static inline void guidance_h_traj_run(bool_t in_flight) { /* compute position error */ - VECT2_DIFF(guidance_h_pos_err, ins_ltp_pos, guidance_h_pos_ref); + VECT2_DIFF(guidance_h_pos_err, guidance_h_pos_ref, ins_ltp_pos); /* saturate it */ VECT2_STRIM(guidance_h_pos_err, -MAX_POS_ERR, MAX_POS_ERR); /* compute speed error */ - //VECT2_COPY(guidance_h_speed_err, ins_ltp_speed); - VECT2_DIFF(guidance_h_speed_err, ins_ltp_speed, guidance_h_speed_ref); + VECT2_DIFF(guidance_h_speed_err, guidance_h_speed_ref, ins_ltp_speed); /* saturate it */ VECT2_STRIM(guidance_h_speed_err, -MAX_SPEED_ERR, MAX_SPEED_ERR); - int32_t dist; - INT32_VECT2_NORM(dist, guidance_h_pos_err); - if ( dist < HOLD_DISTANCE ) { // Hold position - /* update pos error integral */ + /* update pos error integral, zero it if not in_flight */ + if (in_flight) { VECT2_ADD(guidance_h_pos_err_sum, guidance_h_pos_err); /* saturate it */ VECT2_STRIM(guidance_h_pos_err_sum, -MAX_POS_ERR_SUM, MAX_POS_ERR_SUM); - INT_VECT2_ZERO(guidance_h_nav_err); + } else { + INT_VECT2_ZERO(guidance_h_pos_err_sum); } - else { // Tracking algorithm, no integral - int32_t vect_prod = 0; - int32_t scal_prod = ins_ltp_speed.x * guidance_h_pos_err.x + ins_ltp_speed.y * guidance_h_pos_err.y; - // compute vectorial product only if angle < pi/2 (scalar product > 0) - if (scal_prod >= 0) { - vect_prod = ((ins_ltp_speed.x * guidance_h_pos_err.y) >> (INT32_POS_FRAC + INT32_SPEED_FRAC - 10)) - - ((ins_ltp_speed.y * guidance_h_pos_err.x) >> (INT32_POS_FRAC + INT32_SPEED_FRAC - 10)); - } - // multiply by vector orthogonal to speed - VECT2_ASSIGN(guidance_h_nav_err, - vect_prod * (-ins_ltp_speed.y), - vect_prod * ins_ltp_speed.x); - // divide by 2 times dist ( >> 16 ) - VECT2_SDIV(guidance_h_nav_err, guidance_h_nav_err, dist*dist); - // *2 ?? - } - if (!in_flight) { INT_VECT2_ZERO(guidance_h_pos_err_sum); } /* run PID */ guidance_h_command_earth.x = - guidance_h_pgain * (guidance_h_pos_err.x << (10 - INT32_POS_FRAC)) + - guidance_h_dgain * (guidance_h_speed_err.x >> (INT32_SPEED_FRAC - 10)) + - guidance_h_igain * (guidance_h_pos_err_sum.x >> (12 + INT32_POS_FRAC - 10)) + - guidance_h_ngain * guidance_h_nav_err.x + + guidance_h_pgain * (guidance_h_pos_err.x >> (INT32_POS_FRAC - GH_GAIN_SCALE)) + + guidance_h_dgain * (guidance_h_speed_err.x >> (INT32_SPEED_FRAC - GH_GAIN_SCALE)) + + guidance_h_igain * (guidance_h_pos_err_sum.x >> (12 + INT32_POS_FRAC - GH_GAIN_SCALE)) + guidance_h_again * guidance_h_accel_ref.x; /* feedforward gain */ guidance_h_command_earth.y = - guidance_h_pgain * (guidance_h_pos_err.y << (10 - INT32_POS_FRAC)) + - guidance_h_dgain * (guidance_h_speed_err.y >> (INT32_SPEED_FRAC - 10)) + - guidance_h_igain * (guidance_h_pos_err_sum.y >> (12 + INT32_POS_FRAC - 10)) + - guidance_h_ngain * guidance_h_nav_err.y + + guidance_h_pgain * (guidance_h_pos_err.y << (INT32_POS_FRAC - GH_GAIN_SCALE)) + + guidance_h_dgain * (guidance_h_speed_err.y >> (INT32_SPEED_FRAC - GH_GAIN_SCALE)) + + guidance_h_igain * (guidance_h_pos_err_sum.y >> (12 + INT32_POS_FRAC - GH_GAIN_SCALE)) + guidance_h_again * guidance_h_accel_ref.y; /* feedforward gain */ - VECT2_STRIM(guidance_h_command_earth, -NAV_MAX_BANK, NAV_MAX_BANK); - INT32_VECT2_RSHIFT(guidance_h_command_earth, guidance_h_command_earth, REF_ANGLE_FRAC - 16); // Reduice to 16 for trigo operation + VECT2_STRIM(guidance_h_command_earth, -TRAJ_MAX_BANK, TRAJ_MAX_BANK); /* Rotate to body frame */ int32_t s_psi, c_psi; @@ -368,35 +299,39 @@ __attribute__ ((always_inline)) static inline void guidance_h_nav_run(bool_t in // Restore angle ref resolution after rotation guidance_h_command_body.phi = - ( - s_psi * guidance_h_command_earth.x + c_psi * guidance_h_command_earth.y) >> (INT32_TRIG_FRAC - (REF_ANGLE_FRAC - 16)); + ( - s_psi * guidance_h_command_earth.x + c_psi * guidance_h_command_earth.y) >> INT32_TRIG_FRAC; guidance_h_command_body.theta = - - ( c_psi * guidance_h_command_earth.x + s_psi * guidance_h_command_earth.y) >> (INT32_TRIG_FRAC - (REF_ANGLE_FRAC - 16)); + - ( c_psi * guidance_h_command_earth.x + s_psi * guidance_h_command_earth.y) >> INT32_TRIG_FRAC; - // Add RC setpoint - guidance_h_command_body.phi += guidance_h_rc_sp.phi; - guidance_h_command_body.theta += guidance_h_rc_sp.theta; - guidance_h_command_body.psi = guidance_h_psi_sp + guidance_h_rc_sp.psi; - ANGLE_REF_NORMALIZE(guidance_h_command_body.psi); + guidance_h_command_body.psi = guidance_h_psi_sp; + + /* Add RC setpoint */ + EULERS_ADD(guidance_h_command_body, guidance_h_rc_sp); + + INT32_ANGLE_NORMALIZE(guidance_h_command_body.psi); /* Set attitude setpoint in eulers and as quaternion */ EULERS_COPY(stab_att_sp_euler, guidance_h_command_body); + #ifdef STABILISATION_ATTITUDE_TYPE_QUAT INT32_QUAT_OF_EULERS(stab_att_sp_quat, stab_att_sp_euler); -#endif + INT32_QUAT_WRAP_SHORTEST(stab_att_sp_quat); +#endif /* STABILISATION_ATTITUDE_TYPE_QUAT */ } -__attribute__ ((always_inline)) static inline void guidance_h_hover_enter(void) { +static inline void guidance_h_hover_enter(void) { VECT2_COPY(guidance_h_pos_sp, ins_ltp_pos); - STABILIZATION_ATTITUDE_RESET_PSI_REF( guidance_h_rc_sp ); + guidance_h_rc_sp.psi = ahrs.ltp_to_body_euler.psi; + reset_psi_ref_from_body(); INT_VECT2_ZERO(guidance_h_pos_err_sum); } -__attribute__ ((always_inline)) static inline void guidance_h_nav_enter(void) { +static inline void guidance_h_nav_enter(void) { INT32_VECT2_NED_OF_ENU(guidance_h_pos_sp, navigation_carrot); struct Int32Vect2 pos,speed,zero; @@ -405,12 +340,14 @@ __attribute__ ((always_inline)) static inline void guidance_h_nav_enter(void) { VECT2_COPY(speed, ins_ltp_speed); GuidanceHSetRef(pos, speed, zero); - struct Int32Eulers tmp_sp; - STABILIZATION_ATTITUDE_RESET_PSI_REF( tmp_sp ); - guidance_h_psi_sp = tmp_sp.psi; -#ifndef STABILISATION_ATTITUDE_TYPE_FLOAT - nav_heading = (guidance_h_psi_sp >> (REF_ANGLE_FRAC - INT32_ANGLE_FRAC)); -#endif /* STABILISATION_ATTITUDE_TYPE_FLOAT */ + /* reset psi reference, set psi setpoint to current psi */ + reset_psi_ref_from_body(); + guidance_h_rc_sp.psi = ahrs.ltp_to_body_euler.psi; + guidance_h_psi_sp = ahrs.ltp_to_body_euler.psi; + nav_heading = guidance_h_psi_sp; + + /* set RC heading setpoint to zero, + * since that is added to guidance_h_psi_sp later */ guidance_h_rc_sp.psi = 0; INT_VECT2_ZERO(guidance_h_pos_err_sum); diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.h b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.h index 20a761d987..fce55121db 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.h +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,6 +19,11 @@ * Boston, MA 02111-1307, USA. */ +/** @file firmware/rotorcraft/guidance/guidance_h.h + * Horizontal guidance for rotorcrafts. + * + */ + #ifndef GUIDANCE_H_H #define GUIDANCE_H_H @@ -39,10 +42,13 @@ extern uint8_t guidance_h_mode; -/* horizontal setpoint in NED */ -/* Q_int32_xx_8 */ +/** horizontal position setpoint in NED. + * fixed point representation: Q23.8 + * accuracy 0.0039, range 8388km + */ extern struct Int32Vect2 guidance_h_pos_sp; -extern int32_t guidance_h_psi_sp; + +extern int32_t guidance_h_psi_sp; ///< with #INT32_ANGLE_FRAC extern struct Int32Vect2 guidance_h_pos_ref; extern struct Int32Vect2 guidance_h_speed_ref; extern struct Int32Vect2 guidance_h_accel_ref; @@ -52,14 +58,13 @@ extern struct Int32Vect2 guidance_h_speed_err; extern struct Int32Vect2 guidance_h_pos_err_sum; extern struct Int32Vect2 guidance_h_nav_err; -extern struct Int32Eulers guidance_h_rc_sp; -extern struct Int32Vect2 guidance_h_command_earth; -extern struct Int32Eulers guidance_h_command_body; +extern struct Int32Eulers guidance_h_rc_sp; ///< with #INT32_ANGLE_FRAC +extern struct Int32Vect2 guidance_h_command_earth; +extern struct Int32Eulers guidance_h_command_body; ///< with #INT32_ANGLE_FRAC extern int32_t guidance_h_pgain; extern int32_t guidance_h_dgain; extern int32_t guidance_h_igain; -extern int32_t guidance_h_ngain; extern int32_t guidance_h_again; diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h_ref.h b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h_ref.h index 1536d9c76b..93d944cf99 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h_ref.h +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h_ref.h @@ -1,6 +1,4 @@ /* - * $Id: guidance_v_ref.h 4173 2009-09-18 11:57:21Z flixr $ - * * Copyright (C) 2008-2009 ENAC * * This file is part of paparazzi. @@ -21,6 +19,11 @@ * Boston, MA 02111-1307, USA. */ +/** @file firmware/rotorcraft/guidance/guidance_h_ref.h + * Reference generation for horizontal guidance. + * + */ + #ifndef GUIDANCE_H_REF_H #define GUIDANCE_H_REF_H diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c index 71cf416a4a..7666b0e6c7 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,6 +19,11 @@ * Boston, MA 02111-1307, USA. */ +/** @file firmwares/rotorcraft/guidance/guidance_v.c + * Vertical guidance for rotorcrafts. + * + */ + #define GUIDANCE_V_C #define GUIDANCE_V_USE_REF 1 #include "firmwares/rotorcraft/guidance/guidance_v.h" @@ -37,6 +40,15 @@ #include "generated/airframe.h" + +/* warn if some gains are still negative */ +#if (GUIDANCE_V_HOVER_KP < 0) || \ + (GUIDANCE_V_HOVER_KD < 0) || \ + (GUIDANCE_V_HOVER_KI < 0) +#warning "ALL control gains are now positive!!!" +#endif + + uint8_t guidance_v_mode; int32_t guidance_v_ff_cmd; int32_t guidance_v_fb_cmd; @@ -44,7 +56,7 @@ int32_t guidance_v_delta_t; /** Direct throttle from radio control. - * range 0:200 + * range 0:#MAX_PPRZ */ int32_t guidance_v_rc_delta_t; @@ -94,9 +106,10 @@ void guidance_v_init(void) { void guidance_v_read_rc(void) { - // used in RC_DIRECT directly and as saturation in CLIMB and HOVER - guidance_v_rc_delta_t = (int32_t)radio_control.values[RADIO_THROTTLE] * (SUPERVISION_MAX_MOTOR - SUPERVISION_MIN_MOTOR) / MAX_PPRZ; - // used in RC_CLIMB + /* used in RC_DIRECT directly and as saturation in CLIMB and HOVER */ + guidance_v_rc_delta_t = (int32_t)radio_control.values[RADIO_THROTTLE]; + + /* used in RC_CLIMB */ guidance_v_rc_zd_sp = ((MAX_PPRZ/2) - (int32_t)radio_control.values[RADIO_THROTTLE]) * GUIDANCE_V_RC_CLIMB_COEF; DeadBand(guidance_v_rc_zd_sp, GUIDANCE_V_RC_CLIMB_DEAD_BAND); @@ -127,8 +140,9 @@ void guidance_v_mode_changed(uint8_t new_mode) { } void guidance_v_notify_in_flight( bool_t in_flight) { - if (in_flight) + if (in_flight) { gv_adapt_init(); + } } @@ -157,8 +171,9 @@ void guidance_v_run(bool_t in_flight) { case GUIDANCE_V_MODE_CLIMB: #if USE_FMS - if (fms.enabled && fms.input.v_mode == GUIDANCE_V_MODE_CLIMB) + if (fms.enabled && fms.input.v_mode == GUIDANCE_V_MODE_CLIMB) { guidance_v_zd_sp = fms.input.v_sp.climb; + } #endif gv_update_ref_from_zd_sp(guidance_v_zd_sp); run_hover_loop(in_flight); @@ -166,7 +181,7 @@ void guidance_v_run(bool_t in_flight) { 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); + stabilization_cmd[COMMAND_THRUST] = Min(guidance_v_rc_delta_t, guidance_v_delta_t); #endif break; @@ -181,7 +196,7 @@ void guidance_v_run(bool_t in_flight) { 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); + stabilization_cmd[COMMAND_THRUST] = Min(guidance_v_rc_delta_t, guidance_v_delta_t); #endif break; @@ -207,7 +222,7 @@ void guidance_v_run(bool_t in_flight) { #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); + stabilization_cmd[COMMAND_THRUST] = Min(guidance_v_rc_delta_t, guidance_v_delta_t); else stabilization_cmd[COMMAND_THRUST] = guidance_v_delta_t; #endif @@ -231,9 +246,9 @@ __attribute__ ((always_inline)) static inline void run_hover_loop(bool_t in_flig guidance_v_zd_ref = gv_zd_ref<<(INT32_SPEED_FRAC - GV_ZD_REF_FRAC); guidance_v_zdd_ref = gv_zdd_ref<<(INT32_ACCEL_FRAC - GV_ZDD_REF_FRAC); /* compute the error to our reference */ - int32_t err_z = ins_ltp_pos.z - guidance_v_z_ref; + int32_t err_z = guidance_v_z_ref - ins_ltp_pos.z; Bound(err_z, GUIDANCE_V_MIN_ERR_Z, GUIDANCE_V_MAX_ERR_Z); - int32_t err_zd = ins_ltp_speed.z - guidance_v_zd_ref; + int32_t err_zd = guidance_v_zd_ref - ins_ltp_speed.z; Bound(err_zd, GUIDANCE_V_MIN_ERR_ZD, GUIDANCE_V_MAX_ERR_ZD); if (in_flight) { @@ -261,11 +276,16 @@ __attribute__ ((always_inline)) static inline void run_hover_loop(bool_t in_flig /* feed forward command */ guidance_v_ff_cmd = (guidance_v_ff_cmd << INT32_TRIG_FRAC) / cphitheta; + /* our error feed back command */ + /* z-axis pointing down -> positive error means we need less thrust */ guidance_v_fb_cmd = ((-guidance_v_kp * err_z) >> 12) + ((-guidance_v_kd * err_zd) >> 21) + ((-guidance_v_ki * guidance_v_z_sum_err) >> 21); guidance_v_delta_t = guidance_v_ff_cmd + guidance_v_fb_cmd; + /* bound the result */ + Bound(guidance_v_delta_t, 0, MAX_PPRZ); + } diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.h b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.h index ca39608b06..ded9bd3500 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.h +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v.h @@ -19,6 +19,11 @@ * Boston, MA 02111-1307, USA. */ +/** @file firmwares/rotorcraft/guidance/guidance_v.h + * Vertical guidance for rotorcrafts. + * + */ + #ifndef GUIDANCE_V #define GUIDANCE_V @@ -82,7 +87,12 @@ extern int32_t guidance_v_zdd_ref; extern int32_t guidance_v_z_sum_err; ///< accumulator for I-gain extern int32_t guidance_v_ff_cmd; ///< feed-forward command extern int32_t guidance_v_fb_cmd; ///< feed-back command -extern int32_t guidance_v_delta_t; ///< command output (ff+fb) + +/** thrust command. + * summation of feed-forward and feed-back commands, + * valid range 0 : #MAX_PPRZ + */ +extern int32_t guidance_v_delta_t; extern int32_t guidance_v_kp; ///< vertical control P-gain extern int32_t guidance_v_kd; ///< vertical control D-gain diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_adpt.h b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_adpt.h index 8039527984..8b5cf0491c 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_adpt.h +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_adpt.h @@ -30,6 +30,8 @@ #ifndef GUIDANCE_V_ADPT #define GUIDANCE_V_ADPT +#include "paparazzi.h" + /** Adapt noise factor. * Smaller values will make the filter to adapter faster * Bigger values (slower adaptation) make the filter more robust to external perturbations @@ -46,7 +48,7 @@ #define GUIDANCE_V_ADAPT_MAX_ACCEL 4.0 #endif -/** Filter is not fed if command values are out of a % of MIN/MAX_SUPERVISION +/** Filter is not fed if command values are out of a % of 0/MAX_PPRZ * MAX_CMD and MIN_CMD must be between 0 and 1 with MIN_CMD < MAX_CMD */ #ifndef GUIDANCE_V_ADAPT_MAX_CMD @@ -100,8 +102,8 @@ int32_t gv_adapt_Xmeas; #define GV_ADAPT_MAX_ACCEL ACCEL_BFP_OF_REAL(GUIDANCE_V_ADAPT_MAX_ACCEL) /* Command bounds */ -#define GV_ADAPT_MAX_CMD ((int32_t)Blend(SUPERVISION_MAX_MOTOR, SUPERVISION_MIN_MOTOR, GUIDANCE_V_ADAPT_MAX_CMD)) -#define GV_ADAPT_MIN_CMD ((int32_t)Blend(SUPERVISION_MAX_MOTOR, SUPERVISION_MIN_MOTOR, GUIDANCE_V_ADAPT_MIN_CMD)) +#define GV_ADAPT_MAX_CMD ((int32_t)(GUIDANCE_V_ADAPT_MAX_CMD*MAX_PPRZ)) +#define GV_ADAPT_MIN_CMD ((int32_t)(GUIDANCE_V_ADAPT_MIN_CMD*MAX_PPRZ)) /* Output bounds. * Don't let it climb over a value that would @@ -114,8 +116,8 @@ int32_t gv_adapt_Xmeas; * 9.81*2^18/1 = 2571632 */ // TODO Check this properly -#define GV_ADAPT_MAX_OUT (BFP_OF_REAL(9.81, GV_ADAPT_X_FRAC) / SUPERVISION_MIN_MOTOR) -#define GV_ADAPT_MIN_OUT (BFP_OF_REAL(9.81, GV_ADAPT_X_FRAC) / SUPERVISION_MAX_MOTOR) +#define GV_ADAPT_MAX_OUT (BFP_OF_REAL(9.81, GV_ADAPT_X_FRAC)) +#define GV_ADAPT_MIN_OUT (BFP_OF_REAL(9.81, GV_ADAPT_X_FRAC) / MAX_PPRZ) static inline void gv_adapt_init(void) { @@ -127,7 +129,7 @@ static inline void gv_adapt_init(void) { /** Adaptation function. * @param zdd_meas vert accel measurement in m/s^2 with #INT32_ACCEL_FRAC - * @param thrust_applied controller input [SUPERVISION_MIN_MOTOR, SUPERVISION_MAX_MOTOR] + * @param thrust_applied controller input [0 : MAX_PPRZ] * @param zd_ref vertical speed reference in m/s with #INT32_SPEED_FRAC */ static inline void gv_adapt_run(int32_t zdd_meas, int32_t thrust_applied, int32_t zd_ref) { diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_ref.h b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_ref.h index 171acc679d..695d6f1a23 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_ref.h +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_v_ref.h @@ -19,6 +19,11 @@ * Boston, MA 02111-1307, USA. */ +/** @file firwmares/rotorcraft/guidance/guidance_v_ref.h + * Reference generation for vertical guidance. + * + */ + #ifndef GUIDANCE_V_REF_H #define GUIDANCE_V_REF_H diff --git a/sw/airborne/firmwares/rotorcraft/main.c b/sw/airborne/firmwares/rotorcraft/main.c index a7f542760f..5c0d5696b5 100644 --- a/sw/airborne/firmwares/rotorcraft/main.c +++ b/sw/airborne/firmwares/rotorcraft/main.c @@ -37,7 +37,11 @@ #include "firmwares/rotorcraft/commands.h" #include "firmwares/rotorcraft/actuators.h" + +#if defined RADIO_CONTROL #include "subsystems/radio_control.h" +#pragma message "CAUTION! RadioControl roll and yaw channel inputs have been reversed to follow aerospace sign conventions.\n You will have to change your radio control xml file to get a positive value when pushing roll stick right and a positive value when pushing yaw stick right!" +#endif #include "subsystems/imu.h" #include "subsystems/gps.h" diff --git a/sw/airborne/firmwares/rotorcraft/navigation.h b/sw/airborne/firmwares/rotorcraft/navigation.h index 5ce687f4cf..5ec26c7ff8 100644 --- a/sw/airborne/firmwares/rotorcraft/navigation.h +++ b/sw/airborne/firmwares/rotorcraft/navigation.h @@ -54,8 +54,8 @@ extern int32_t nav_circle_radius, nav_circle_qdr, nav_circle_radians; #define HORIZONTAL_MODE_ROUTE 1 #define HORIZONTAL_MODE_CIRCLE 2 #define HORIZONTAL_MODE_ATTITUDE 3 -extern int32_t nav_roll, nav_pitch; -extern int32_t nav_heading, nav_course; +extern int32_t nav_roll, nav_pitch; ///< with #INT32_ANGLE_FRAC +extern int32_t nav_heading, nav_course; ///< with #INT32_ANGLE_FRAC extern float nav_radius; extern uint8_t vertical_mode; diff --git a/sw/airborne/firmwares/rotorcraft/stabilization.c b/sw/airborne/firmwares/rotorcraft/stabilization.c index 449d30eff3..e2cbfc39ef 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,6 +19,10 @@ * Boston, MA 02111-1307, USA. */ +/** @file firmwares/rotorcraft/stabilization.c + * General stabilization interface for rotorcrafts. + */ + #include "firmwares/rotorcraft/stabilization.h" int32_t stabilization_cmd[COMMANDS_NB]; diff --git a/sw/airborne/firmwares/rotorcraft/stabilization.h b/sw/airborne/firmwares/rotorcraft/stabilization.h index fae6fa0b06..d693e6a1f0 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization.h +++ b/sw/airborne/firmwares/rotorcraft/stabilization.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,6 +19,10 @@ * Boston, MA 02111-1307, USA. */ +/** @file firmwares/rotorcraft/stabilization.h + * General stabilization interface for rotorcrafts. + */ + #ifndef STABILIZATION_H #define STABILIZATION_H @@ -35,6 +37,11 @@ extern void stabilization_init(void); +/** Stabilization commands. + * Contains the resulting stabilization commands, + * regardless of whether rate or attitude is currently used. + * Range -MAX_PPRZ:MAX_PPRZ + */ extern int32_t stabilization_cmd[COMMANDS_NB]; #endif /* STABILIZATION_H */ diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/quat_setpoint_int.c b/sw/airborne/firmwares/rotorcraft/stabilization/quat_setpoint_int.c index 10b3029f05..173fe3454f 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/quat_setpoint_int.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization/quat_setpoint_int.c @@ -21,6 +21,13 @@ #define QUAT_SETPOINT_HOVER_PITCH RadOfDeg(90) +#define ROLL_COEF (STABILIZATION_ATTITUDE_SP_MAX_PHI / MAX_PPRZ) +#define PITCH_COEF (STABILIZATION_ATTITUDE_SP_MAX_THETA / MAX_PPRZ) +#define YAW_COEF (STABILIZATION_ATTITUDE_SP_MAX_PSI / MAX_PPRZ) + +#define DEADBAND_EXCEEDED(VARIABLE, VALUE) ((VARIABLE > VALUE) || (VARIABLE < -VALUE)) +#define APPLY_DEADBAND(VARIABLE, VALUE) (DEADBAND_EXCEEDED(VARIABLE, VALUE) ? VARIABLE : 0.0) + // reset to "hover" setpoint static void reset_sp_quat(int32_t _psi, int32_t _theta, struct Int32Quat *initial) { 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 daf738ed93..6139806670 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_euler_float.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_euler_float.c @@ -31,6 +31,20 @@ struct FloatAttitudeGains stabilization_gains; + +/* warn if some gains are still negative */ +#if (STABILIZATION_ATTITUDE_FLOAT_PHI_PGAIN < 0) || \ + (STABILIZATION_ATTITUDE_FLOAT_THETA_PGAIN < 0) || \ + (STABILIZATION_ATTITUDE_FLOAT_PSI_PGAIN < 0) || \ + (STABILIZATION_ATTITUDE_FLOAT_PHI_DGAIN < 0) || \ + (STABILIZATION_ATTITUDE_FLOAT_THETA_DGAIN < 0) || \ + (STABILIZATION_ATTITUDE_FLOAT_PSI_DGAIN < 0) || \ + (STABILIZATION_ATTITUDE_FLOAT_PHI_IGAIN < 0) || \ + (STABILIZATION_ATTITUDE_FLOAT_THETA_IGAIN < 0) || \ + (STABILIZATION_ATTITUDE_FLOAT_PSI_IGAIN < 0) +#warning "ALL control gains are now positive!!!" +#endif + struct FloatEulers stabilization_att_sum_err; float stabilization_att_fb_cmd[COMMANDS_NB]; @@ -42,24 +56,24 @@ void stabilization_attitude_init(void) { stabilization_attitude_ref_init(); VECT3_ASSIGN(stabilization_gains.p, - STABILIZATION_ATTITUDE_FLOAT_PHI_PGAIN, - STABILIZATION_ATTITUDE_FLOAT_THETA_PGAIN, - STABILIZATION_ATTITUDE_FLOAT_PSI_PGAIN); + STABILIZATION_ATTITUDE_FLOAT_PHI_PGAIN, + STABILIZATION_ATTITUDE_FLOAT_THETA_PGAIN, + STABILIZATION_ATTITUDE_FLOAT_PSI_PGAIN); VECT3_ASSIGN(stabilization_gains.d, - STABILIZATION_ATTITUDE_FLOAT_PHI_DGAIN, - STABILIZATION_ATTITUDE_FLOAT_THETA_DGAIN, - STABILIZATION_ATTITUDE_FLOAT_PSI_DGAIN); + STABILIZATION_ATTITUDE_FLOAT_PHI_DGAIN, + STABILIZATION_ATTITUDE_FLOAT_THETA_DGAIN, + STABILIZATION_ATTITUDE_FLOAT_PSI_DGAIN); VECT3_ASSIGN(stabilization_gains.i, - STABILIZATION_ATTITUDE_FLOAT_PHI_IGAIN, - STABILIZATION_ATTITUDE_FLOAT_THETA_IGAIN, - STABILIZATION_ATTITUDE_FLOAT_PSI_IGAIN); + STABILIZATION_ATTITUDE_FLOAT_PHI_IGAIN, + STABILIZATION_ATTITUDE_FLOAT_THETA_IGAIN, + STABILIZATION_ATTITUDE_FLOAT_PSI_IGAIN); VECT3_ASSIGN(stabilization_gains.dd, - STABILIZATION_ATTITUDE_FLOAT_PHI_DDGAIN, - STABILIZATION_ATTITUDE_FLOAT_THETA_DDGAIN, - STABILIZATION_ATTITUDE_FLOAT_PSI_DDGAIN); + STABILIZATION_ATTITUDE_FLOAT_PHI_DDGAIN, + STABILIZATION_ATTITUDE_FLOAT_THETA_DDGAIN, + STABILIZATION_ATTITUDE_FLOAT_PSI_DDGAIN); FLOAT_EULERS_ZERO( stabilization_att_sum_err ); @@ -100,7 +114,7 @@ void stabilization_attitude_run(bool_t in_flight) { struct FloatEulers att_float; EULERS_FLOAT_OF_BFP(att_float, ahrs.ltp_to_body_euler); struct FloatEulers att_err; - EULERS_DIFF(att_err, att_float, stab_att_ref_euler); + EULERS_DIFF(att_err, stab_att_ref_euler, att_float); FLOAT_ANGLE_NORMALIZE(att_err.psi); if (in_flight) { @@ -116,7 +130,7 @@ void stabilization_attitude_run(bool_t in_flight) { struct FloatRates rate_float; RATES_FLOAT_OF_BFP(rate_float, ahrs.body_rate); struct FloatRates rate_err; - RATES_DIFF(rate_err, rate_float, stab_att_ref_rate); + RATES_DIFF(rate_err, stab_att_ref_rate, rate_float); /* PID */ 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 4524917124..78cd52dda4 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_euler_int.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_euler_int.c @@ -23,12 +23,25 @@ #include "subsystems/ahrs.h" #include "subsystems/radio_control.h" - +#include "firmwares/rotorcraft/stabilization/stabilization_attitude_rc_setpoint.h" #include "generated/airframe.h" struct Int32AttitudeGains stabilization_gains; +/* warn if some gains are still negative */ +#if (STABILIZATION_ATTITUDE_PHI_PGAIN < 0) || \ + (STABILIZATION_ATTITUDE_THETA_PGAIN < 0) || \ + (STABILIZATION_ATTITUDE_PSI_PGAIN < 0) || \ + (STABILIZATION_ATTITUDE_PHI_DGAIN < 0) || \ + (STABILIZATION_ATTITUDE_THETA_DGAIN < 0) || \ + (STABILIZATION_ATTITUDE_PSI_DGAIN < 0) || \ + (STABILIZATION_ATTITUDE_PHI_IGAIN < 0) || \ + (STABILIZATION_ATTITUDE_THETA_IGAIN < 0) || \ + (STABILIZATION_ATTITUDE_PSI_IGAIN < 0) +#warning "ALL control gains are now positive!!!" +#endif + struct Int32Eulers stabilization_att_sum_err; int32_t stabilization_att_fb_cmd[COMMANDS_NB]; @@ -40,24 +53,24 @@ void stabilization_attitude_init(void) { VECT3_ASSIGN(stabilization_gains.p, - STABILIZATION_ATTITUDE_PHI_PGAIN, - STABILIZATION_ATTITUDE_THETA_PGAIN, - STABILIZATION_ATTITUDE_PSI_PGAIN); + STABILIZATION_ATTITUDE_PHI_PGAIN, + STABILIZATION_ATTITUDE_THETA_PGAIN, + STABILIZATION_ATTITUDE_PSI_PGAIN); VECT3_ASSIGN(stabilization_gains.d, - STABILIZATION_ATTITUDE_PHI_DGAIN, - STABILIZATION_ATTITUDE_THETA_DGAIN, - STABILIZATION_ATTITUDE_PSI_DGAIN); + STABILIZATION_ATTITUDE_PHI_DGAIN, + STABILIZATION_ATTITUDE_THETA_DGAIN, + STABILIZATION_ATTITUDE_PSI_DGAIN); VECT3_ASSIGN(stabilization_gains.i, - STABILIZATION_ATTITUDE_PHI_IGAIN, - STABILIZATION_ATTITUDE_THETA_IGAIN, - STABILIZATION_ATTITUDE_PSI_IGAIN); + STABILIZATION_ATTITUDE_PHI_IGAIN, + STABILIZATION_ATTITUDE_THETA_IGAIN, + STABILIZATION_ATTITUDE_PSI_IGAIN); VECT3_ASSIGN(stabilization_gains.dd, - STABILIZATION_ATTITUDE_PHI_DDGAIN, - STABILIZATION_ATTITUDE_THETA_DDGAIN, - STABILIZATION_ATTITUDE_PSI_DDGAIN); + STABILIZATION_ATTITUDE_PHI_DDGAIN, + STABILIZATION_ATTITUDE_THETA_DDGAIN, + STABILIZATION_ATTITUDE_PSI_DDGAIN); INT_EULERS_ZERO( stabilization_att_sum_err ); @@ -67,14 +80,15 @@ void stabilization_attitude_init(void) { void stabilization_attitude_read_rc(bool_t in_flight) { - stabilization_attitude_read_rc_ref(&stab_att_sp_euler, in_flight); + stabilization_attitude_read_rc_setpoint_eulers(&stab_att_sp_euler, in_flight); } void stabilization_attitude_enter(void) { - STABILIZATION_ATTITUDE_RESET_PSI_REF( stab_att_sp_euler ); + stab_att_sp_euler.psi = ahrs.ltp_to_body_euler.psi; + reset_psi_ref_from_body(); INT_EULERS_ZERO( stabilization_att_sum_err ); } @@ -106,7 +120,7 @@ void stabilization_attitude_run(bool_t in_flight) { OFFSET_AND_ROUND(stab_att_ref_euler.theta, (REF_ANGLE_FRAC - INT32_ANGLE_FRAC)), OFFSET_AND_ROUND(stab_att_ref_euler.psi, (REF_ANGLE_FRAC - INT32_ANGLE_FRAC)) }; struct Int32Eulers att_err; - EULERS_DIFF(att_err, ahrs.ltp_to_body_euler, att_ref_scaled); + EULERS_DIFF(att_err, att_ref_scaled, ahrs.ltp_to_body_euler); INT32_ANGLE_NORMALIZE(att_err.psi); if (in_flight) { @@ -124,7 +138,7 @@ void stabilization_attitude_run(bool_t in_flight) { OFFSET_AND_ROUND(stab_att_ref_rate.q, (REF_RATE_FRAC - INT32_RATE_FRAC)), OFFSET_AND_ROUND(stab_att_ref_rate.r, (REF_RATE_FRAC - INT32_RATE_FRAC)) }; struct Int32Rates rate_err; - RATES_DIFF(rate_err, ahrs.body_rate, rate_ref_scaled); + RATES_DIFF(rate_err, rate_ref_scaled, ahrs.body_rate); /* PID */ stabilization_att_fb_cmd[COMMAND_ROLL] = @@ -143,6 +157,8 @@ void stabilization_attitude_run(bool_t in_flight) { OFFSET_AND_ROUND2((stabilization_gains.i.z * stabilization_att_sum_err.psi), 10); + + //FIXME: still needed? for what? #ifdef USE_HELI #define CMD_SHIFT 12 #else @@ -159,4 +175,9 @@ void stabilization_attitude_run(bool_t in_flight) { stabilization_cmd[COMMAND_YAW] = OFFSET_AND_ROUND((stabilization_att_fb_cmd[COMMAND_YAW]+stabilization_att_ff_cmd[COMMAND_YAW]), CMD_SHIFT); + /* bound the result */ + BoundAbs(stabilization_cmd[COMMAND_ROLL], MAX_PPRZ); + BoundAbs(stabilization_cmd[COMMAND_PITCH], MAX_PPRZ); + BoundAbs(stabilization_cmd[COMMAND_YAW], MAX_PPRZ); + } 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 ca4ad1535f..ba6cfe3167 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_quat_float.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_quat_float.c @@ -35,6 +35,19 @@ struct FloatAttitudeGains stabilization_gains[STABILIZATION_ATTITUDE_FLOAT_GAIN_NB]; +/* warn if some gains are still negative */ +#if (STABILIZATION_ATTITUDE_FLOAT_PHI_PGAIN < 0) || \ + (STABILIZATION_ATTITUDE_FLOAT_THETA_PGAIN < 0) || \ + (STABILIZATION_ATTITUDE_FLOAT_PSI_PGAIN < 0) || \ + (STABILIZATION_ATTITUDE_FLOAT_PHI_DGAIN < 0) || \ + (STABILIZATION_ATTITUDE_FLOAT_THETA_DGAIN < 0) || \ + (STABILIZATION_ATTITUDE_FLOAT_PSI_DGAIN < 0) || \ + (STABILIZATION_ATTITUDE_FLOAT_PHI_IGAIN < 0) || \ + (STABILIZATION_ATTITUDE_FLOAT_THETA_IGAIN < 0) || \ + (STABILIZATION_ATTITUDE_FLOAT_PSI_IGAIN < 0) +#warning "ALL control gains are now positive!!!" +#endif + struct FloatQuat stabilization_att_sum_err_quat; struct FloatEulers stabilization_att_sum_err_eulers; @@ -136,35 +149,35 @@ static void attitude_run_fb(float fb_commands[], struct FloatAttitudeGains *gain { /* PID feedback */ fb_commands[COMMAND_ROLL] = - GAIN_PRESCALER_P * -gains->p.x * att_err->qx + + GAIN_PRESCALER_P * gains->p.x * att_err->qx + GAIN_PRESCALER_D * gains->d.x * rate_err->p + GAIN_PRESCALER_D * gains->rates_d.x * rate_err_d->p + GAIN_PRESCALER_I * gains->i.x * sum_err->qx; fb_commands[COMMAND_PITCH] = - GAIN_PRESCALER_P * -gains->p.y * att_err->qy + + GAIN_PRESCALER_P * gains->p.y * att_err->qy + GAIN_PRESCALER_D * gains->d.y * rate_err->q + GAIN_PRESCALER_D * gains->rates_d.y * rate_err_d->q + GAIN_PRESCALER_I * gains->i.y * sum_err->qy; fb_commands[COMMAND_YAW] = - GAIN_PRESCALER_P * -gains->p.z * att_err->qz + + GAIN_PRESCALER_P * gains->p.z * att_err->qz + GAIN_PRESCALER_D * gains->d.z * rate_err->r + GAIN_PRESCALER_D * gains->rates_d.z * rate_err_d->r + GAIN_PRESCALER_I * gains->i.z * sum_err->qz; fb_commands[COMMAND_ROLL_SURFACE] = - GAIN_PRESCALER_P * -gains->surface_p.x * att_err->qx + + GAIN_PRESCALER_P * gains->surface_p.x * att_err->qx + GAIN_PRESCALER_D * gains->surface_d.x * rate_err->p + GAIN_PRESCALER_I * gains->surface_i.x * sum_err->qx; fb_commands[COMMAND_PITCH_SURFACE] = - GAIN_PRESCALER_P * -gains->surface_p.y * att_err->qy + + GAIN_PRESCALER_P * gains->surface_p.y * att_err->qy + GAIN_PRESCALER_D * gains->surface_d.y * rate_err->q + GAIN_PRESCALER_I * gains->surface_i.y * sum_err->qy; fb_commands[COMMAND_YAW_SURFACE] = - GAIN_PRESCALER_P * -gains->surface_p.z * att_err->qz + + GAIN_PRESCALER_P * gains->surface_p.z * att_err->qz + GAIN_PRESCALER_D * gains->surface_d.z * rate_err->r + GAIN_PRESCALER_I * gains->surface_i.z * sum_err->qz; @@ -189,7 +202,7 @@ void stabilization_attitude_run(bool_t enable_integrator) { /* rate error */ struct FloatRates rate_err; - RATES_DIFF(rate_err, ahrs_float.body_rate, stab_att_ref_rate); + RATES_DIFF(rate_err, stab_att_ref_rate, ahrs_float.body_rate); /* integrated error */ if (enable_integrator) { @@ -199,7 +212,7 @@ void stabilization_attitude_run(bool_t enable_integrator) { scaled_att_err.qx = att_err.qx / IERROR_SCALE; scaled_att_err.qy = att_err.qy / IERROR_SCALE; scaled_att_err.qz = att_err.qz / IERROR_SCALE; - FLOAT_QUAT_COMP_INV(new_sum_err, stabilization_att_sum_err_quat, scaled_att_err); + FLOAT_QUAT_COMP(new_sum_err, stabilization_att_sum_err_quat, scaled_att_err); FLOAT_QUAT_NORMALIZE(new_sum_err); FLOAT_QUAT_COPY(stabilization_att_sum_err_quat, new_sum_err); FLOAT_EULERS_OF_QUAT(stabilization_att_sum_err_eulers, stabilization_att_sum_err_quat); diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_quat_int.c b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_quat_int.c index fc8942161a..2c4b8aefdd 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_quat_int.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_quat_int.c @@ -24,6 +24,7 @@ */ #include "firmwares/rotorcraft/stabilization.h" +#include "firmwares/rotorcraft/stabilization/stabilization_attitude_rc_setpoint.h" #if USE_SETPOINTS_WITH_TRANSITIONS #include "firmwares/rotorcraft/stabilization/quat_setpoint_int.h" @@ -42,6 +43,19 @@ struct Int32AttitudeGains stabilization_gains = { {STABILIZATION_ATTITUDE_PHI_IGAIN, STABILIZATION_ATTITUDE_THETA_IGAIN, STABILIZATION_ATTITUDE_PSI_IGAIN } }; +/* warn if some gains are still negative */ +#if (STABILIZATION_ATTITUDE_PHI_PGAIN < 0) || \ + (STABILIZATION_ATTITUDE_THETA_PGAIN < 0) || \ + (STABILIZATION_ATTITUDE_PSI_PGAIN < 0) || \ + (STABILIZATION_ATTITUDE_PHI_DGAIN < 0) || \ + (STABILIZATION_ATTITUDE_THETA_DGAIN < 0) || \ + (STABILIZATION_ATTITUDE_PSI_DGAIN < 0) || \ + (STABILIZATION_ATTITUDE_PHI_IGAIN < 0) || \ + (STABILIZATION_ATTITUDE_THETA_IGAIN < 0) || \ + (STABILIZATION_ATTITUDE_PSI_IGAIN < 0) +#warning "ALL control gains are now positive!!!" +#endif + struct Int32Quat stabilization_att_sum_err_quat; struct Int32Eulers stabilization_att_sum_err; @@ -92,17 +106,17 @@ static void attitude_run_fb(int32_t fb_commands[], struct Int32AttitudeGains *ga { /* PID feedback */ fb_commands[COMMAND_ROLL] = - GAIN_PRESCALER_P * -gains->p.x * QUAT1_FLOAT_OF_BFP(att_err->qx) / 4 + + GAIN_PRESCALER_P * gains->p.x * QUAT1_FLOAT_OF_BFP(att_err->qx) / 4 + GAIN_PRESCALER_D * gains->d.x * RATE_FLOAT_OF_BFP(rate_err->p) / 16 + GAIN_PRESCALER_I * gains->i.x * QUAT1_FLOAT_OF_BFP(sum_err->qx) / 2; fb_commands[COMMAND_PITCH] = - GAIN_PRESCALER_P * -gains->p.y * QUAT1_FLOAT_OF_BFP(att_err->qy) / 4 + + GAIN_PRESCALER_P * gains->p.y * QUAT1_FLOAT_OF_BFP(att_err->qy) / 4 + GAIN_PRESCALER_D * gains->d.y * RATE_FLOAT_OF_BFP(rate_err->q) / 16 + GAIN_PRESCALER_I * gains->i.y * QUAT1_FLOAT_OF_BFP(sum_err->qy) / 2; fb_commands[COMMAND_YAW] = - GAIN_PRESCALER_P * -gains->p.z * QUAT1_FLOAT_OF_BFP(att_err->qz) / 4 + + GAIN_PRESCALER_P * gains->p.z * QUAT1_FLOAT_OF_BFP(att_err->qz) / 4 + GAIN_PRESCALER_D * gains->d.z * RATE_FLOAT_OF_BFP(rate_err->r) / 16 + GAIN_PRESCALER_I * gains->i.z * QUAT1_FLOAT_OF_BFP(sum_err->qz) / 2; @@ -128,7 +142,7 @@ void stabilization_attitude_run(bool_t enable_integrator) { /* rate error */ struct Int32Rates rate_err; - RATES_DIFF(rate_err, ahrs.body_rate, stab_att_ref_rate); + RATES_DIFF(rate_err, stab_att_ref_rate, ahrs.body_rate); /* integrated error */ if (enable_integrator) { @@ -138,7 +152,7 @@ void stabilization_attitude_run(bool_t enable_integrator) { scaled_att_err.qx = att_err.qx / IERROR_SCALE; scaled_att_err.qy = att_err.qy / IERROR_SCALE; scaled_att_err.qz = att_err.qz / IERROR_SCALE; - INT32_QUAT_COMP_INV(new_sum_err, stabilization_att_sum_err_quat, scaled_att_err); + INT32_QUAT_COMP(new_sum_err, stabilization_att_sum_err_quat, scaled_att_err); INT32_QUAT_NORMALIZE(new_sum_err); QUAT_COPY(stabilization_att_sum_err_quat, new_sum_err); INT32_EULERS_OF_QUAT(stabilization_att_sum_err, stabilization_att_sum_err_quat); @@ -160,9 +174,9 @@ void stabilization_attitude_run(bool_t enable_integrator) { stabilization_cmd[COMMAND_YAW] = stabilization_att_fb_cmd[COMMAND_YAW] + stabilization_att_ff_cmd[COMMAND_YAW]; /* bound the result */ - Bound(stabilization_cmd[COMMAND_ROLL], -200, 200); - Bound(stabilization_cmd[COMMAND_PITCH], -200, 200); - Bound(stabilization_cmd[COMMAND_YAW], -200, 200); + BoundAbs(stabilization_cmd[COMMAND_ROLL], MAX_PPRZ); + BoundAbs(stabilization_cmd[COMMAND_PITCH], MAX_PPRZ); + BoundAbs(stabilization_cmd[COMMAND_YAW], MAX_PPRZ); } void stabilization_attitude_read_rc(bool_t in_flight) { @@ -170,7 +184,10 @@ void stabilization_attitude_read_rc(bool_t in_flight) { #if USE_SETPOINTS_WITH_TRANSITIONS stabilization_attitude_read_rc_absolute(in_flight); #else - stabilization_attitude_read_rc_setpoint(in_flight); + stabilization_attitude_read_rc_setpoint_eulers(&stab_att_sp_euler, in_flight); + /* update quaternion setpoint from euler setpoint */ + INT32_QUAT_OF_EULERS(stab_att_sp_quat, stab_att_sp_euler); + INT32_QUAT_WRAP_SHORTEST(stab_att_sp_quat); #endif } diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_rc_setpoint.h b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_rc_setpoint.h new file mode 100644 index 0000000000..460b6716c3 --- /dev/null +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_rc_setpoint.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2012 Felix Ruess + * + * This file is part of paparazzi. + * + * paparazzi is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * paparazzi is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * 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. + */ + +/** @file stabilization_attitude_rc_setpoint.h + * Read an attitude setpoint from the RC. + */ + +#ifndef STABILISATION_ATTITUDE_RC_SETPOINT_H +#define STABILISATION_ATTITUDE_RC_SETPOINT_H + +#include "generated/airframe.h" +#include "math/pprz_algebra_int.h" + +#include "subsystems/radio_control.h" +#include "subsystems/ahrs.h" + + +#define SP_MAX_PHI (int32_t)ANGLE_BFP_OF_REAL(STABILIZATION_ATTITUDE_SP_MAX_PHI) +#define SP_MAX_THETA (int32_t)ANGLE_BFP_OF_REAL(STABILIZATION_ATTITUDE_SP_MAX_THETA) +#define SP_MAX_R (int32_t)ANGLE_BFP_OF_REAL(STABILIZATION_ATTITUDE_SP_MAX_R) + +#define RC_UPDATE_FREQ 40 + +#define YAW_DEADBAND_EXCEEDED() \ + (radio_control.values[RADIO_YAW] > STABILIZATION_ATTITUDE_DEADBAND_R || \ + radio_control.values[RADIO_YAW] < -STABILIZATION_ATTITUDE_DEADBAND_R) + +static inline void stabilization_attitude_read_rc_setpoint_eulers(struct Int32Eulers *sp, bool_t in_flight) { + + sp->phi = ((int32_t) radio_control.values[RADIO_ROLL] * SP_MAX_PHI / MAX_PPRZ); + sp->theta = ((int32_t) radio_control.values[RADIO_PITCH] * SP_MAX_THETA / MAX_PPRZ); + + if (in_flight) { + if (YAW_DEADBAND_EXCEEDED()) { + sp->psi += ((int32_t) radio_control.values[RADIO_YAW] * SP_MAX_R / MAX_PPRZ / RC_UPDATE_FREQ); + INT32_ANGLE_NORMALIZE(sp->psi); + } + } + else { /* if not flying, use current yaw as setpoint */ + sp->psi = ahrs.ltp_to_body_euler.psi; + } + +} + + +#endif /* STABILISATION_ATTITUDE_RC_SETPOINT_H */ diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_euler_float.h b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_euler_float.h index 27f952a42d..bd3a6d2a49 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_euler_float.h +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_euler_float.h @@ -49,14 +49,12 @@ #define STABILIZATION_ATTITUDE_FLOAT_READ_RC(_sp, _inflight) { \ \ - _sp.phi = \ - (-radio_control.values[RADIO_ROLL] * SP_MAX_PHI / MAX_PPRZ); \ - _sp.theta = \ - ( radio_control.values[RADIO_PITCH] * SP_MAX_THETA / MAX_PPRZ); \ + _sp.phi = (radio_control.values[RADIO_ROLL] * SP_MAX_PHI / MAX_PPRZ); \ + _sp.theta = (radio_control.values[RADIO_PITCH] * SP_MAX_THETA / MAX_PPRZ); \ if (_inflight) { \ if (YAW_DEADBAND_EXCEEDED()) { \ _sp.psi += \ - (-radio_control.values[RADIO_YAW] * SP_MAX_R / MAX_PPRZ / RC_UPDATE_FREQ); \ + (radio_control.values[RADIO_YAW] * SP_MAX_R / MAX_PPRZ / RC_UPDATE_FREQ); \ FLOAT_ANGLE_NORMALIZE(_sp.psi); \ } \ } \ diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_euler_int.c b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_euler_int.c index de71614943..bbb464a251 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_euler_int.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_euler_int.c @@ -1,6 +1,4 @@ /* - * $Id: stabilization_attitude_ref_euler_int.h -1 $ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,9 +19,14 @@ * Boston, MA 02111-1307, USA. */ +/** @file stabilization_attitude_ref_euler_int.c + * Rotorcraft attitude reference generation (euler int version) + * + */ + #include "firmwares/rotorcraft/stabilization.h" -struct Int32Eulers stab_att_sp_euler; ///< with #REF_ANGLE_FRAC +struct Int32Eulers stab_att_sp_euler; struct Int32Eulers stab_att_ref_euler; ///< with #REF_ANGLE_FRAC struct Int32Rates stab_att_ref_rate; struct Int32Rates stab_att_ref_accel; @@ -69,6 +72,8 @@ void stabilization_attitude_ref_init(void) { #define OMEGA_2_R_RES 7 #define OMEGA_2_R BFP_OF_REAL((OMEGA_R*OMEGA_R), OMEGA_2_R_RES) + +/** explicitly define to zero to disable attitude reference generation */ #ifndef USE_ATTITUDE_REF #define USE_ATTITUDE_REF 1 #endif @@ -92,9 +97,13 @@ void stabilization_attitude_ref_update() { stab_att_ref_accel.r >> ( F_UPDATE_RES + REF_ACCEL_FRAC - REF_RATE_FRAC)}; RATES_ADD(stab_att_ref_rate, d_rate); + /* attitude setpoint with REF_ANGLE_FRAC */ + struct Int32Eulers sp_ref; + INT32_EULERS_LSHIFT(sp_ref, stab_att_sp_euler, (REF_ANGLE_FRAC - INT32_ANGLE_FRAC)); + /* compute reference attitude error */ struct Int32Eulers ref_err; - EULERS_DIFF(ref_err, stab_att_ref_euler, stab_att_sp_euler); + EULERS_DIFF(ref_err, stab_att_ref_euler, sp_ref); /* wrap it in the shortest direction */ ANGLE_REF_NORMALIZE(ref_err.psi); @@ -123,7 +132,7 @@ void stabilization_attitude_ref_update() { SATURATE_SPEED_TRIM_ACCEL(); #else /* !USE_ATTITUDE_REF */ - EULERS_COPY(stab_att_ref_euler, stab_att_sp_euler); + INT32_EULERS_LSHIFT(stab_att_ref_euler, stab_att_sp_euler, (REF_ANGLE_FRAC - INT32_ANGLE_FRAC)); INT_RATES_ZERO(stab_att_ref_rate); INT_RATES_ZERO(stab_att_ref_accel); #endif /* USE_ATTITUDE_REF */ diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_euler_int.h b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_euler_int.h index 66cc06fed0..8312acf2ff 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_euler_int.h +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_euler_int.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,21 +19,15 @@ * Boston, MA 02111-1307, USA. */ +/** @file stabilization_attitude_ref_euler_int.h + * Rotorcraft attitude reference generation (euler int version) + * + */ + #ifndef STABILIZATION_ATTITUDE_REF_EULER_INT_H #define STABILIZATION_ATTITUDE_REF_EULER_INT_H #include "stabilization_attitude_ref_int.h" -#define STABILIZATION_ATTITUDE_ADD_SP(_add_sp) { \ - EULERS_ADD(stab_att_sp_euler,_add_sp); \ - ANGLE_REF_NORMALIZE(stab_att_sp_euler.psi); \ - } - -#define STABILIZATION_ATTITUDE_RESET_PSI_REF(_sp) { \ - _sp.psi = ahrs.ltp_to_body_euler.psi << (REF_ANGLE_FRAC - INT32_ANGLE_FRAC); \ - stab_att_ref_euler.psi = _sp.psi; \ - stab_att_ref_rate.r = 0; \ - } - #endif /* STABILIZATION_ATTITUDE_REF_EULER_INT_H */ diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_int.h b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_int.h index ef6d03ab7d..8026b06828 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_int.h +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_int.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2010 The Paparazzi Team * * This file is part of paparazzi. @@ -20,22 +18,22 @@ * the Free Software Foundation, 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ + +/** @file stabilization_attitude_ref_int.h + * Rotorcraft attitude reference generation API. + * Common to all fixed-point reference generators (euler and quaternion) + */ + #ifndef STABILISATION_ATTITUDE_REF_INT_H #define STABILISATION_ATTITUDE_REF_INT_H -#include "generated/airframe.h" #include "math/pprz_algebra_int.h" -// FIXME: move stabilization_attitude_read_rc_ref somewere else, so we don't need these includes here??? -#include "subsystems/radio_control.h" #include "subsystems/ahrs.h" -/* - * CAUTION! stabilization euler has the euler angles with REF_ANGLE_FRAC, but stab quat with INT32_ANGLE_FRAC - */ -extern struct Int32Eulers stab_att_sp_euler; +extern struct Int32Eulers stab_att_sp_euler; ///< with #INT32_ANGLE_FRAC extern struct Int32Quat stab_att_sp_quat; ///< with #INT32_QUAT_FRAC -extern struct Int32Eulers stab_att_ref_euler; +extern struct Int32Eulers stab_att_ref_euler; ///< with #REF_ANGLE_FRAC extern struct Int32Quat stab_att_ref_quat; ///< with #INT32_QUAT_FRAC extern struct Int32Rates stab_att_ref_rate; ///< with #REF_RATE_FRAC extern struct Int32Rates stab_att_ref_accel; ///< with #REF_ACCEL_FRAC @@ -58,36 +56,11 @@ extern struct Int32RefModel stab_att_ref_model; while (_a < -REF_ANGLE_PI) _a += REF_ANGLE_TWO_PI; \ } -#define SP_MAX_PHI (int32_t)ANGLE_BFP_OF_REAL(STABILIZATION_ATTITUDE_SP_MAX_PHI) -#define SP_MAX_THETA (int32_t)ANGLE_BFP_OF_REAL(STABILIZATION_ATTITUDE_SP_MAX_THETA) -#define SP_MAX_R (int32_t)ANGLE_BFP_OF_REAL(STABILIZATION_ATTITUDE_SP_MAX_R) - - -#define RC_UPDATE_FREQ 40 - -#define YAW_DEADBAND_EXCEEDED() \ - (radio_control.values[RADIO_YAW] > STABILIZATION_ATTITUDE_DEADBAND_R || \ - radio_control.values[RADIO_YAW] < -STABILIZATION_ATTITUDE_DEADBAND_R) - -static inline void stabilization_attitude_read_rc_ref(struct Int32Eulers *sp, bool_t in_flight) { - - sp->phi = ((int32_t)-radio_control.values[RADIO_ROLL] * SP_MAX_PHI / MAX_PPRZ) - << (REF_ANGLE_FRAC - INT32_ANGLE_FRAC); - - sp->theta = ((int32_t) radio_control.values[RADIO_PITCH] * SP_MAX_THETA / MAX_PPRZ) - << (REF_ANGLE_FRAC - INT32_ANGLE_FRAC); - - if (in_flight) { - if (YAW_DEADBAND_EXCEEDED()) { - sp->psi += ((int32_t)-radio_control.values[RADIO_YAW] * SP_MAX_R / MAX_PPRZ / RC_UPDATE_FREQ) - << (REF_ANGLE_FRAC - INT32_ANGLE_FRAC); - ANGLE_REF_NORMALIZE(sp->psi); - } - } - else { /* if not flying, use current yaw as setpoint */ - sp->psi = (ahrs.ltp_to_body_euler.psi << (REF_ANGLE_FRAC - INT32_ANGLE_FRAC)); - } +static inline void reset_psi_ref_from_body(void) { + stab_att_ref_euler.psi = ahrs.ltp_to_body_euler.psi << (REF_ANGLE_FRAC - INT32_ANGLE_FRAC); + stab_att_ref_rate.r = 0; + stab_att_ref_accel.r = 0; } #endif /* STABILISATION_ATTITUDE_REF_INT_H */ diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_float.h b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_float.h index 20b22aba6c..d2404a9715 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_float.h +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_float.h @@ -36,10 +36,6 @@ // FIXME: what is this supposed to be?? #define YAW_COEF (STABILIZATION_ATTITUDE_FLOAT_SP_MAX_PSI / MAX_PPRZ) -#define ROLL_COEF_RATE (-STABILIZATION_ATTITUDE_FLOAT_SP_MAX_P / MAX_PPRZ) -#define PITCH_COEF_RATE ( STABILIZATION_ATTITUDE_FLOAT_SP_MAX_Q / MAX_PPRZ) -#define YAW_COEF_RATE ( STABILIZATION_ATTITUDE_FLOAT_SP_MAX_R / MAX_PPRZ) - #define DEADBAND_EXCEEDED(VARIABLE, VALUE) ((VARIABLE > VALUE) || (VARIABLE < -VALUE)) #define APPLY_DEADBAND(VARIABLE, VALUE) (DEADBAND_EXCEEDED(VARIABLE, VALUE) ? VARIABLE : 0.0) diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.c b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.c index 88484d7ca2..c49529e168 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.c @@ -64,9 +64,9 @@ #define OMEGA_2_R BFP_OF_REAL((OMEGA_R*OMEGA_R), OMEGA_2_R_RES) -struct Int32Eulers stab_att_sp_euler; ///< with #INT32_ANGLE_FRAC +struct Int32Eulers stab_att_sp_euler; struct Int32Quat stab_att_sp_quat; -struct Int32Eulers stab_att_ref_euler; ///< with #INT32_ANGLE_FRAC +struct Int32Eulers stab_att_ref_euler; struct Int32Quat stab_att_ref_quat; struct Int32Rates stab_att_ref_rate; struct Int32Rates stab_att_ref_accel; @@ -77,12 +77,6 @@ struct Int32RefModel stab_att_ref_model = { }; -static void reset_psi_ref_from_body(void) { - stab_att_ref_euler.psi = ahrs.ltp_to_body_euler.psi; - stab_att_ref_rate.r = 0; - stab_att_ref_accel.r = 0; -} - void stabilization_attitude_ref_init(void) { INT_EULERS_ZERO(stab_att_sp_euler); @@ -109,7 +103,11 @@ void stabilization_attitude_ref_enter() stabilization_attitude_sp_enter(); memcpy(&stab_att_ref_quat, &stab_att_sp_quat, sizeof(struct Int32Quat)); #else - update_quat_from_eulers(&stab_att_ref_quat, &stab_att_ref_euler); + /* convert reference attitude with REF_ANGLE_FRAC to eulers with normal INT32_ANGLE_FRAC */ + struct Int32Eulers ref_eul; + INT32_EULERS_RSHIFT(ref_eul, stab_att_ref_euler, (REF_ANGLE_FRAC - INT32_ANGLE_FRAC)); + INT32_QUAT_OF_EULERS(stab_att_ref_quat, ref_eul); + INT32_QUAT_WRAP_SHORTEST(stab_att_ref_quat); #endif /* set reference rate and acceleration to zero */ @@ -179,7 +177,9 @@ void stabilization_attitude_ref_update() { //const struct Int32Rates MAX_ACCEL = { REF_ACCEL_MAX_P, REF_ACCEL_MAX_Q, REF_ACCEL_MAX_R }; //RATES_BOUND_BOX(stab_att_ref_accel, MIN_ACCEL, MAX_ACCEL); - /* compute ref_euler */ - INT32_EULERS_OF_QUAT(stab_att_ref_euler, stab_att_ref_quat); + /* compute ref_euler for debugging and telemetry */ + struct Int32Eulers ref_eul; + INT32_EULERS_OF_QUAT(ref_eul, stab_att_ref_quat); + INT32_EULERS_LSHIFT(stab_att_ref_euler, ref_eul, (REF_ANGLE_FRAC - INT32_ANGLE_FRAC)); } diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.h b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.h index aa1124e674..34d4c44f8f 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.h +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_attitude_ref_quat_int.h @@ -22,69 +22,8 @@ #define STABILIZATION_ATTITUDE_INT_REF_QUAT_INT_H #include "firmwares/rotorcraft/stabilization.h" - -#include "subsystems/radio_control.h" -#include "math/pprz_algebra_float.h" - #include "stabilization_attitude_ref_int.h" -#include "subsystems/ahrs.h" - -#define ROLL_COEF (STABILIZATION_ATTITUDE_SP_MAX_PHI / MAX_PPRZ) -// FIXME: unused, what was it supposed to be? -//#define ROLL_COEF_H (STABILIZATION_ATTITUDE_SP_MAX_P_H / MAX_PPRZ) -#define PITCH_COEF (STABILIZATION_ATTITUDE_SP_MAX_THETA / MAX_PPRZ) -// FIXME: what is this supposed to be?? -#define YAW_COEF (STABILIZATION_ATTITUDE_SP_MAX_PSI / MAX_PPRZ) - -#define ROLL_COEF_RATE (-STABILIZATION_ATTITUDE_SP_MAX_P / MAX_PPRZ) -#define PITCH_COEF_RATE ( STABILIZATION_ATTITUDE_SP_MAX_Q / MAX_PPRZ) -#define YAW_COEF_RATE ( STABILIZATION_ATTITUDE_SP_MAX_R / MAX_PPRZ) - -#define DEADBAND_EXCEEDED(VARIABLE, VALUE) ((VARIABLE > VALUE) || (VARIABLE < -VALUE)) -#define APPLY_DEADBAND(VARIABLE, VALUE) (DEADBAND_EXCEEDED(VARIABLE, VALUE) ? VARIABLE : 0.0) - -#define ROLL_DEADBAND_EXCEEDED() \ - (radio_control.values[RADIO_ROLL] > STABILIZATION_ATTITUDE_DEADBAND_A || \ - radio_control.values[RADIO_ROLL] < -STABILIZATION_ATTITUDE_DEADBAND_A) -#define PITCH_DEADBAND_EXCEEDED() \ - (radio_control.values[RADIO_PITCH] > STABILIZATION_ATTITUDE_DEADBAND_E || \ - radio_control.values[RADIO_PITCH] < -STABILIZATION_ATTITUDE_DEADBAND_E) - -#define STABILIZATION_ATTITUDE_RESET_PSI_REF(_sp) {} - -static inline void update_quat_from_eulers(struct Int32Quat *quat, struct Int32Eulers *eulers) { - struct Int32RMat rmat; - -#ifdef STICKS_RMAT312 - INT32_RMAT_OF_EULERS_312(rmat, *eulers); -#else - INT32_RMAT_OF_EULERS_321(rmat, *eulers); -#endif - INT32_QUAT_OF_RMAT(*quat, rmat); - INT32_QUAT_WRAP_SHORTEST(*quat); -} - - -static inline void stabilization_attitude_read_rc_setpoint(bool_t in_flight) { - - stab_att_sp_euler.phi = ((int32_t)-radio_control.values[RADIO_ROLL] * SP_MAX_PHI / MAX_PPRZ); - stab_att_sp_euler.theta = ((int32_t) radio_control.values[RADIO_PITCH] * SP_MAX_THETA / MAX_PPRZ); - - if (in_flight) { - if (YAW_DEADBAND_EXCEEDED()) { - stab_att_sp_euler.psi += ((int32_t)-radio_control.values[RADIO_YAW] * SP_MAX_R / MAX_PPRZ / RC_UPDATE_FREQ); - INT32_ANGLE_NORMALIZE(stab_att_sp_euler.psi); - } - } - else { /* if not flying, use current yaw as setpoint */ - stab_att_sp_euler.psi = ahrs.ltp_to_body_euler.psi; - } - - /* update quaternion setpoint from euler setpoint */ - update_quat_from_eulers(&stab_att_sp_quat, &stab_att_sp_euler); - -} void stabilization_attitude_ref_enter(void); diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_none.c b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_none.c index 687449636a..ffa414afe4 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_none.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_none.c @@ -1,8 +1,5 @@ /* - * $Id$ - * - * Copyright (C) 2008-2009 Antoine Drouin - * Copyright (C) 2010 Felix Ruess + * Copyright (C) 2011-2012 The Paparazzi Team * * This file is part of paparazzi. * @@ -22,40 +19,30 @@ * Boston, MA 02111-1307, USA. */ +/** @file stabilization_none.c + * Dummy stabilization for rotorcrafts. + * + * Doesn't actually do any stabilization, + * just directly passes the RC commands along. + */ + #include "firmwares/rotorcraft/stabilization.h" #include "firmwares/rotorcraft/stabilization/stabilization_none.h" #include "subsystems/radio_control.h" #include "generated/airframe.h" -#define F_UPDATE_RES 9 -#define REF_DOT_FRAC 11 -#define REF_FRAC 16 - -#ifndef SUPERVISION_SCALE -#define SUPERVISION_SCALE MAX_PPRZ -#endif - -#define OFFSET_AND_ROUND(_a, _b) (((_a)+(1<<((_b)-1)))>>(_b)) -#define OFFSET_AND_ROUND2(_a, _b) (((_a)+(1<<((_b)-1))-((_a)<0?1:0))>>(_b)) - struct Int32Rates stabilization_none_rc_cmd; void stabilization_none_init(void) { - INT_RATES_ZERO(stabilization_none_rc_cmd); - } - void stabilization_none_read_rc( void ) { - - stabilization_none_rc_cmd.p = (int32_t)-radio_control.values[RADIO_ROLL]; - + stabilization_none_rc_cmd.p = (int32_t)radio_control.values[RADIO_ROLL]; stabilization_none_rc_cmd.q = (int32_t)radio_control.values[RADIO_PITCH]; - - stabilization_none_rc_cmd.r = (int32_t)-radio_control.values[RADIO_YAW]; + stabilization_none_rc_cmd.r = (int32_t)radio_control.values[RADIO_YAW]; } void stabilization_none_enter(void) { @@ -63,10 +50,8 @@ void stabilization_none_enter(void) { } void stabilization_none_run(bool_t in_flight) { - - /* sum to final command */ - stabilization_cmd[COMMAND_ROLL] = stabilization_none_rc_cmd.p * SUPERVISION_SCALE / MAX_PPRZ; - stabilization_cmd[COMMAND_PITCH] = stabilization_none_rc_cmd.q * SUPERVISION_SCALE / MAX_PPRZ; - stabilization_cmd[COMMAND_YAW] = stabilization_none_rc_cmd.r * SUPERVISION_SCALE / MAX_PPRZ; - + /* just directly pass rc commands through */ + stabilization_cmd[COMMAND_ROLL] = stabilization_none_rc_cmd.p; + stabilization_cmd[COMMAND_PITCH] = stabilization_none_rc_cmd.q; + stabilization_cmd[COMMAND_YAW] = stabilization_none_rc_cmd.r; } diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_none.h b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_none.h index 515d4e844a..07ddd22aca 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_none.h +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_none.h @@ -1,7 +1,5 @@ /* - * $Id$ - * - * Copyright (C) 2008-2009 Antoine Drouin + * Copyright (C) 2011-2012 The Paparazzi Team * * This file is part of paparazzi. * @@ -21,6 +19,13 @@ * Boston, MA 02111-1307, USA. */ +/** @file stabilization_none.h + * Dummy stabilization for rotorcrafts. + * + * Doesn't actually do any stabilization, + * just directly passes the RC commands along. + */ + #ifndef STABILIZATION_NONE #define STABILIZATION_NONE diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.c b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.c index 44ff7ac984..8cec7ab503 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.c +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.c @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2009 Antoine Drouin * Copyright (C) 2010 Felix Ruess * @@ -22,6 +20,12 @@ * Boston, MA 02111-1307, USA. */ +/** @file stabilization_rate.c + * Rate stabilization for rotorcrafts. + * + * Control loops for angular velocity. + */ + #include "firmwares/rotorcraft/stabilization.h" #include "subsystems/ahrs.h" @@ -36,6 +40,12 @@ #define MAX_SUM_ERR 4000000 +#if (STABILIZATION_RATE_GAIN_P < 0) || \ + (STABILIZATION_RATE_GAIN_Q < 0) || \ + (STABILIZATION_RATE_GAIN_R < 0) +#warning "ALL control gains are now positive!!!" +#endif + #ifndef STABILIZATION_RATE_DDGAIN_P #define STABILIZATION_RATE_DDGAIN_P 0 #endif @@ -45,15 +55,29 @@ #ifndef STABILIZATION_RATE_DDGAIN_R #define STABILIZATION_RATE_DDGAIN_R 0 #endif + #ifndef STABILIZATION_RATE_IGAIN_P #define STABILIZATION_RATE_IGAIN_P 0 +#else +#if (STABILIZATION_RATE_IGAIN_P < 0) +#warning "ALL control gains are now positive!!!" +#endif #endif #ifndef STABILIZATION_RATE_IGAIN_Q #define STABILIZATION_RATE_IGAIN_Q 0 +#else +#if (STABILIZATION_RATE_IGAIN_Q < 0) +#warning "ALL control gains are now positive!!!" +#endif #endif #ifndef STABILIZATION_RATE_IGAIN_R #define STABILIZATION_RATE_IGAIN_R 0 +#else +#if (STABILIZATION_RATE_IGAIN_R < 0) +#warning "ALL control gains are now positive!!!" #endif +#endif + #ifndef STABILIZATION_RATE_REF_TAU #define STABILIZATION_RATE_REF_TAU 4 #endif @@ -122,7 +146,7 @@ void stabilization_rate_init(void) { void stabilization_rate_read_rc( void ) { if(ROLL_RATE_DEADBAND_EXCEEDED()) - stabilization_rate_sp.p = (int32_t)-radio_control.values[RADIO_ROLL] * STABILIZATION_RATE_SP_MAX_P / MAX_PPRZ; + stabilization_rate_sp.p = (int32_t)radio_control.values[RADIO_ROLL] * STABILIZATION_RATE_SP_MAX_P / MAX_PPRZ; else stabilization_rate_sp.p = 0; @@ -132,7 +156,7 @@ void stabilization_rate_read_rc( void ) { stabilization_rate_sp.q = 0; if(YAW_RATE_DEADBAND_EXCEEDED()) - stabilization_rate_sp.r = (int32_t)-radio_control.values[RADIO_YAW] * STABILIZATION_RATE_SP_MAX_R / MAX_PPRZ; + stabilization_rate_sp.r = (int32_t)radio_control.values[RADIO_YAW] * STABILIZATION_RATE_SP_MAX_R / MAX_PPRZ; else stabilization_rate_sp.r = 0; @@ -169,7 +193,7 @@ void stabilization_rate_run(bool_t in_flight) { OFFSET_AND_ROUND(stabilization_rate_ref.q, (REF_FRAC - INT32_RATE_FRAC)), OFFSET_AND_ROUND(stabilization_rate_ref.r, (REF_FRAC - INT32_RATE_FRAC)) }; struct Int32Rates _error; - RATES_DIFF(_error, ahrs.body_rate, _ref_scaled); + RATES_DIFF(_error, _ref_scaled, ahrs.body_rate); if (in_flight) { /* update integrator */ RATES_ADD(stabilization_rate_sum_err, _error); @@ -198,4 +222,9 @@ void stabilization_rate_run(bool_t in_flight) { stabilization_cmd[COMMAND_PITCH] = stabilization_rate_ff_cmd.q + stabilization_rate_fb_cmd.q; stabilization_cmd[COMMAND_YAW] = stabilization_rate_ff_cmd.r + stabilization_rate_fb_cmd.r; + /* bound the result */ + BoundAbs(stabilization_cmd[COMMAND_ROLL], MAX_PPRZ); + BoundAbs(stabilization_cmd[COMMAND_PITCH], MAX_PPRZ); + BoundAbs(stabilization_cmd[COMMAND_YAW], MAX_PPRZ); + } diff --git a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.h b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.h index 741b3c4fb0..41a6eaf99b 100644 --- a/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.h +++ b/sw/airborne/firmwares/rotorcraft/stabilization/stabilization_rate.h @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright (C) 2008-2009 Antoine Drouin * * This file is part of paparazzi. @@ -21,6 +19,12 @@ * Boston, MA 02111-1307, USA. */ +/** @file stabilization_rate.h + * Rate stabilization for rotorcrafts. + * + * Control loops for angular velocity. + */ + #ifndef STABILIZATION_RATE #define STABILIZATION_RATE diff --git a/sw/airborne/firmwares/rotorcraft/telemetry.c b/sw/airborne/firmwares/rotorcraft/telemetry.c index 5a38308b4d..7ca48ec1eb 100644 --- a/sw/airborne/firmwares/rotorcraft/telemetry.c +++ b/sw/airborne/firmwares/rotorcraft/telemetry.c @@ -21,7 +21,10 @@ * Boston, MA 02111-1307, USA. */ -#include "telemetry.h" +/* PERIODIC_C_MAIN is defined before generated/periodic_telemetry.h + * in order to implement telemetry_mode_Main_* + */ +#define PERIODIC_C_MAIN +#include "generated/periodic_telemetry.h" -uint8_t telemetry_mode_Main_DefaultChannel = TELEMETRY_MODE_Main_DefaultChannel_default; diff --git a/sw/airborne/firmwares/rotorcraft/telemetry.h b/sw/airborne/firmwares/rotorcraft/telemetry.h index b975c85fda..6331d9e850 100644 --- a/sw/airborne/firmwares/rotorcraft/telemetry.h +++ b/sw/airborne/firmwares/rotorcraft/telemetry.h @@ -29,7 +29,7 @@ #include "mcu_periph/uart.h" #include "subsystems/datalink/downlink.h" -#include "generated/periodic.h" +#include "generated/periodic_telemetry.h" #ifdef RADIO_CONTROL #include "subsystems/radio_control.h" @@ -51,8 +51,6 @@ // I2C Error counters #include "mcu_periph/i2c.h" -extern uint8_t telemetry_mode_Main_DefaultChannel; - #define PERIODIC_SEND_ALIVE(_trans, _dev) DOWNLINK_SEND_ALIVE(_trans, _dev, 16, MD5SUM) #if USE_GPS diff --git a/sw/airborne/fms/fms_gs_com.c b/sw/airborne/fms/fms_gs_com.c index 10579bcb2b..688413d911 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 "generated/periodic.h" +#include "generated/periodic_telemetry.h" /* holds the definitions of PERIODIC_SEND_XXX */ #include "overo_test_passthrough_telemetry.h" /* holds the definitions of DOWNLINK_SEND_XXX */ diff --git a/sw/airborne/math/pprz_algebra.h b/sw/airborne/math/pprz_algebra.h index a57e67dd7c..9bc9b54c8a 100644 --- a/sw/airborne/math/pprz_algebra.h +++ b/sw/airborne/math/pprz_algebra.h @@ -27,6 +27,7 @@ #include /* for FLT_EPSILON */ #include /* for memcpy */ +#include "std.h" /* for ABS */ #define SQUARE(_a) ((_a)*(_a)) @@ -101,6 +102,13 @@ (_a).z = (_z); \ } +/* a = {abs(x), abs(y), abs(z)} */ +#define VECT3_ASSIGN_ABS(_a, _x, _y, _z) { \ + (_a).x = ABS(_x); \ + (_a).y = ABS(_y); \ + (_a).z = ABS(_z); \ + } + /* a = b */ #define VECT3_COPY(_a, _b) { \ (_a).x = (_b).x; \ @@ -199,6 +207,13 @@ 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_ABS(_vo, _vi) { \ + (_vo).x = ABS((_vi).x); \ + (_vo).y = ABS((_vi).y); \ + (_vo).z = ABS((_vi).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; \ diff --git a/sw/airborne/math/pprz_algebra_int.h b/sw/airborne/math/pprz_algebra_int.h index 1a4c3ae322..d328434259 100644 --- a/sw/airborne/math/pprz_algebra_int.h +++ b/sw/airborne/math/pprz_algebra_int.h @@ -837,9 +837,17 @@ struct Int64Vect3 { \ } +#define INT32_EULERS_LSHIFT(_o, _i, _r) { \ + (_o).phi = ((_i).phi << (_r)); \ + (_o).theta = ((_i).theta << (_r)); \ + (_o).psi = ((_i).psi << (_r)); \ + } - - +#define INT32_EULERS_RSHIFT(_o, _i, _r) { \ + (_o).phi = ((_i).phi >> (_r)); \ + (_o).theta = ((_i).theta >> (_r)); \ + (_o).psi = ((_i).psi >> (_r)); \ + } /* diff --git a/sw/airborne/modules/cam_control/booz_cam.c b/sw/airborne/modules/cam_control/booz_cam.c index 77d762db46..2082a831d3 100644 --- a/sw/airborne/modules/cam_control/booz_cam.c +++ b/sw/airborne/modules/cam_control/booz_cam.c @@ -28,6 +28,7 @@ #include "firmwares/rotorcraft/navigation.h" #include "subsystems/ins.h" #include "generated/flight_plan.h" +#include "std.h" uint8_t booz_cam_mode; @@ -83,7 +84,6 @@ void booz_cam_init(void) { #endif } -#define ABS(_x) ((_x) < 0 ? -(_x) : (_x)) #define D_TILT (BOOZ_CAM_TILT_MAX - BOOZ_CAM_TILT_MIN) #define CT_MIN Min(BOOZ_CAM_TILT_MIN,BOOZ_CAM_TILT_MAX) #define CT_MAX Max(BOOZ_CAM_TILT_MIN,BOOZ_CAM_TILT_MAX) diff --git a/sw/airborne/modules/nav/nav_catapult.c b/sw/airborne/modules/nav/nav_catapult.c index 15dbc61922..337bb426c3 100644 --- a/sw/airborne/modules/nav/nav_catapult.c +++ b/sw/airborne/modules/nav/nav_catapult.c @@ -113,7 +113,7 @@ void nav_catapult_highrate_module(void) //############################################################################################### // Code that runs in 4Hz Nav -bool_t nav_catapult_init(void) +bool_t nav_catapult_init(void) { nav_catapult_armed = TRUE; @@ -124,7 +124,7 @@ bool_t nav_catapult_init(void) -bool_t nav_catapult(uint8_t _to, uint8_t _climb) +bool_t nav_catapult(uint8_t _to, uint8_t _climb) { float alt = WaypointAlt(_climb); diff --git a/sw/airborne/subsystems/ahrs/ahrs_float_utils.h b/sw/airborne/subsystems/ahrs/ahrs_float_utils.h index 53de617bdc..bfbc4558d1 100644 --- a/sw/airborne/subsystems/ahrs/ahrs_float_utils.h +++ b/sw/airborne/subsystems/ahrs/ahrs_float_utils.h @@ -3,7 +3,7 @@ #include "subsystems/ahrs/ahrs_magnetic_field_model.h" -#define ABS(_x) ((_x) < 0 ? -(_x) : (_x)) +#include "std.h" // for ABS static inline void ahrs_float_get_euler_from_accel_mag(struct FloatEulers* e, struct Int32Vect3* accel, struct Int32Vect3* mag) { /* get phi and theta from accelerometer */ diff --git a/sw/airborne/subsystems/nav.c b/sw/airborne/subsystems/nav.c index bf33d3867e..9ac2d1c8f2 100644 --- a/sw/airborne/subsystems/nav.c +++ b/sw/airborne/subsystems/nav.c @@ -203,7 +203,7 @@ static inline void nav_follow(uint8_t _ac_id, float _distance, float _height); static void nav_ground_speed_loop( void ) { if (MINIMUM_AIRSPEED < nav_ground_speed_setpoint && nav_ground_speed_setpoint < MAXIMUM_AIRSPEED) { - float err = estimator_hspeed_mod - nav_ground_speed_setpoint; + float err = nav_ground_speed_setpoint - estimator_hspeed_mod; v_ctl_auto_throttle_cruise_throttle += nav_ground_speed_pgain*err; Bound(v_ctl_auto_throttle_cruise_throttle, V_CTL_AUTO_THROTTLE_MIN_CRUISE_THROTTLE, V_CTL_AUTO_THROTTLE_MAX_CRUISE_THROTTLE); } else { @@ -326,7 +326,7 @@ void fly_to_xy(float x, float y) { NormRadAngle(diff); BoundAbs(diff,M_PI/2.); float s = sin(diff); - h_ctl_roll_setpoint = atan(2 * estimator_hspeed_mod*estimator_hspeed_mod * s * (-h_ctl_course_pgain) / (CARROT * NOMINAL_AIRSPEED * 9.81) ); + h_ctl_roll_setpoint = atan(2 * estimator_hspeed_mod*estimator_hspeed_mod * s * h_ctl_course_pgain / (CARROT * NOMINAL_AIRSPEED * 9.81) ); BoundAbs(h_ctl_roll_setpoint, h_ctl_roll_max_setpoint); lateral_mode = LATERAL_MODE_ROLL; } @@ -419,7 +419,7 @@ void nav_init(void) { nav_mode = NAV_MODE_COURSE; #ifdef NAV_GROUND_SPEED_PGAIN - nav_ground_speed_pgain = NAV_GROUND_SPEED_PGAIN; + nav_ground_speed_pgain = ABS(NAV_GROUND_SPEED_PGAIN); nav_ground_speed_setpoint = NOMINAL_AIRSPEED; #endif } diff --git a/sw/ground_segment/cockpit/live.ml b/sw/ground_segment/cockpit/live.ml index 21ce53b49f..e4f78e5a3a 100644 --- a/sw/ground_segment/cockpit/live.ml +++ b/sw/ground_segment/cockpit/live.ml @@ -127,7 +127,7 @@ let show_fp = fun ac -> let hide_fp = fun ac -> ac.fp_group#hide (); ac.fp_show#set_active false - + (* callback for FP check button in menu *) let show_mission = fun ac on_off -> let a = find_ac ac in diff --git a/sw/in_progress/videolizer/wis-go7007-linux/Makefile b/sw/in_progress/videolizer/wis-go7007-linux/Makefile index abe30d3613..3f130a9785 100644 --- a/sw/in_progress/videolizer/wis-go7007-linux/Makefile +++ b/sw/in_progress/videolizer/wis-go7007-linux/Makefile @@ -89,6 +89,7 @@ endif $(MAKE) install -C apps DESTDIR=$(DESTDIR) clean: - $(MAKE) clean -C $(KSRC) M=$(shell pwd)/kernel + $(MAKE) clean -C $(KSRC) $(shell pwd)/kernel rm -f hotplug/wis-ezusb udev/wis-ezusb.rules $(MAKE) clean -C apps + diff --git a/sw/include/std.h b/sw/include/std.h index a359db6361..3def069a3e 100644 --- a/sw/include/std.h +++ b/sw/include/std.h @@ -86,6 +86,8 @@ typedef uint8_t unit_t; #define Min(x,y) (x < y ? x : y) #define Max(x,y) (x > y ? x : y) +#define ABS(val) ((val) < 0 ? -(val) : (val)) + #define Bound(_x, _min, _max) { if (_x > _max) _x = _max; else if (_x < _min) _x = _min; } #define BoundAbs(_x, _max) Bound(_x, -(_max), (_max)) #define Chop(_x, _min, _max) ( (_x) < (_min) ? (_min) : (_x) > (_max) ? (_max) : (_x) ) diff --git a/sw/simulator/flightModel.ml b/sw/simulator/flightModel.ml index 0e7a2ac985..623ba35f02 100644 --- a/sw/simulator/flightModel.ml +++ b/sw/simulator/flightModel.ml @@ -199,7 +199,7 @@ module Make(A:Data.MISSION) = struct let do_commands = fun state commands -> let c_lda = 4e-5 in (* FIXME *) - state.delta_a <- -. c_lda *. float commands.(command_roll); + state.delta_a <- c_lda *. float commands.(command_roll); state.delta_b <- float commands.(command_pitch); state.thrust <- (float (commands.(command_throttle) - min_thrust) /. float (max_thrust - min_thrust)) diff --git a/sw/simulator/nps/nps_ivy.c b/sw/simulator/nps/nps_ivy.c index e8676f0366..1f57878aa1 100644 --- a/sw/simulator/nps/nps_ivy.c +++ b/sw/simulator/nps/nps_ivy.c @@ -8,6 +8,7 @@ #include "math/pprz_algebra_double.h" #include "nps_autopilot.h" #include "nps_fdm.h" +#include "nps_sensors.h" #include NPS_SENSORS_PARAMS diff --git a/sw/simulator/nps/nps_radio_control_joystick.c b/sw/simulator/nps/nps_radio_control_joystick.c index f49b4839ac..e2de8f0d34 100644 --- a/sw/simulator/nps/nps_radio_control_joystick.c +++ b/sw/simulator/nps/nps_radio_control_joystick.c @@ -64,7 +64,7 @@ static gboolean on_js_data_received(GIOChannel *source, //printf("joystick throttle %d\n",js.value); break; case JS_ROLL: - nps_joystick.roll = (float)js.value/-32767.; + nps_joystick.roll = (float)js.value/32767.; //printf("joystick roll %d %f\n",js.value, nps_joystick.roll); break; case JS_PITCH: @@ -73,7 +73,7 @@ static gboolean on_js_data_received(GIOChannel *source, break; case JS_YAW: //nps_joystick.yaw = 0.; - nps_joystick.yaw = (float)js.value/-32767.; + nps_joystick.yaw = (float)js.value/32767.; //printf("joystick yaw %d %f\n",js.value, nps_joystick.yaw); break; } diff --git a/sw/simulator/nps/nps_radio_control_spektrum.c b/sw/simulator/nps/nps_radio_control_spektrum.c index a51f64e6a8..3ade70b49e 100644 --- a/sw/simulator/nps/nps_radio_control_spektrum.c +++ b/sw/simulator/nps/nps_radio_control_spektrum.c @@ -122,10 +122,10 @@ static void parse_data(char* buf, int len) { static void handle_frame(void) { - nps_radio_control.roll = (float)CHANNEL_OF_FRAME(0)/340.; + nps_radio_control.roll = (float)CHANNEL_OF_FRAME(0)/-340.; nps_radio_control.throttle = (float)(CHANNEL_OF_FRAME(1)+340)/680.; nps_radio_control.pitch = (float)CHANNEL_OF_FRAME(2)/-340.; - nps_radio_control.yaw = (float)CHANNEL_OF_FRAME(3)/340.; + nps_radio_control.yaw = (float)CHANNEL_OF_FRAME(3)/-340.; nps_radio_control.mode = (float)CHANNEL_OF_FRAME(5)/340.; diff --git a/sw/tools/gen_periodic.ml b/sw/tools/gen_periodic.ml index 28d28ba223..c16569effc 100644 --- a/sw/tools/gen_periodic.ml +++ b/sw/tools/gen_periodic.ml @@ -39,14 +39,14 @@ let lprintf = fun c f -> fprintf c "%s" (String.make !margin ' '); fprintf c f -let output_modes = fun avr_h process_name channel_name device_name modes freq modules -> +let output_modes = fun out_h process_name modes freq modules -> let min_period = 1./.float freq in let max_period = 65536. /. float freq in (** For each mode in this process *) List.iter (fun mode -> let mode_name = ExtXml.attrib mode "name" in - lprintf avr_h "if (telemetry_mode_%s_%s == TELEMETRY_MODE_%s_%s_%s) {\\\n" process_name channel_name process_name channel_name mode_name; + lprintf out_h "if (telemetry_mode_%s == TELEMETRY_MODE_%s_%s) {\\\n" process_name process_name mode_name; right (); (** Filter message list to remove messages linked to unloaded modules *) @@ -64,7 +64,7 @@ let output_modes = fun avr_h process_name channel_name device_name modes freq mo List.iter (fun m -> let v = sprintf "i%d" m in let _type = if m >= 256 then "uint16_t" else "uint8_t" in - lprintf avr_h "static %s %s = 0; %s++; if (%s>=%d) %s=0;\\\n" _type v v v m v; + lprintf out_h "static %s %s = 0; %s++; if (%s>=%d) %s=0;\\\n" _type v v v m v; ) modulos; (** For each message in this mode *) @@ -80,23 +80,51 @@ let output_modes = fun avr_h process_name channel_name device_name modes freq mo let message_phase = try int_of_float (float_of_string (ExtXml.attrib message "phase")*.float_of_int freq) with _ -> !i in phase := message_phase; let else_ = if List.mem_assoc p !l && not (List.mem (p, !phase) !l) then "else " else "" in - lprintf avr_h "%sif (i%d == %d) {\\\n" else_ p !phase; + lprintf out_h "%sif (i%d == %d) {\\\n" else_ p !phase; l := (p, !phase) :: !l; i := !i + freq/10; right (); - lprintf avr_h "PERIODIC_SEND_%s(%s,%s);\\\n" message_name channel_name device_name; + lprintf out_h "PERIODIC_SEND_%s(_trans, _dev);\\\n" message_name; left (); - lprintf avr_h "} \\\n" + lprintf out_h "} \\\n" ) messages; left (); - lprintf avr_h "}\\\n") + lprintf out_h "}\\\n") modes +let write_settings = fun xml_file out_set telemetry_xml -> + fprintf out_set "\n" xml_file; + fprintf out_set "\n\n"; + fprintf out_set "\n"; + fprintf out_set " \n"; + fprintf out_set " \n"; + List.iter (fun p -> + (* for each process *) + let process_name = Xml.attrib p "name" in + (* convert the xml list of mode to a string list *) + let modes = List.map (fun m -> Xml.attrib m "name") (Xml.children p) in + let nb_modes = List.length modes in + match nb_modes with + 0 | 1 -> () (* Nothing to do if 1 or zero mode *) + | _ -> (* add settings with all modes *) + fprintf out_set " \n" (nb_modes-1) process_name process_name (String.concat "|" modes); + let i = ref 0 in + List.iter (fun m -> try + let key = Xml.attrib m "key_press" in + fprintf out_set " \n" key (string_of_int !i); + incr i + with _ -> incr i) (Xml.children p); + fprintf out_set " \n" + ) (Xml.children telemetry_xml); + fprintf out_set " \n"; + fprintf out_set " \n"; + fprintf out_set "\n" + let _ = - if Array.length Sys.argv <> 5 then begin - failwith (sprintf "Usage: %s frequency_in_hz" Sys.argv.(0)) + if Array.length Sys.argv <> 6 then begin + failwith (sprintf "Usage: %s frequency_in_hz out_settings_file" Sys.argv.(0)) end; let freq = int_of_string(Sys.argv.(4)) in @@ -108,21 +136,29 @@ let _ = in let modules_name = GC.get_modules_name (ExtXml.parse_file Sys.argv.(1)) in - let avr_h = stdout in + let out_h = stdout in - fprintf avr_h "/* This file has been generated from %s and %s */\n" Sys.argv.(2) Sys.argv.(3); - fprintf avr_h "/* Please DO NOT EDIT */\n\n"; - fprintf avr_h "#ifndef _VAR_PERIODIC_H_\n"; - fprintf avr_h "#define _VAR_PERIODIC_H_\n"; + fprintf out_h "/* This file has been generated from %s and %s */\n" Sys.argv.(2) Sys.argv.(3); + fprintf out_h "/* Please DO NOT EDIT */\n\n"; + fprintf out_h "#ifndef _VAR_PERIODIC_H_\n"; + fprintf out_h "#define _VAR_PERIODIC_H_\n\n"; + fprintf out_h "#include \"std.h\"\n"; + fprintf out_h "#include \"generated/airframe.h\"\n\n"; (** For each process *) List.iter (fun process -> - let process_name = ExtXml.attrib process "name" - and channel_name = ExtXml.attrib_or_default process "channel" "DefaultChannel" - and device_name = ExtXml.attrib_or_default process "device" "DefaultDevice" in + let process_name = ExtXml.attrib process "name" in - fprintf avr_h "\n/* Macros for %s process channel %s with device %s */\n" process_name channel_name device_name; + fprintf out_h "\n/* Macros for %s process */\n" process_name; + fprintf out_h "#ifdef PERIODIC_C_%s\n" (String.uppercase process_name); + fprintf out_h "#ifndef TELEMETRY_MODE_%s\n" (String.uppercase process_name); + fprintf out_h "#define TELEMETRY_MODE_%s 0\n" (String.uppercase process_name); + fprintf out_h "#endif\n"; + fprintf out_h "uint8_t telemetry_mode_%s = TELEMETRY_MODE_%s;\n" process_name (String.uppercase process_name); + fprintf out_h "#else /* PERIODIC_C_%s not defined (general header) */\n" (String.uppercase process_name); + fprintf out_h "extern uint8_t telemetry_mode_%s;\n" process_name; + fprintf out_h "#endif /* PERIODIC_C_%s */\n" (String.uppercase process_name); let modes = Xml.children process in @@ -130,24 +166,29 @@ let _ = (** For each mode of this process *) List.iter (fun mode -> let name = ExtXml.attrib mode "name" in - Xml2h.define (sprintf "TELEMETRY_MODE_%s_%s_%s" process_name channel_name name) (string_of_int !i); + Xml2h.define (sprintf "TELEMETRY_MODE_%s_%s" process_name name) (string_of_int !i); (* Output the periods of the messages *) List.iter (fun x -> let p = ExtXml.attrib x "period" and n = ExtXml.attrib x "name" in - Xml2h.define (sprintf "PERIOD_%s_%s_%s_%d" n process_name channel_name !i) (sprintf "(%s)" p)) + Xml2h.define (sprintf "PERIOD_%s_%s_%d" n process_name !i) (sprintf "(%s)" p)) (Xml.children mode); incr i) modes; - lprintf avr_h "#define PeriodicSend%s(%s,%s) { /* %dHz */ \\\n" process_name channel_name device_name freq; + lprintf out_h "#define PeriodicSend%s(_trans, _dev) { /* %dHz */ \\\n" process_name freq; right (); - output_modes avr_h process_name channel_name device_name modes freq modules_name; + output_modes out_h process_name modes freq modules_name; left (); - lprintf avr_h "}\n" + lprintf out_h "}\n" ) (Xml.children telemetry_xml); - fprintf avr_h "#endif // _VAR_PERIODIC_H_\n"; + (** Output XML settings file with telemetry modes *) + let out_set = open_out Sys.argv.(5) in + write_settings Sys.argv.(3) out_set telemetry_xml; + close_out out_set; + + fprintf out_h "#endif // _VAR_PERIODIC_H_\n"; diff --git a/sw/tools/gen_settings.ml b/sw/tools/gen_settings.ml index d145e5ecf2..1e7e0f28f0 100644 --- a/sw/tools/gen_settings.ml +++ b/sw/tools/gen_settings.ml @@ -67,6 +67,7 @@ let print_dl_settings = fun settings -> lprintf "\n"; StringSet.iter (fun m -> lprintf "#include \"%s.h\"\n" m) !modules; lprintf "#include \"generated/modules.h\"\n"; + lprintf "#include \"generated/periodic_telemetry.h\"\n"; lprintf "\n"; (** Macro to call to set one variable *) diff --git a/sw/tools/gen_tuning.ml b/sw/tools/gen_tuning.ml index e8640c32f6..6b9474df7d 100644 --- a/sw/tools/gen_tuning.ml +++ b/sw/tools/gen_tuning.ml @@ -36,8 +36,8 @@ let rec flatten = fun xml r -> match Xml.children xml with [] -> r | x::xs -> - List.iter (fun y -> assert(ExtXml.tag_is y (Xml.tag x))) xs; - List.fold_right flatten (x::xs) r + List.iter (fun y -> assert(ExtXml.tag_is y (Xml.tag x))) xs; + List.fold_right flatten (x::xs) r let join_xml_files = fun xml_files -> let dl_settings = ref [] in @@ -45,7 +45,7 @@ let join_xml_files = fun xml_files -> let xml = Xml.parse_file xml_file in let these_dl_settings = try Xml.children (ExtXml.child xml "dl_settings") with - Not_found -> [] in + Not_found -> [] in dl_settings := these_dl_settings @ !dl_settings) xml_files; Xml.Element("dl_settings",[],!dl_settings) diff --git a/tests/LisaL/01_upload.t b/tests/LisaL/01_With_b2_v1.2.t similarity index 81% rename from tests/LisaL/01_upload.t rename to tests/LisaL/01_With_b2_v1.2.t index 56c139579e..489517660c 100644 --- a/tests/LisaL/01_upload.t +++ b/tests/LisaL/01_With_b2_v1.2.t @@ -1,10 +1,9 @@ #!/usr/bin/perl -w -use Test::More tests => 7; +use Test::More tests => 8; use lib "$ENV{'PAPARAZZI_SRC'}/tests/lib"; use Program; use Proc::Background; -use Ivy; $|++; @@ -12,7 +11,7 @@ $|++; # Make the airframe my $make_compile_options = "AIRCRAFT=LisaLv11_Booz2v12_RC clean_ac ap.compile"; my $compile_output = run_program( - "Attempting to build and upload the firmware.", + "Attempting to build the firmware.", $ENV{'PAPARAZZI_SRC'}, "make $make_compile_options", 0,1); @@ -31,25 +30,28 @@ unlike($upload_output, '/\bError\b/i', "The upload output does not contain the w # Start the server process my $server_command = "$ENV{'PAPARAZZI_HOME'}/sw/ground_segment/tmtc/server"; -my $server_options = ""; -my $server = Proc::Background->new($server_command, $server_options); +my @server_options = qw(-n); +my $server = Proc::Background->new($server_command, @server_options); sleep 2; # The service should die in this time if there's an error -ok($server->alive(), "The server started successfully"); +ok($server->alive(), "The server process started successfully"); # Start the link process my $link_command = "$ENV{'PAPARAZZI_HOME'}/sw/ground_segment/tmtc/link"; my @link_options = qw(-d /dev/tty.usbserial-000013FD -s 57600 -transport xbee -xbee_addr 123); -#my @link_options = qw(-d /dev/tty.usbserial-000013FD -s 57600); sleep 2; # The service should die in this time if there's an error my $link = Proc::Background->new($link_command, @link_options); -ok($link->alive(), "The link started successfully"); +ok($link->alive(), "The link process started successfully"); # Open the Ivy bus and read from it... -# TODO: learn how to read and write to the Ivy bus +SKIP : { + skip "Skipping testing of the hardware since we can't load the Ivy module. Please install IO::Socket::Multicast", 1 unless eval("use Ivy; 1"); + ok(1, "We can load the Ivy module."); + # TODO: learn how to read and write to the Ivy bus +} # Shutdown the server and link processes -ok($server->die(), "The server shutdown successfully."); -ok($link->die(), "The link shutdown successfully."); +ok($server->die(), "The server process shutdown successfully."); +ok($link->die(), "The link process shutdown successfully."); ################################################################################ # functions used by this test script. diff --git a/tests/LisaL/02_With_aspirin_v1.5_and_overo.t b/tests/LisaL/02_With_aspirin_v1.5_and_overo.t new file mode 100644 index 0000000000..a1c948f670 --- /dev/null +++ b/tests/LisaL/02_With_aspirin_v1.5_and_overo.t @@ -0,0 +1,97 @@ +#!/usr/bin/perl -w + +use Test::More tests => 8; +use lib "$ENV{'PAPARAZZI_SRC'}/tests/lib"; +use Program; +use Proc::Background; + +$|++; + +#################### +# Make the airframe +my $make_compile_options = "AIRCRAFT=LisaLv11_Aspirinv15_Overo_RC clean_ac ap.compile"; +my $compile_output = run_program( + "Attempting to build the firmware.", + $ENV{'PAPARAZZI_SRC'}, + "make $make_compile_options", + 0,1); +unlike($compile_output, '/Aircraft \'LisaLv11_Aspirinv15_Overo_RC\' not found in/', "The compile output does not contain the message \"Aircraft \'LisaLv11_Aspirinv15_Overo_RC\' not found in\""); +unlike($compile_output, '/\bError\b/i', "The compile output does not contain the word \"Error\""); + +#################### +# Upload the airframe +my $make_upload_options = "AIRCRAFT=LisaLv11_Aspirinv15_Overo_RC BOARD_SERIAL=LISA-L-000154 ap.upload"; +my $upload_output = run_program( + "Attempting to build and upload the firmware.", + $ENV{'PAPARAZZI_SRC'}, + "make $make_upload_options", + 0,1); +unlike($upload_output, '/\bError\b/i', "The upload output does not contain the word \"Error\""); + +# Start the server process +my $server_command = "$ENV{'PAPARAZZI_HOME'}/sw/ground_segment/tmtc/server"; +my @server_options = qw(-n); +my $server = Proc::Background->new($server_command, @server_options); +sleep 2; # The service should die in this time if there's an error +ok($server->alive(), "The server process started successfully"); + +# Start the link process +my $link_command = "$ENV{'PAPARAZZI_HOME'}/sw/ground_segment/tmtc/link"; +my @link_options = qw(-d /dev/tty.usbserial-000013FD -s 57600 -transport xbee -xbee_addr 123); +sleep 2; # The service should die in this time if there's an error +my $link = Proc::Background->new($link_command, @link_options); +ok($link->alive(), "The link process started successfully"); + +# Open the Ivy bus and read from it... +SKIP : { + skip "Skipping testing of the hardware since we can't load the Ivy module. Please install IO::Socket::Multicast", 1 unless eval("use Ivy; 1"); + ok(1, "We can load the Ivy module."); + # TODO: learn how to read and write to the Ivy bus +} + +# Shutdown the server and link processes +ok($server->die(), "The server process shutdown successfully."); +ok($link->die(), "The link process shutdown successfully."); + +################################################################################ +# functions used by this test script. +sub run_program +{ + my $message = shift; + my $dir = shift; + my $command = shift; + my $verbose = shift; + my $dont_fail_on_error = shift; + + warn "$message\n" if $verbose; + if (defined $dir) + { + $command = "cd $dir;" . $command; + } + my $prog = new Program("bash"); + my $fh = $prog->open("-c \"$command\""); + warn "Running command: \"". $prog->last_command() ."\"\n" if $verbose; + $fh->autoflush(1); + my @output; + while (<$fh>) + { + warn $_ if $verbose; + chomp $_; + push @output, $_; + } + $fh->close; + my $exit_status = $?/256; + unless ($exit_status == 0) + { + if ($dont_fail_on_error) + { + warn "Error: The command \"". $prog->last_command() ."\" failed to complete successfully. Exit status: $exit_status\n" if $verbose; + } + else + { + die "Error: The command \"". $prog->last_command() ."\" failed to complete successfully. Exit status: $exit_status\n"; + } + } + return wantarray ? @output : join "\n", @output; +} + diff --git a/tests/Makefile b/tests/Makefile index f6eb2bd4b5..bdbbfa35c6 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,10 +1,20 @@ Q = @ PERL = /usr/bin/perl TEST_VERBOSE = 0 -ifeq ($(TARGET_BOARD),) - TARGET_BOARD = * +NON_TEST_DIRS = lib|results +HARDWARE_REGEX = Lisa|Tiny|Umarim +HARDWARE_TEST_DIRS = $(shell find -L * -maxdepth 1 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -E "$(HARDWARE_REGEX)") +NON_HARDWARE_TEST_DIRS = $(shell find -L * -maxdepth 1 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -Ev "$(HARDWARE_REGEX)") +ifneq ($(TARGET_BOARD),) + TEST_DIRECTORIES = $(TARGET_BOARD) +else +ifeq ($(TEST_HARDWARE),) + TEST_DIRECTORIES = $(NON_HARDWARE_TEST_DIRS) +else + TEST_DIRECTORIES = $(NON_HARDWARE_TEST_DIRS) $(HARDWARE_TEST_DIRS) endif -TEST_FILES := $(shell ls $(TARGET_BOARD)/*.t) +endif +TEST_FILES := $(shell ls $(TEST_DIRECTORIES:%=%/*.t)) ifneq ($(JUNIT),) PERLENV=PERL_TEST_HARNESS_DUMP_TAP=$(PAPARAZZI_SRC)/tests/results @@ -17,3 +27,6 @@ endif test: $(Q)$(PERLENV) $(PERL) "-e" "$(RUNTESTS)" +clean: + rm -rf results/* + diff --git a/tests/examples/01_compile_all_example_targets.t b/tests/examples/01_compile_all_example_targets.t index 275a370384..71f4484928 100644 --- a/tests/examples/01_compile_all_example_targets.t +++ b/tests/examples/01_compile_all_example_targets.t @@ -28,16 +28,16 @@ foreach my $example (sort keys%{$examples->{'aircraft'}}) next unless scalar $airframe_config->{'firmware'}->{$process}->{'target'}->{$target}->{'board'}; # Exclude some builds on Mac as they are currently broken. - next if ( ($Config{'osname'} =~ m#darwin#i) and ($example =~ m#LISA_ASCTEC_PIOTR|LisaLv11_Booz2v12_RC|BOOZ2_A1#i) and ($target =~ m#sim#i) ); + next if ( ($Config{'osname'} =~ m#darwin#i) and ($example =~ m#LISA_ASCTEC_PIOTR|LisaLv11_Booz2v12_RC|BOOZ2_A1|LisaLv11_Aspirinv15_Overo_RC#i) and ($target =~ m#sim#i) ); #warn "EXAMPLE: [$example] TARGET: [$target]\n"; - my $make_upload_options = "AIRCRAFT=$example clean_ac $target.compile"; - my $upload_output = run_program( + my $make_options = "AIRCRAFT=$example clean_ac $target.compile"; + my $output = run_program( "Attempting to build the firmware $target for the airframe $example.", $ENV{'PAPARAZZI_SRC'}, - "make $make_upload_options", + "make $make_options", $ENV->{'TEST_VERBOSE'},1); - unlike($upload_output, '/\bError\b/i', "The upload output does not contain the word \"Error\""); + unlike($output, '/\bError\b/i', "The make output for the $example target $target does not contain the word \"Error\""); } } elsif ($process =~ m#target#) @@ -48,16 +48,16 @@ foreach my $example (sort keys%{$examples->{'aircraft'}}) next unless scalar $airframe_config->{'firmware'}->{$process}->{$target}->{'board'}; # Exclude some builds on Mac as they are currently broken. - next if ( ($Config{'osname'} =~ m#darwin#i) and ($example =~ m#LISA_ASCTEC_PIOTR|LisaLv11_Booz2v12_RC|BOOZ2_A1#i) and ($target =~ m#sim#i) ); + next if ( ($Config{'osname'} =~ m#darwin#i) and ($example =~ m#LISA_ASCTEC_PIOTR|LisaLv11_Booz2v12_RC|BOOZ2_A1|LisaLv11_Aspirinv15_Overo_RC#i) and ($target =~ m#sim#i) ); #warn "EXAMPLET: [$example] TARGET: [$target]\n"; - my $make_upload_options = "AIRCRAFT=$example clean_ac $target.compile"; - my $upload_output = run_program( + my $make_options = "AIRCRAFT=$example clean_ac $target.compile"; + my $output = run_program( "Attempting to build the firmware $target for the airframe $example.", $ENV{'PAPARAZZI_SRC'}, - "make $make_upload_options", + "make $make_options", $ENV->{'TEST_VERBOSE'},1); - unlike($upload_output, '/\bError\b/i', "The upload output does not contain the word \"Error\""); + unlike($output, '/\bError\b/i', "The make output for the $example target $target does not contain the word \"Error\""); } } } diff --git a/tests/sim/01_Microjet.t b/tests/sim/01_Microjet.t new file mode 100644 index 0000000000..13d04f89c0 --- /dev/null +++ b/tests/sim/01_Microjet.t @@ -0,0 +1,87 @@ +#!/usr/bin/perl -w + +use Test::More tests => 7; +use lib "$ENV{'PAPARAZZI_SRC'}/tests/lib"; +use Program; +use Proc::Background; + +$|++; + +#################### +# Make the airframe +my $make_compile_options = "AIRCRAFT=Microjet clean_ac sim"; +my $compile_output = run_program( + "Attempting to build the sim firmware.", + $ENV{'PAPARAZZI_SRC'}, + "make $make_compile_options", + 0,1); +unlike($compile_output, '/Aircraft \'Microjet\' not found in/', "The compile output does not contain the message \"Aircraft \'Microjet\' not found in\""); +unlike($compile_output, '/\bError\b/i', "The compile output does not contain the word \"Error\""); + +# Start the server process +my $server_command = "$ENV{'PAPARAZZI_HOME'}/sw/ground_segment/tmtc/server"; +my @server_options = qw(-n); +my $server = Proc::Background->new($server_command, @server_options); +sleep 2; # The service should die in this time if there's an error +ok($server->alive(), "The server process started successfully"); + +# Start the launchsitl process +my $launchsitl_command = "$ENV{'PAPARAZZI_HOME'}/sw/simulator/launchsitl"; +my @launchsitl_options = qw(-a Microjet -boot -norc); +sleep 2; # The service should die in this time if there's an error +my $launchsitl = Proc::Background->new($launchsitl_command, @launchsitl_options); +ok($launchsitl->alive(), "The launchsitl process started successfully"); + +# Open the Ivy bus and read from it... +SKIP : { + skip "Skipping testing of the simulator since we can't load the Ivy module. Please install IO::Socket::Multicast", 1 unless eval("use Ivy; 1"); + ok(1, "We can load the Ivy module."); + # TODO: learn how to read and write to the Ivy bus +} + +# Shutdown the server and launchsitl processes +ok($server->die(), "The server process shutdown successfully."); +ok($launchsitl->die(), "The launchsitl process shutdown successfully."); + +################################################################################ +# functions used by this test script. +sub run_program +{ + my $message = shift; + my $dir = shift; + my $command = shift; + my $verbose = shift; + my $dont_fail_on_error = shift; + + warn "$message\n" if $verbose; + if (defined $dir) + { + $command = "cd $dir;" . $command; + } + my $prog = new Program("bash"); + my $fh = $prog->open("-c \"$command\""); + warn "Running command: \"". $prog->last_command() ."\"\n" if $verbose; + $fh->autoflush(1); + my @output; + while (<$fh>) + { + warn $_ if $verbose; + chomp $_; + push @output, $_; + } + $fh->close; + my $exit_status = $?/256; + unless ($exit_status == 0) + { + if ($dont_fail_on_error) + { + warn "Error: The command \"". $prog->last_command() ."\" failed to complete successfully. Exit status: $exit_status\n" if $verbose; + } + else + { + die "Error: The command \"". $prog->last_command() ."\" failed to complete successfully. Exit status: $exit_status\n"; + } + } + return wantarray ? @output : join "\n", @output; +} +