[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paparazzi-commits] [5722] branch/HB now compiles airframe SAS
From: |
Oliver Riesener |
Subject: |
[paparazzi-commits] [5722] branch/HB now compiles airframe SAS |
Date: |
Fri, 27 Aug 2010 10:15:40 +0000 |
Revision: 5722
http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=5722
Author: olri
Date: 2010-08-27 10:15:40 +0000 (Fri, 27 Aug 2010)
Log Message:
-----------
branch/HB now compiles airframe SAS
Modified Paths:
--------------
paparazzi3/branches/HB/trunk/conf/airframes/HB/extra/SAS.xml
paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/CHNI_Twog.xml
paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca1.xml
paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca1Razor.xml
paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca1Razor_klein.xml
paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca2.xml
paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca3.xml
paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Lerche.xml
paparazzi3/branches/HB/trunk/conf/conf.xml.HB
paparazzi3/branches/HB/trunk/sw/airborne/baro_scp.c
paparazzi3/branches/HB/trunk/sw/airborne/baro_scp.h
paparazzi3/branches/HB/trunk/sw/airborne/diydrones/arduimu.h
paparazzi3/branches/HB/trunk/sw/airborne/diydrones/dcm.h
paparazzi3/branches/HB/trunk/sw/airborne/diydrones/matrix.c
paparazzi3/branches/HB/trunk/sw/airborne/diydrones/matrix.h
paparazzi3/branches/HB/trunk/sw/airborne/diydrones/read_adc.c
paparazzi3/branches/HB/trunk/sw/airborne/diydrones/read_adc.h
paparazzi3/branches/HB/trunk/sw/airborne/diydrones/vector.c
paparazzi3/branches/HB/trunk/sw/airborne/diydrones/vector.h
paparazzi3/branches/HB/trunk/sw/airborne/diydrones/wiring.h
paparazzi3/branches/HB/trunk/sw/airborne/hmc5843_i2c.c
paparazzi3/branches/HB/trunk/sw/airborne/infrared.c
paparazzi3/branches/HB/trunk/sw/airborne/main_ap.c
Added Paths:
-----------
paparazzi3/branches/HB/trunk/sw/airborne/diydrones/arduimu.c
Modified: paparazzi3/branches/HB/trunk/conf/airframes/HB/extra/SAS.xml
===================================================================
--- paparazzi3/branches/HB/trunk/conf/airframes/HB/extra/SAS.xml
2010-08-27 09:09:54 UTC (rev 5721)
+++ paparazzi3/branches/HB/trunk/conf/airframes/HB/extra/SAS.xml
2010-08-27 10:15:40 UTC (rev 5722)
@@ -1,4 +1,4 @@
-<!DOCTYPE airframe SYSTEM "../airframe.dtd">
+<!DOCTYPE airframe SYSTEM "../../airframe.dtd">
<airframe name="HB-SAS IMU Demo Wood Board">
@@ -266,7 +266,7 @@
#ap.srcs += kalman_hb.c
#ap.CFLAGS += -DUSE_DAC
-ap.srcs += diydrones/dcm.c diydrones/matrix.c diydrones/read_adc.c
diydrones/vector.c
+ap.srcs += diydrones/dcm.c diydrones/matrix.c diydrones/read_adc.c
diydrones/vector.c diydrones/arduimu.c
#ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c
test_adcs.c
Modified:
paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/CHNI_Twog.xml
===================================================================
--- paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/CHNI_Twog.xml
2010-08-27 09:09:54 UTC (rev 5721)
+++ paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/CHNI_Twog.xml
2010-08-27 10:15:40 UTC (rev 5722)
@@ -1,4 +1,4 @@
-<!DOCTYPE airframe SYSTEM "airframe.dtd">
+<!DOCTYPE airframe SYSTEM "../../airframe.dtd">
<airframe name="Test Tiny 2.1">
Modified:
paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca1.xml
===================================================================
--- paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca1.xml
2010-08-27 09:09:54 UTC (rev 5721)
+++ paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca1.xml
2010-08-27 10:15:40 UTC (rev 5722)
@@ -1,4 +1,4 @@
-<!DOCTYPE airframe SYSTEM "airframe.dtd">
+<!DOCTYPE airframe SYSTEM "../../airframe.dtd">
<airframe name="HB-D1 Busca V0.1 (futaba)">
Modified:
paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca1Razor.xml
===================================================================
---
paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca1Razor.xml
2010-08-27 09:09:54 UTC (rev 5721)
+++
paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca1Razor.xml
2010-08-27 10:15:40 UTC (rev 5722)
@@ -1,4 +1,4 @@
-<!DOCTYPE airframe SYSTEM "airframe.dtd">
+<!DOCTYPE airframe SYSTEM "../../airframe.dtd">
<airframe name="HB-D1 Busca V0.1 (futaba)">
Modified:
paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca1Razor_klein.xml
===================================================================
---
paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca1Razor_klein.xml
2010-08-27 09:09:54 UTC (rev 5721)
+++
paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca1Razor_klein.xml
2010-08-27 10:15:40 UTC (rev 5722)
@@ -1,4 +1,4 @@
-<!DOCTYPE airframe SYSTEM "airframe.dtd">
+<!DOCTYPE airframe SYSTEM "../../airframe.dtd">
<airframe name="HB-D1 Busca V0.1 (futaba)">
Modified:
paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca2.xml
===================================================================
--- paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca2.xml
2010-08-27 09:09:54 UTC (rev 5721)
+++ paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca2.xml
2010-08-27 10:15:40 UTC (rev 5722)
@@ -1,4 +1,4 @@
-<!DOCTYPE airframe SYSTEM "airframe.dtd">
+<!DOCTYPE airframe SYSTEM "../../airframe.dtd">
<airframe name="HB Busca 2 V0.2 (futaba)">
Modified:
paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca3.xml
===================================================================
--- paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca3.xml
2010-08-27 09:09:54 UTC (rev 5721)
+++ paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Busca3.xml
2010-08-27 10:15:40 UTC (rev 5722)
@@ -1,4 +1,4 @@
-<!DOCTYPE airframe SYSTEM "airframe.dtd">
+<!DOCTYPE airframe SYSTEM "../../airframe.dtd">
<airframe name="HB-D1 Busca V0.1 (futaba)">
Modified:
paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Lerche.xml
===================================================================
--- paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Lerche.xml
2010-08-27 09:09:54 UTC (rev 5721)
+++ paparazzi3/branches/HB/trunk/conf/airframes/HB/fixed-wing/HB_Lerche.xml
2010-08-27 10:15:40 UTC (rev 5722)
@@ -1,4 +1,4 @@
-<!DOCTYPE airframe SYSTEM "airframe.dtd">
+<!DOCTYPE airframe SYSTEM "../../airframe.dtd">
<airframe name="HB Lerche V0.2 (JR)">
Modified: paparazzi3/branches/HB/trunk/conf/conf.xml.HB
===================================================================
--- paparazzi3/branches/HB/trunk/conf/conf.xml.HB 2010-08-27 09:09:54 UTC
(rev 5721)
+++ paparazzi3/branches/HB/trunk/conf/conf.xml.HB 2010-08-27 10:15:40 UTC
(rev 5722)
@@ -2,91 +2,91 @@
<aircraft
name="Busca1"
ac_id="202"
- airframe="airframes/HB_Busca1.xml"
- radio="radios/mc22-HB-D1.xml"
+ airframe="airframes/HB/fixed-wing/HB_Busca1.xml"
+ radio="radios/HB/mc22-HB-D1.xml"
telemetry="telemetry/default.xml"
- flight_plan="flight_plans/stieglitz.xml"
- settings="settings/tuning_hsb.xml"
+ flight_plan="flight_plans/HB/stieglitz.xml"
+ settings="settings/HB/tuning_hsb.xml"
gui_color="blue"
/>
<aircraft
name="Busca1Razor"
ac_id="222"
- airframe="airframes/HB_Busca1Razor.xml"
- radio="radios/mc22-HB-D1.xml"
+ airframe="airframes/HB/fixed-wing/HB_Busca1Razor.xml"
+ radio="radios/HB/mc22-HB-D1.xml"
telemetry="telemetry/default.xml"
- flight_plan="flight_plans/stieglitz.xml"
- settings="settings/tuning_hsb.xml"
+ flight_plan="flight_plans/HB/stieglitz.xml"
+ settings="settings/HB/tuning_hsb.xml"
gui_color="blue"
/>
<aircraft
name="Busca2"
ac_id="203"
- airframe="airframes/HB_Busca2.xml"
- radio="radios/mc22-HB-D1.xml"
+ airframe="airframes/HB/fixed-wing/HB_Busca2.xml"
+ radio="radios/HB/mc22-HB-D1.xml"
telemetry="telemetry/default.xml"
- flight_plan="flight_plans/stieglitz.xml"
- settings="settings/tuning_hsb.xml"
+ flight_plan="flight_plans/HB/stieglitz.xml"
+ settings="settings/HB/tuning_hsb.xml"
gui_color="#43b8f0e017c0"
/>
<aircraft
name="Busca2G"
ac_id="223"
- airframe="airframes/HB_Busca2.xml"
- radio="radios/mc22-HB-D1.xml"
+ airframe="airframes/HB/fixed-wing/HB_Busca2.xml"
+ radio="radios/HB/mc22-HB-D1.xml"
telemetry="telemetry/default.xml"
- flight_plan="flight_plans/gifhorn.xml"
- settings="settings/tuning_hsb.xml"
+ flight_plan="flight_plans/HB/gifhorn.xml"
+ settings="settings/HB/tuning_hsb.xml"
gui_color="#43b8f0e017c0"
/>
<aircraft
name="Busca2GL"
ac_id="233"
- airframe="airframes/HB_Busca2.xml"
- radio="radios/mc22-HB-D1.xml"
+ airframe="airframes/HB/fixed-wing/HB_Busca2.xml"
+ radio="radios/HB/mc22-HB-D1.xml"
telemetry="telemetry/default.xml"
- flight_plan="flight_plans/gifhorn_gates.xml"
- settings="settings/tuning_hsb.xml"
+ flight_plan="flight_plans/HB/gifhorn_gates.xml"
+ settings="settings/HB/tuning_hsb.xml"
gui_color="#43b8f0e017c0"
/>
<aircraft
name="Busca2L"
ac_id="213"
- airframe="airframes/HB_Busca2.xml"
- radio="radios/mc22-HB-D1.xml"
+ airframe="airframes/HB/fixed-wing/HB_Busca2.xml"
+ radio="radios/HB/mc22-HB-D1.xml"
telemetry="telemetry/default.xml"
- flight_plan="flight_plans/stieglitz_gates.xml"
- settings="settings/tuning_hsb.xml"
+ flight_plan="flight_plans/HB/stieglitz_gates.xml"
+ settings="settings/HB/tuning_hsb.xml"
gui_color="#43b8f0e017c0"
/>
<aircraft
name="Busca3"
ac_id="204"
- airframe="airframes/HB_Busca3.xml"
- radio="radios/mc22-HB-D1.xml"
+ airframe="airframes/HB/fixed-wing/HB_Busca3.xml"
+ radio="radios/HB/mc22-HB-D1.xml"
telemetry="telemetry/default.xml"
- flight_plan="flight_plans/stieglitz.xml"
+ flight_plan="flight_plans/HB/stieglitz.xml"
gui_color="#f1df130415ad"
- settings="settings/tuning_hsb.xml"
+ settings="settings/HB/tuning_hsb.xml"
/>
<aircraft
name="Busca_Razor_40cm"
ac_id="43"
- airframe="airframes/HB_Busca1Razor_klein.xml"
- radio="radios/mc22-HB-D1.xml"
+ airframe="airframes/HB/fixed-wing/HB_Busca1Razor_klein.xml"
+ radio="radios/HB/mc22-HB-D1.xml"
telemetry="telemetry/default.xml"
- flight_plan="flight_plans/stieglitz_chni.xml"
- settings="settings/tuning_hsb.xml"
+ flight_plan="flight_plans/HB/stieglitz_chni.xml"
+ settings="settings/HB/tuning_hsb.xml"
gui_color="white"
/>
<aircraft
name="Busca_Razor_80cm"
ac_id="42"
- airframe="airframes/HB_Busca1Razor.xml"
- radio="radios/mc22-HB-D1.xml"
+ airframe="airframes/HB/fixed-wing/HB_Busca1Razor.xml"
+ radio="radios/HB/mc22-HB-D1.xml"
telemetry="telemetry/default.xml"
- flight_plan="flight_plans/stieglitz_chni.xml"
- settings="settings/tuning_hsb.xml"
+ flight_plan="flight_plans/HB/stieglitz_chni.xml"
+ settings="settings/HB/tuning_hsb.xml"
gui_color="white"
/>
<aircraft
@@ -96,17 +96,17 @@
radio="radios/T9cap.xml"
telemetry="telemetry/default.xml"
flight_plan="flight_plans/dummy.xml"
- settings="settings/demo5_settings.xml"
+ settings="settings/HB/demo5_settings.xml"
gui_color="white"
/>
<aircraft
name="Lerche"
ac_id="205"
- airframe="airframes/HB_Lerche.xml"
- radio="radios/fm314.xml"
+ airframe="airframes/HB/fixed-wing/HB_Lerche.xml"
+ radio="radios/HB/fm314.xml"
telemetry="telemetry/default.xml"
- flight_plan="flight_plans/gifhorn_lerche_go.xml"
- settings="settings/tuning_hsb.xml"
+ flight_plan="flight_plans/HB/gifhorn_lerche_go.xml"
+ settings="settings/HB/tuning_hsb.xml"
gui_color="#ffffffffffff"
/>
<aircraft
@@ -122,11 +122,11 @@
<aircraft
name="SAS"
ac_id="44"
- airframe="airframes/HB/SAS.xml"
- radio="radios/mc22-HB-D1.xml"
+ airframe="airframes/HB/extra/SAS.xml"
+ radio="radios/HB/mc22-HB-D1.xml"
telemetry="telemetry/default.xml"
flight_plan="flight_plans/HB/hochschule.xml"
- settings="settings/tuning_hsb.xml"
+ settings="settings/HB/tuning_hsb.xml"
gui_color="white"
/>
<aircraft
@@ -142,10 +142,10 @@
<aircraft
name="TWOG_CHNI"
ac_id="84"
- airframe="airframes/CHNI_Twog.xml"
- radio="radios/cockpitCHNI.xml"
+ airframe="airframes/HB/fixed-wing/CHNI_Twog.xml"
+ radio="radios/HB/cockpitCHNI.xml"
telemetry="telemetry/default.xml"
- flight_plan="flight_plans/strom_chni.xml"
+ flight_plan="flight_plans/HB/strom_chni.xml"
settings="settings/tuning.xml"
gui_color="#ffffffffffff"
/>
Modified: paparazzi3/branches/HB/trunk/sw/airborne/baro_scp.c
===================================================================
--- paparazzi3/branches/HB/trunk/sw/airborne/baro_scp.c 2010-08-27 09:09:54 UTC
(rev 5721)
+++ paparazzi3/branches/HB/trunk/sw/airborne/baro_scp.c 2010-08-27 10:15:40 UTC
(rev 5722)
@@ -1,170 +1,64 @@
+#include <stdio.h>
+#include <math.h>
#include "std.h"
-#include "init_hw.h"
-#include "sys_time.h"
-#include "led.h"
-#include "interrupt_hw.h"
-#include "uart.h"
-#include "messages.h"
-#include "downlink.h"
-
-#include "spi_hw.h"
-
+#include "baro_scp_hw.h"
#include "baro_scp.h"
-#define STA_UNINIT 0
-#define STA_INITIALISING 1
-#define STA_IDLE 2
+// Values for estimator
+float baro_scp_r = 20.;
+float baro_scp_sigma2 = 1.;
+float baro_scp_z = 0.;
-uint8_t baro_scp_status;
-uint32_t baro_scp_pressure;
-uint16_t baro_scp_temperature;
-bool_t baro_scp_available;
+// global variables
+float baro_scp_ground_height = 0.0;
+uint32_t baro_scp_ground_pressure = 10240000;
-static void baro_scp_start_high_res_measurement(void);
-static void baro_scp_read(void);
-static void EXTINT_ISR(void) __attribute__((naked));
-static void SPI1_ISR(void) __attribute__((naked));
+// local variables
+static float Tn = 0.; //!< Temp am Boden in Kelvin zum Zeitpkt der Kalibierung
+static float Pn = 0.; //!< Druck am Boden hPa zum Zeitpunkt der Kalibierung
+static float Hn = 0.; //!< Hoehe über NN zum Zeitpunkt der Kalibierung
-void baro_scp_periodic(void) {
- if (baro_scp_status == STA_UNINIT && cpu_time_sec > 1) {
- baro_scp_start_high_res_measurement();
- baro_scp_status = STA_INITIALISING;
- }
+/**
+ * Kalibierung des Drucks und der Temperatur am Boden
+ *
+ * \author Oliver Riesener
+ *
+ * \param [in] h_über_nn Aktuelle Hoehe ueber NN
+ *
+ * \return Setzen der Modul lokalen Variablen Tn, Pn, Hn
+ */
+void baro_scp_calibrate( float h_ueber_nn) {
+ // warten auf baro_scp_available
+ while( !baro_scp_available );
+ // speichern der werte am boden
+ Tn = 273.15+baro_scp_temperature;
+ Pn = baro_scp_pressure;
+ Hn = h_ueber_nn;
+ baro_scp_ground_height = h_ueber_nn;
+ // global den druck merken
+ baro_scp_ground_pressure = baro_scp_pressure;
}
-/* ssp input clock 468.75kHz, clock that divided by SCR+1 */
-#define SSP_CLOCK 468750
-
-/* SSPCR0 settings */
-#define SSP_DDS 0x07 << 0 /* data size : 8 bits */
-#define SSP_FRF 0x00 << 4 /* frame format : SPI */
-#define SSP_CPOL 0x00 << 6 /* clock polarity : data captured on first
clock transition */
-#define SSP_CPHA 0x00 << 7 /* clock phase : SCK idles low */
-#define SSP_SCR 0x0F << 8 /* serial clock rate : divide by 16 */
-
-/* SSPCR1 settings */
-#define SSP_LBM 0x00 << 0 /* loopback mode : disabled */
-#define SSP_SSE 0x00 << 1 /* SSP enable : disabled */
-#define SSP_MS 0x00 << 2 /* master slave mode : master */
-#define SSP_SOD 0x00 << 3 /* slave output disable : don't care when master */
-
-#define SS_PIN 20
-#define SS_IODIR IO0DIR
-#define SS_IOSET IO0SET
-#define SS_IOCLR IO0CLR
-
-#define ScpSelect() SetBit(SS_IOCLR,SS_PIN)
-#define ScpUnselect() SetBit(SS_IOSET,SS_PIN)
-
-void baro_scp_init( void ) {
- /* setup pins for SSP (SCK, MISO, MOSI) */
- PINSEL1 |= 2 << 2 | 2 << 4 | 2 << 6;
-
- /* setup SSP */
- SSPCR0 = SSP_DDS | SSP_FRF | SSP_CPOL | SSP_CPHA | SSP_SCR;
- SSPCR1 = SSP_LBM | SSP_MS | SSP_SOD;
- /* set prescaler for SSP clock */
- SSPCPSR = PCLK/SSP_CLOCK;
-
- /* initialize interrupt vector */
- VICIntSelect &= ~VIC_BIT(VIC_SPI1); // SPI1 selected as IRQ
- VICIntEnable = VIC_BIT(VIC_SPI1); // SPI1 interrupt enabled
- VICVectCntl7 = VIC_ENABLE | VIC_SPI1;
- VICVectAddr7 = (uint32_t)SPI1_ISR; // address of the ISR
-
- /* configure SS pin */
- SetBit(SS_IODIR, SS_PIN); /* pin is output */
- ScpUnselect(); /* pin idles high */
-
- /* configure DRDY pin */
- /* connected pin to EXINT */
- SPI1_DRDY_PINSEL |= SPI1_DRDY_PINSEL_VAL << SPI1_DRDY_PINSEL_BIT;
- SetBit(EXTMODE, SPI1_DRDY_EINT); /* EINT is edge trigered */
- SetBit(EXTPOLAR,SPI1_DRDY_EINT); /* EINT is trigered on rising edge */
- SetBit(EXTINT,SPI1_DRDY_EINT); /* clear pending EINT */
-
- /* initialize interrupt vector */
- VICIntSelect &= ~VIC_BIT( SPI1_DRDY_VIC_IT ); /* select EINT as IRQ source
*/
- VICIntEnable = VIC_BIT( SPI1_DRDY_VIC_IT ); /* enable it */
- VICVectCntl11 = VIC_ENABLE | SPI1_DRDY_VIC_IT;
- VICVectAddr11 = (uint32_t)EXTINT_ISR; // address of the ISR
-
- baro_scp_status = STA_UNINIT;
-}
-
-void SPI1_ISR(void) {
- ISR_ENTRY();
-
- if (baro_scp_status == STA_INITIALISING) {
- uint8_t foo1 = SSPDR;
- uint8_t foo2 = SSPDR;
- baro_scp_status = STA_IDLE;
- foo1=foo2;
- }
- else if (baro_scp_status == STA_IDLE) {
-
- uint8_t foo0 = SSPDR;
- baro_scp_temperature = SSPDR<<8;
- baro_scp_temperature += SSPDR;
- if (baro_scp_temperature & 0x2000) {
- baro_scp_temperature |= 0xC000;
+/**
+ * Barometrische Hoehenformel mit Temperatur
+ *
+ * \author Oliver Riesener
+ *
+ * \param [in] Ph Druck in der Höhe [hP]
+ * \param [in] Th Temperatur [gC] in der Höhe
+ */
+float baro_scp_height( unsigned int Ph, float Th ) {
+ // Th in Kelvin umrechnen
+ Th += 273.15;
+ const float g = 9.80665; //!< Schwerebeschleunigung der Erde [m/s^2]
+ float R = 287.; //!< Gaskonstante fuer Luft [J/kgK]
+ float Tm = (Tn+Th)/2; //!< Mitteltemperatur (Grad Kelvin) zwischen ph, pn)
+ float h;
+ if ( Ph != 0. ) {
+ h=R*Tm/g*logf(Pn/Ph); //!< Berechnung der Hoehe in [m]
+ } else {
+ h=33333; // Sensor kaputt oder im Weltall
}
- baro_scp_temperature *= 5;
-
- uint8_t foo1 = SSPDR;
- uint32_t datard8 = SSPDR<<16;
- uint8_t foo2 = SSPDR;
- baro_scp_pressure = SSPDR<<8;
- baro_scp_pressure += SSPDR;
- baro_scp_pressure += datard8;
- baro_scp_pressure *= 25;
- baro_scp_available = TRUE;
- foo1=foo2;
- foo0=foo2;
- }
-
- ScpUnselect();
- SpiClearRti();
- SpiDisable();
-
- VICVectAddr = 0x00000000; /* clear this interrupt from the VIC */
- ISR_EXIT();
+ return h;
}
-
-void EXTINT_ISR(void) {
- ISR_ENTRY();
- baro_scp_read();
-
- SetBit(EXTINT,SPI1_DRDY_EINT); /* clear EINT2 */
- VICVectAddr = 0x00000000; /* clear this interrupt from the VIC */
- ISR_EXIT();
-}
-
-/* write 0x0A to 0x03 */
-static void baro_scp_start_high_res_measurement(void) {
- uint8_t cmd = 0x03<<2|0x02;
- uint8_t data = 0x0A;
- ScpSelect();
- SSPDR = cmd;
- SSPDR = data;
- SpiEnableRti();
- SpiEnable();
-}
-
-/* read 0x21 (TEMP), 0x1F (MSB) and 0x20 (LSB) */
-static void baro_scp_read(void) {
- uint8_t cmd0 = 0x21 << 2;
- uint8_t cmd1 = 0x1F << 2;
- uint8_t cmd2 = 0x20 << 2;
- ScpSelect();
- SSPDR = cmd0;
- SSPDR = 0;
- SSPDR = 0;
- SSPDR = cmd1;
- SSPDR = 0;
- SSPDR = cmd2;
- SSPDR = 0;
- SSPDR = 0;
- SpiEnable();
-}
Modified: paparazzi3/branches/HB/trunk/sw/airborne/baro_scp.h
===================================================================
--- paparazzi3/branches/HB/trunk/sw/airborne/baro_scp.h 2010-08-27 09:09:54 UTC
(rev 5721)
+++ paparazzi3/branches/HB/trunk/sw/airborne/baro_scp.h 2010-08-27 10:15:40 UTC
(rev 5722)
@@ -1,3 +1,30 @@
+/*
+ * Copyright (C) 2010 Hochschule Bremen
+ *
+ * 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 baro_scp.h
+ * \brief Handling of the SCP1000 pressure sensor
+ *
+ */
+
#ifndef BARO_SCP_H
#define BARO_SCP_H
@@ -3,15 +30,25 @@
#include "std.h"
-#define STA_UNINIT 0
-#define STA_INITIALISING 1
-#define STA_IDLE 2
+extern bool_t alt_baro_enabled;
+extern float baro_scp_rel_height;
+extern float baro_scp_z;
-extern uint8_t baro_scp_status;
-extern uint32_t baro_scp_pressure;
-extern uint16_t baro_scp_temperature;
-extern bool_t baro_scp_available;
+#ifdef USE_BARO_SCP
-void baro_scp_init(void);
-void baro_scp_periodic(void);
+#include "baro_scp_hw.h"
-#endif
+// Values for estimator
+extern float baro_scp_r;
+extern float baro_scp_sigma2;
+
+// global variables
+extern uint32_t baro_scp_ground_pressure;
+extern float baro_scp_ground_height;
+
+// functions
+void baro_scp_calibrate( float h_ueber_nn);
+float baro_scp_height( unsigned int Ph, float Th );
+
+#endif // USE_BARO_SCP
+
+#endif // BARO_SCP_H
Added: paparazzi3/branches/HB/trunk/sw/airborne/diydrones/arduimu.c
===================================================================
--- paparazzi3/branches/HB/trunk/sw/airborne/diydrones/arduimu.c
(rev 0)
+++ paparazzi3/branches/HB/trunk/sw/airborne/diydrones/arduimu.c
2010-08-27 10:15:40 UTC (rev 5722)
@@ -0,0 +1,282 @@
+#include <math.h>
+
+#include "wiring.h"
+#include "vector.h"
+#include "matrix.h"
+#include "read_adc.h"
+#include "arduimu.h"
+
+#include "dcm.h"
+
+// Released under Creative Commons License
+// Code by Jordi Munoz and William Premerlani, Supported by Chris Anderson
(Wired) and Nathan Sindle (SparkFun).
+// Version 1.0 for flat board updated by Doug Weibel and Jose Julio
+// Version 1.7 includes support for SCP1000 absolute pressure sensor
+
+// Axis definition: X axis pointing forward, Y axis pointing to the right and
Z axis pointing down.
+// Positive pitch : nose up
+// Positive roll : right wing down
+// Positive yaw : clockwise
+
+// olri #include <avr/eeprom.h>
+// olri #include <Wire.h>
+
+//**********************************************************************
+// This section contains USER PARAMETERS !!!
+//
+//**********************************************************************
+
+// *** NOTE! Hardware version - Can be used for v1 (daughterboards) or v2
(flat)
+#define BOARD_VERSION 2 // 1 For V1 and 2 for V2
+
+// Ublox gps is recommended!
+#define GPS_PROTOCOL 1 // 1 - Ublox, 2 - EM406, 3 - NMEA We have only
tested with Ublox
+
+// Enable Air Start uses Remove Before Fly flag - connection to pin 6 on
ArduPilot
+#define ENABLE_AIR_START 1 // 1 if using airstart/groundstart signaling, 0
if not
+#define GROUNDSTART_PIN 8 // Pin number used for ground start signal
(recommend 10 on v1 and 8 on v2 hardware)
+
+/*Min Speed Filter for Yaw drift Correction*/
+#define SPEEDFILT 2 // >1 use min speed filter for yaw drift cancellation,
0=do not use speed filter
+
+/*For debugging propurses*/
+#define PRINT_DEBUG 0 //Will print Debug messages
+
+//OUTPUTMODE=1 will print the corrected data, 0 will print uncorrected data of
the gyros (with drift), 2 will print accelerometer only data
+#define OUTPUTMODE 1
+
+#define PRINT_DCM 0 //Will print the whole direction cosine matrix
+#define PRINT_ANALOGS 0 //Will print the analog raw data
+#define PRINT_EULER 0 //Will print the Euler angles Roll, Pitch and Yaw
+#define PRINT_GPS 1 //Will print GPS data
+
+// *** NOTE! To use ArduIMU with ArduPilot you must select binary output
messages
+#define PRINT_BINARY 1 //Will print binary message and suppress ASCII
messages (above)
+
+// *** NOTE! Performance reporting is only supported for Ublox. Set to 0
for others
+#define PERFORMANCE_REPORTING 1 //Will include performance reports in the
binary output ~ 1/2 min
+
+/* Support for optional magnetometer (1 enabled, 0 dissabled) */
+#define USE_MAGNETOMETER 0 // use 1 if you want to make yaw gyro drift
corrections using the optional magnetometer
+
+/* Support for optional barometer (1 enabled, 0 dissabled) */
+#define USE_BAROMETER 0 // use 1 if you want to get altitude using the
optional absolute pressure sensor
+#define ALT_MIX 50 // For binary messages: GPS or
barometric altitude. 0 to 100 = % of barometric. For example 75 gives 25% GPS
alt and 75% baro
+
+//**********************************************************************
+// End of user parameters
+//**********************************************************************
+
+#define SOFTWARE_VER "1.7"
+
+// ADC : Voltage reference 3.3v / 10bits(1024 steps) => 3.22mV/ADC step
+// ADXL335 Sensitivity(from datasheet) => 330mV/g, 3.22mV/ADC step => 330/3.22
= 102.48
+// Tested value : 101
+//#define GRAVITY 101 //this equivalent to 1G in the raw data coming from the
accelerometer
+//#define GRAVITY 9.81
+
+// olri #define Accel_Scale(x) x*(GRAVITY/9.81)//Scaling the raw data of the
accel to actual acceleration in meters for seconds square
+
+// olri #define ToRad(x) (x*0.01745329252) // *pi/180
+// olri #define ToDeg(x) (x*57.2957795131) // *180/pi
+
+// LPR530 & LY530 Sensitivity (from datasheet) => 3.33mV/º/s, 3.22mV/ADC step
=> 1.03
+// Tested values : 0.96,0.96,0.94
+ // #define Gyro_Gain_X 0.92 //X axis Gyro gain
+ // #define Gyro_Gain_Y 0.92 //Y axis Gyro gain
+ // #define Gyro_Gain_Z 0.94 //Z axis Gyro gain
+ // olri #define Gyro_Scaled_X(x) x*ToRad(Gyro_Gain_X) //Return the scaled
ADC raw data of the gyro in radians for second
+ // olri #define Gyro_Scaled_Y(x) x*ToRad(Gyro_Gain_Y) //Return the scaled
ADC raw data of the gyro in radians for second
+ // olri #define Gyro_Scaled_Z(x) x*ToRad(Gyro_Gain_Z) //Return the scaled
ADC raw data of the gyro in radians for second
+
+//olri #define Kp_ROLLPITCH 0.015
+// olri #define Ki_ROLLPITCH 0.000010
+// olri #define Kp_YAW 1.2
+//#define Kp_YAW 2.5 //High yaw drift correction gain - use with caution!
+// olri #define Ki_YAW 0.00005
+
+/*UBLOX Maximum payload length*/
+#define UBX_MAXPAYLOAD 56
+
+#define ADC_WARM_CYCLES 75
+
+//olri #define FALSE 0
+// olri #define TRUE 1
+
+
+//float G_Dt=0.02; // Integration time (DCM algorithm)
+//chni: changed to 50ms, according to HSB-Data
+float G_Dt=0.05;
+
+long timeNow=0; // Hold the milliseond value for now
+long timer=0; //general purpuse timer
+long timer_old;
+long timer24=0; //Second timer used to print values
+boolean groundstartDone = false; // Used to not repeat ground start
+
+float AN[8]; //array that store the 6 ADC filtered data
+float AN_OFFSET[8]; //Array that stores the Offset of the gyros
+
+float Accel_Vector[3]= {0,0,0}; //Store the acceleration in a vector
+float Gyro_Vector[3]= {0,0,0};//Store the gyros rutn rate in a vector
+float Omega_Vector[3]= {0,0,0}; //Corrected Gyro_Vector data
+float Omega_P[3]= {0,0,0};//Omega Proportional correction
+float Omega_I[3]= {0,0,0};//Omega Integrator
+float Omega[3]= {0,0,0};
+
+//Magnetometer variables
+int magnetom_x;
+int magnetom_y;
+int magnetom_z;
+float MAG_Heading;
+
+// Euler angles
+float roll;
+float pitch;
+float yaw;
+
+float errorRollPitch[3]= {0,0,0};
+float errorYaw[3]= {0,0,0};
+float errorCourse=180;
+float COGX=0; //Course overground X axis
+float COGY=1; //Course overground Y axis
+
+unsigned int cycleCount=0;
+byte gyro_sat=0;
+
+float DCM_Matrix[3][3]= {
+ {
+ 1,0,0 }
+ ,{
+ 0,1,0 }
+ ,{
+ 0,0,1 }
+};
+float Update_Matrix[3][3]={{0,1,2},{3,4,5},{6,7,8}}; //Gyros here
+
+
+float Temporary_Matrix[3][3]={
+ {
+ 0,0,0 }
+ ,{
+ 0,0,0 }
+ ,{
+ 0,0,0 }
+};
+
+//GPS
+
+//GPS stuff
+union long_union {
+ int32_t dword;
+ uint8_t byte[4];
+} longUnion;
+
+union int_union {
+ int16_t word;
+ uint8_t byte[2];
+} intUnion;
+
+/*Flight GPS variables*/
+int gpsFix=1; //This variable store the status of the GPS
+int gpsFixnew=0; //used to flag when new gps data received - used for binary
output message flags
+int gps_fix_count = 5; //used to count 5 good fixes at ground startup
+long lat=0; // store the Latitude from the gps to pass to output
+long lon=0; // Store the Longitude from the gps to pass to output
+long alt_MSL=0; //This is the altitude in millimeters
+long iTOW=0; //GPS Millisecond Time of Week
+long alt=0; //Height above Ellipsoid in millimeters
+float speed_3d=0; //Speed (3-D)
+float ground_speed=0;// This is the velocity your "plane" is traveling in
meters for second, 1Meters/Second= 3.6Km/H = 1.944 knots
+float ground_course=90;//This is the runaway direction of you "plane" in
degrees
+float gc_offset = 0; // Force yaw output to ground course when fresh data
available (only implemented for ublox&binary message)
+byte numSV=0; //Number of Sats used.
+float ecefVZ=0; //Vertical Speed in m/s
+unsigned long GPS_timer=0;
+
+#if GPS_PROTOCOL == 1
+// GPS UBLOX
+//byte ck_a=0; // Packet checksum
+//byte ck_b=0;
+byte UBX_step=0;
+byte UBX_class=0;
+byte UBX_id=0;
+byte UBX_payload_length_hi=0;
+byte UBX_payload_length_lo=0;
+byte UBX_payload_counter=0;
+byte UBX_buffer[UBX_MAXPAYLOAD];
+byte UBX_ck_a=0;
+byte UBX_ck_b=0;
+#endif
+
+//ADC variables
+volatile uint8_t MuxSel=0;
+volatile uint8_t analog_reference = DEFAULT;
+volatile uint16_t analog_buffer[8];
+volatile uint8_t analog_count[8];
+
+
+ #if BOARD_VERSION == 1
+ uint8_t sensors[6] = {0,2,1,3,5,4}; // Use these two lines for Hardware v1
(w/ daughterboards)
+ int SENSOR_SIGN[]= {1,-1,1,-1,1,-1,-1,-1,-1}; //Sensor: GYROX, GYROY,
GYROZ, ACCELX, ACCELY, ACCELZ
+ #endif
+
+ #if BOARD_VERSION == 2
+ uint8_t sensors[6] = {6,7,3,0,1,2}; // For Hardware v2 flat
+ int SENSOR_SIGN[] = {1,-1,-1,1,-1,1,-1,-1,-1};
+ #endif
+
+ // Performance Monitoring variables
+ // Data collected and reported for ~1/2 minute intervals
+ #if PERFORMANCE_REPORTING == 1
+ int mainLoop_count = 0; //Main loop cycles since last report
+ int G_Dt_max = 0.0; //Max main loop cycle time in
milliseconds
+ byte gyro_sat_count = 0;
+ byte adc_constraints = 0;
+ byte renorm_sqrt_count = 0;
+ byte renorm_blowup_count = 0;
+ byte gps_payload_error_count = 0;
+ byte gps_checksum_error_count = 0;
+ byte gps_pos_fix_count = 0;
+ byte gps_nav_fix_count = 0;
+ byte gps_messages_sent = 0;
+ long perf_mon_timer = 0;
+ #endif
+ unsigned int imu_health = 65012;
+
+//**********************************************************************
+// This section contains SCP1000_D11 PARAMETERS !!!
+//**********************************************************************
+#if USE_BAROMETER == 1
+#define SCP_MODE (9) // 9 = high speed mode, 10 = high
resolution mode
+#define PRESSURE_ADDR (0x11U) // IIC address of the SCP1000
+// ************ #define START_ALTITUDE (217U) // default initial
altitude in m above sea level
+
+// When we have to manage data transfers via IIC directly we need to use the
following addresses
+// IIC address of the SCP1000 device forms the Top 7 bits of the address with
the R/W bit as the LSB
+#define READ_PRESSURE_ADDR (PRESSURE_ADDR<<1 | 1)
+#define WRITE_PRESSURE_ADDR (PRESSURE_ADDR<<1)
+
+// SCP1000 Register addresses
+#define SNS_ADDR_POPERATION (0x03U) // OPERATON register
+#define SNS_ADDR_PSTATUS (0x07U) // STATUS register
+#define SNS_ADDR_PPRESSURE (0x80U) // DATARD16 Register (pressure)
+#define SNS_ADDR_DATARD8 (0x7FU) // DAYARD8 Register
+#define SNS_ADDR_PTEMP (0x81U) // TEMPOUT Register (temperature)
+
+#ifndef TRUE
+#define TRUE (0x01)
+#endif
+#ifndef FALSE
+#define FALSE (0x00)
+#endif
+
+int temp_unfilt = 0;
+int temperature = 0;
+unsigned long press = 0;
+unsigned long press_filt = 0;
+unsigned long press_gnd = 0;
+long ground_alt = 0; // Ground altitude in
millimeters
+long press_alt = 0; // Pressure altitude in
millimeters
+
+#endif
Modified: paparazzi3/branches/HB/trunk/sw/airborne/diydrones/arduimu.h
===================================================================
--- paparazzi3/branches/HB/trunk/sw/airborne/diydrones/arduimu.h
2010-08-27 09:09:54 UTC (rev 5721)
+++ paparazzi3/branches/HB/trunk/sw/airborne/diydrones/arduimu.h
2010-08-27 10:15:40 UTC (rev 5722)
@@ -1,5 +1,5 @@
#include <diydrones/wiring.h>
-/* This file was automatically generated. Do not edit! */
+/* This file was automatically generated. Do not edit! */
void debug_print(char string[]);
void startup_air(void);
void debug_handler(byte message);
Modified: paparazzi3/branches/HB/trunk/sw/airborne/diydrones/dcm.h
===================================================================
--- paparazzi3/branches/HB/trunk/sw/airborne/diydrones/dcm.h 2010-08-27
09:09:54 UTC (rev 5721)
+++ paparazzi3/branches/HB/trunk/sw/airborne/diydrones/dcm.h 2010-08-27
10:15:40 UTC (rev 5722)
@@ -1,4 +1,4 @@
-/* This file was automatically generated. Do not edit! */
+/* This file was automatically generated. Do not edit! */
void Euler_angles(void);
void Matrix_update(void);
void Accel_adjust(void);
Modified: paparazzi3/branches/HB/trunk/sw/airborne/diydrones/matrix.c
===================================================================
--- paparazzi3/branches/HB/trunk/sw/airborne/diydrones/matrix.c 2010-08-27
09:09:54 UTC (rev 5721)
+++ paparazzi3/branches/HB/trunk/sw/airborne/diydrones/matrix.c 2010-08-27
10:15:40 UTC (rev 5722)
@@ -1,3 +1,4 @@
+#include "matrix.h"
/**************************************************/
//Multiply two 3x3 matrixs. This function developed by Jordi can be easily
adapted to multiple n*n matrix's. (Pero me da flojera!).
void Matrix_Multiply(float a[3][3], float b[3][3],float mat[3][3])
@@ -14,7 +15,7 @@
mat[x][y]=0;
mat[x][y]=op[0]+op[1]+op[2];
- float test=mat[x][y];
+ // float test=mat[x][y];
}
}
}
Modified: paparazzi3/branches/HB/trunk/sw/airborne/diydrones/matrix.h
===================================================================
--- paparazzi3/branches/HB/trunk/sw/airborne/diydrones/matrix.h 2010-08-27
09:09:54 UTC (rev 5721)
+++ paparazzi3/branches/HB/trunk/sw/airborne/diydrones/matrix.h 2010-08-27
10:15:40 UTC (rev 5722)
@@ -1,2 +1,2 @@
-/* This file was automatically generated. Do not edit! */
+/* This file was automatically generated. Do not edit! */
void Matrix_Multiply(float a[3][3],float b[3][3],float mat[3][3]);
Modified: paparazzi3/branches/HB/trunk/sw/airborne/diydrones/read_adc.c
===================================================================
--- paparazzi3/branches/HB/trunk/sw/airborne/diydrones/read_adc.c
2010-08-27 09:09:54 UTC (rev 5721)
+++ paparazzi3/branches/HB/trunk/sw/airborne/diydrones/read_adc.c
2010-08-27 10:15:40 UTC (rev 5722)
@@ -1,6 +1,7 @@
+#include "read_adc.h"
//extern float adc[11];
float adc[11];
-float read_adc( char i ) {
+float read_adc( unsigned char i ) {
return adc[i];
}
Modified: paparazzi3/branches/HB/trunk/sw/airborne/diydrones/read_adc.h
===================================================================
--- paparazzi3/branches/HB/trunk/sw/airborne/diydrones/read_adc.h
2010-08-27 09:09:54 UTC (rev 5721)
+++ paparazzi3/branches/HB/trunk/sw/airborne/diydrones/read_adc.h
2010-08-27 10:15:40 UTC (rev 5722)
@@ -1,2 +1,2 @@
-/* This file was automatically generated. Do not edit! */
-float read_adc(char i);
+/* This file was automatically generated. Do not edit! */
+float read_adc( unsigned char i);
Modified: paparazzi3/branches/HB/trunk/sw/airborne/diydrones/vector.c
===================================================================
--- paparazzi3/branches/HB/trunk/sw/airborne/diydrones/vector.c 2010-08-27
09:09:54 UTC (rev 5721)
+++ paparazzi3/branches/HB/trunk/sw/airborne/diydrones/vector.c 2010-08-27
10:15:40 UTC (rev 5722)
@@ -1,3 +1,4 @@
+#include "vector.h"
//Computes the dot product of two vectors
float Vector_Dot_Product(float vector1[3],float vector2[3])
{
Modified: paparazzi3/branches/HB/trunk/sw/airborne/diydrones/vector.h
===================================================================
--- paparazzi3/branches/HB/trunk/sw/airborne/diydrones/vector.h 2010-08-27
09:09:54 UTC (rev 5721)
+++ paparazzi3/branches/HB/trunk/sw/airborne/diydrones/vector.h 2010-08-27
10:15:40 UTC (rev 5722)
@@ -1,4 +1,4 @@
-/* This file was automatically generated. Do not edit! */
+/* This file was automatically generated. Do not edit! */
void Vector_Add(float vectorOut[3],float vectorIn1[3],float vectorIn2[3]);
void Vector_Scale(float vectorOut[3],float vectorIn[3],float scale2);
void Vector_Cross_Product(float vectorOut[3],float v1[3],float v2[3]);
Modified: paparazzi3/branches/HB/trunk/sw/airborne/diydrones/wiring.h
===================================================================
--- paparazzi3/branches/HB/trunk/sw/airborne/diydrones/wiring.h 2010-08-27
09:09:54 UTC (rev 5721)
+++ paparazzi3/branches/HB/trunk/sw/airborne/diydrones/wiring.h 2010-08-27
10:15:40 UTC (rev 5722)
@@ -1,4 +1,3 @@
-
/*
wiring.h - Partial implementation of the Wiring API for the ATmega8.
Part of Arduino - http://www.arduino.cc/
@@ -126,7 +125,7 @@
void detachInterrupt(uint8_t);
void setup(void);
-void loop(void);
+// void loop(void);
#ifdef __cplusplus
} // extern "C"
Modified: paparazzi3/branches/HB/trunk/sw/airborne/hmc5843_i2c.c
===================================================================
--- paparazzi3/branches/HB/trunk/sw/airborne/hmc5843_i2c.c 2010-08-27
09:09:54 UTC (rev 5721)
+++ paparazzi3/branches/HB/trunk/sw/airborne/hmc5843_i2c.c 2010-08-27
10:15:40 UTC (rev 5722)
@@ -119,7 +119,7 @@
hmc5843_mag_z++;
// reinvoke
// LED_ON(2);
- hmc5843_status == HMC5843_UNINIT;
+ hmc5843_status = HMC5843_UNINIT;
}
}
}
Modified: paparazzi3/branches/HB/trunk/sw/airborne/infrared.c
===================================================================
--- paparazzi3/branches/HB/trunk/sw/airborne/infrared.c 2010-08-27 09:09:54 UTC
(rev 5721)
+++ paparazzi3/branches/HB/trunk/sw/airborne/infrared.c 2010-08-27 10:15:40 UTC
(rev 5722)
@@ -249,6 +249,7 @@
estimator_theta = (float)ugear_theta/10000 - ir_pitch_neutral;
#endif
#endif
+
#if (defined SITL || defined HITL || !defined RAZOR_IMU)
estimator_phi = estimator_ir_phi;
estimator_theta = estimator_ir_theta;
Modified: paparazzi3/branches/HB/trunk/sw/airborne/main_ap.c
===================================================================
--- paparazzi3/branches/HB/trunk/sw/airborne/main_ap.c 2010-08-27 09:09:54 UTC
(rev 5721)
+++ paparazzi3/branches/HB/trunk/sw/airborne/main_ap.c 2010-08-27 10:15:40 UTC
(rev 5722)
@@ -60,7 +60,6 @@
#else
#include "gpio.h"
#endif
-#include "light.h"
#if defined RADIO_CONTROL || defined RADIO_CONTROL_AUTO1
#include "rc_settings.h"
@@ -160,9 +159,6 @@
#include "osam_imu_ugear.h"
#endif
-#ifdef XSENS
-#include "xsens_ins.h"
-#endif
/*code added by Haiyang Chao ends*/
#ifdef RAZOR_IMU
@@ -185,11 +181,6 @@
#include "modules.h"
#endif
-#ifndef MILLIAMP_PER_PERCENT
-#define MILLIAMP_PER_PERCENT 0
-#endif
-
-
/** FIXME: should be in rc_settings but required by telemetry (ap_downlink.h)*/
uint8_t rc_settings_mode = RC_SETTINGS_MODE_NONE;
@@ -300,15 +291,6 @@
#define RC_LOST_MODE PPRZ_MODE_HOME
#endif
-/*
- * baro_delay(): used vin MP3H6115
- */
-static void baro_delay( void ) {
- volatile int i,j;
- for (i=0;i<1000;i++)
- for (j=0;j<1000;j++);
-}
-
/** \brief Function to be called when a message from FBW is available */
inline void telecommand_task( void ) {
uint8_t mode_changed = FALSE;
@@ -533,8 +515,6 @@
break;
}
- }
-
#ifdef USE_LIGHT
LightPeriodicTask(_1Hz);
#endif
@@ -676,7 +656,6 @@
// I2C0 scheduler
switch (_20Hz) {
case 0:
-
#ifdef USE_AIRSPEED_ETS
airspeed_ets_periodic(); // process airspeed
#endif // USE_AIRSPEED_ETS
@@ -960,6 +939,7 @@
&baro_MP3H6115_off_volt,
&baro_MP3H6115_rel_height);*/
}
+#endif
#ifdef USE_BARO_SCP
baro_scp_init();
@@ -1005,7 +985,6 @@
tcas_init();
#endif
-
}
@@ -1178,6 +1157,7 @@
&hmc5843_mag_y,
&hmc5843_mag_z );
hmc5843_available = FALSE;
+ }
#endif
#ifdef TRIGGER_EXT
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paparazzi-commits] [5722] branch/HB now compiles airframe SAS,
Oliver Riesener <=