paparazzi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paparazzi-commits] [6269] remove old airspeed and ets files


From: Felix Ruess
Subject: [paparazzi-commits] [6269] remove old airspeed and ets files
Date: Tue, 26 Oct 2010 11:21:40 +0000

Revision: 6269
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=6269
Author:   flixr
Date:     2010-10-26 11:21:39 +0000 (Tue, 26 Oct 2010)
Log Message:
-----------
remove old airspeed and ets files

Modified Paths:
--------------
    paparazzi3/trunk/conf/airframes/easystar_ets_example.xml
    paparazzi3/trunk/sw/airborne/estimator.h
    paparazzi3/trunk/sw/airborne/main_ap.c

Removed Paths:
-------------
    paparazzi3/trunk/sw/airborne/airspeed.c
    paparazzi3/trunk/sw/airborne/airspeed.h
    paparazzi3/trunk/sw/airborne/airspeed_ets.c
    paparazzi3/trunk/sw/airborne/airspeed_ets.h

Modified: paparazzi3/trunk/conf/airframes/easystar_ets_example.xml
===================================================================
--- paparazzi3/trunk/conf/airframes/easystar_ets_example.xml    2010-10-26 
11:21:33 UTC (rev 6268)
+++ paparazzi3/trunk/conf/airframes/easystar_ets_example.xml    2010-10-26 
11:21:39 UTC (rev 6269)
@@ -31,7 +31,6 @@
     <subsystem name="control"/>
     <subsystem name="attitude"      type="infrared"/>
     <subsystem name="gps"           type="ublox_lea5h"/>
-    <!--subsystem name="airspeed"      type="ets"/-->
     <subsystem name="navigation"    type="extra"/>
     <subsystem name="i2c"/>
   </firmware>

Deleted: paparazzi3/trunk/sw/airborne/airspeed.c
===================================================================
--- paparazzi3/trunk/sw/airborne/airspeed.c     2010-10-26 11:21:33 UTC (rev 
6268)
+++ paparazzi3/trunk/sw/airborne/airspeed.c     2010-10-26 11:21:39 UTC (rev 
6269)
@@ -1,62 +0,0 @@
-#include "airspeed.h"
-#include "adc.h"
-#include "airframe.h"
-#include "estimator.h"
-#include "gps.h"
-#include "nav.h"
-#include BOARD_CONFIG
-
-#ifdef USE_AIRSPEED_ETS
-#include "airspeed_ets.h"
-#endif
-
-#if defined USE_AIRSPEED || defined MEASURE_AIRSPEED 
-uint16_t adc_airspeed_val;
-#endif
-
-#ifdef ADC_CHANNEL_AIRSPEED
-#ifndef SITL
-static struct adc_buf buf_airspeed;
-#endif
-#elif defined(USE_AIRSPEED_ETS)
-#else
-#error "You compiled the airspeed.c file but did not ADC_CHANNEL_AIRSPEED or 
USE_AIRSPEED_ETS, which is needed in other *.c files"
-#endif
-
-void airspeed_init( void ) {
-#ifdef ADC_CHANNEL_AIRSPEED
-#  ifndef ADC_CHANNEL_AIRSPEED_NB_SAMPLES
-#    error "You defined USE_AIRSPEED but did not assign a 
ADC_CHANNEL_AIRSPEED_NB_SAMPLES"
-#  endif
-#  ifndef SITL
-     adc_buf_channel(ADC_CHANNEL_AIRSPEED, &buf_airspeed, 
ADC_CHANNEL_AIRSPEED_NB_SAMPLES);
-#  endif
-#elif defined(USE_AIRSPEED_ETS)
-#else
-#  error "You defined USE_AIRSPEED but did not define ADC_CHANNEL_AIRSPEED or 
USE_AIRSPEED_ETS"
-#endif
-}
-
-void airspeed_update( void ) {
-#ifndef SITL
-#ifdef ADC_CHANNEL_AIRSPEED
-  adc_airspeed_val = buf_airspeed.sum / buf_airspeed.av_nb_sample;
-#ifdef AIRSPEED_QUADRATIC_SCALE
-  float airspeed = (adc_airspeed_val - AIRSPEED_BIAS);
-  if (airspeed <= 0.0f)
-    airspeed = 0.0f;
-  airspeed = sqrt(airspeed) * AIRSPEED_QUADRATIC_SCALE;
-#else
-  float airspeed = AIRSPEED_SCALE * (adc_airspeed_val - AIRSPEED_BIAS);
-#endif
-  EstimatorSetAirspeed(airspeed);
-#elif defined(USE_AIRSPEED_ETS)
-  EstimatorSetAirspeed(airspeed_ets);
-  adc_airspeed_val = airspeed_ets_raw;
-#endif
-#else // SITL
-  extern float sim_air_speed;
-  EstimatorSetAirspeed(sim_air_speed);
-  adc_airspeed_val = 0;
-#endif //SITL
-}

Deleted: paparazzi3/trunk/sw/airborne/airspeed.h
===================================================================
--- paparazzi3/trunk/sw/airborne/airspeed.h     2010-10-26 11:21:33 UTC (rev 
6268)
+++ paparazzi3/trunk/sw/airborne/airspeed.h     2010-10-26 11:21:39 UTC (rev 
6269)
@@ -1,13 +0,0 @@
-#ifndef AIRSPEED_H
-#define AIRSPEED_H
-
-#include <inttypes.h>
-
-#if defined USE_AIRSPEED || defined MEASURE_AIRSPEED 
-extern uint16_t adc_airspeed_val;
-#endif
-
-void airspeed_init( void );
-void airspeed_update( void );
-
-#endif /* ADC_GENERIC_H */

Deleted: paparazzi3/trunk/sw/airborne/airspeed_ets.c
===================================================================
--- paparazzi3/trunk/sw/airborne/airspeed_ets.c 2010-10-26 11:21:33 UTC (rev 
6268)
+++ paparazzi3/trunk/sw/airborne/airspeed_ets.c 2010-10-26 11:21:39 UTC (rev 
6269)
@@ -1,163 +0,0 @@
-/*
- * Driver for the EagleTree Systems Airspeed Sensor
- * Has only been tested with V3 of the sensor hardware
- *
- * Notes:
- * Connect directly to TWOG/Tiny I2C port. Multiple sensors can be chained 
together.
- * Sensor should be in the proprietary mode (default) and not in 3rd party 
mode.
- * See /conf/airframes/easystar_ets_example.xml for a configuration example.
- *
- * Sensor module wire assignments:
- * Red wire: 5V
- * White wire: Ground
- * Yellow wire: SDA
- * Brown wire: SCL
- *
- * Copyright (C) 2009 Vassilis Varveropoulos
- * Modified by Mark Griffin on 8 September 2010 to work with new i2c 
transaction routines.
- *
- * 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.
- *
- */
-#include "airspeed_ets.h"
-#include "i2c.h"
-#include "nav.h"
-#include <math.h>
-
-#ifdef SITL
-#include "gps.h"
-#endif
-
-#define AIRSPEED_ETS_ADDR 0xEA
-#ifndef AIRSPEED_ETS_SCALE
-#define AIRSPEED_ETS_SCALE 1.8
-#endif
-#ifndef AIRSPEED_ETS_OFFSET
-#define AIRSPEED_ETS_OFFSET 0
-#endif
-#define AIRSPEED_ETS_OFFSET_MAX 1750
-#define AIRSPEED_ETS_OFFSET_MIN 1450
-#define AIRSPEED_ETS_OFFSET_NBSAMPLES_INIT 40
-#define AIRSPEED_ETS_OFFSET_NBSAMPLES_AVRG 60
-#define AIRSPEED_ETS_NBSAMPLES_AVRG 10
-
-// Global variables
-uint16_t airspeed_ets_raw;
-uint16_t airspeed_ets_offset;
-bool_t airspeed_ets_valid;
-float airspeed_ets;
-int airspeed_ets_buffer_idx;
-float airspeed_ets_buffer[AIRSPEED_ETS_NBSAMPLES_AVRG];
-
-struct i2c_transaction airspeed_ets_i2c_trans;
-
-// Local variables
-volatile bool_t airspeed_ets_i2c_done;
-bool_t airspeed_ets_offset_init;
-uint32_t airspeed_ets_offset_tmp;
-uint16_t airspeed_ets_cnt;
-
-void airspeed_ets_init( void ) {
-  int n;
-  airspeed_ets_raw = 0;
-  airspeed_ets = 0.0;
-  airspeed_ets_offset = 0;
-  airspeed_ets_offset_tmp = 0;
-  airspeed_ets_i2c_done = TRUE;
-  airspeed_ets_valid = TRUE;
-  airspeed_ets_offset_init = FALSE;
-  airspeed_ets_cnt = AIRSPEED_ETS_OFFSET_NBSAMPLES_INIT + 
AIRSPEED_ETS_OFFSET_NBSAMPLES_AVRG;
-
-  airspeed_ets_buffer_idx = 0;
-  for (n=0; n < AIRSPEED_ETS_NBSAMPLES_AVRG; ++n)
-    airspeed_ets_buffer[n] = 0.0;
-
-  airspeed_ets_i2c_trans.status = I2CTransSuccess;
-  airspeed_ets_i2c_trans.slave_addr = AIRSPEED_ETS_ADDR;
-  airspeed_ets_i2c_trans.stop_after_transmit = TRUE;
-}
-
-void airspeed_ets_read( void ) {
-  if (airspeed_ets_i2c_trans.status == I2CTransSuccess) {
-    airspeed_ets_i2c_trans.type = I2CTransRx;
-    airspeed_ets_i2c_trans.len_r = 2;
-    i2c_submit(&i2c0, &airspeed_ets_i2c_trans);
-  }
-}      
-
-void airspeed_ets_periodic( void ) {
-  int n;
-  float airspeed_tmp = 0.0;
-
-  // Read raw value
-
-  if (airspeed_ets_i2c_trans.status == I2CTransSuccess) {
-    // Get raw airspeed from buffer
-    airspeed_ets_raw = ((uint16_t)(airspeed_ets_i2c_trans.buf[1]) << 8) | 
(uint16_t)(airspeed_ets_i2c_trans.buf[0]);
-    // Check if this is valid airspeed
-    if (airspeed_ets_raw == 0)
-      airspeed_ets_valid = FALSE;
-    else
-      airspeed_ets_valid = TRUE;
-  }
-  else
-    airspeed_ets_valid = FALSE;
-  // Continue only if a new airspeed value was received  
-  if (airspeed_ets_valid) {  
-    // Calculate offset average if not done already
-    if (!airspeed_ets_offset_init) {
-      --airspeed_ets_cnt;
-      // Check if averaging completed
-      if (airspeed_ets_cnt == 0) {
-        // Calculate average
-        airspeed_ets_offset = (uint16_t)(airspeed_ets_offset_tmp / 
AIRSPEED_ETS_OFFSET_NBSAMPLES_AVRG);
-        // Limit offset
-        if (airspeed_ets_offset < AIRSPEED_ETS_OFFSET_MIN)
-          airspeed_ets_offset = AIRSPEED_ETS_OFFSET_MIN;
-        if (airspeed_ets_offset > AIRSPEED_ETS_OFFSET_MAX)
-          airspeed_ets_offset = AIRSPEED_ETS_OFFSET_MAX;
-        airspeed_ets_offset_init = TRUE;
-      }
-      // Check if averaging needs to continue
-      else if (airspeed_ets_cnt <= AIRSPEED_ETS_OFFSET_NBSAMPLES_AVRG)
-        airspeed_ets_offset_tmp += airspeed_ets_raw;
-    }    
-    // Convert raw to m/s
-    if (airspeed_ets_offset_init && airspeed_ets_raw > airspeed_ets_offset)
-      airspeed_tmp = AIRSPEED_ETS_SCALE * sqrt( 
(float)(airspeed_ets_raw-airspeed_ets_offset) ) - AIRSPEED_ETS_OFFSET;
-    else
-      airspeed_tmp = 0.0;
-    // Airspeed should always be positive
-    if (airspeed_tmp < 0.0)
-      airspeed_tmp = 0.0;
-    // Moving average
-    airspeed_ets_buffer[airspeed_ets_buffer_idx++] = airspeed_tmp;
-    if (airspeed_ets_buffer_idx >= AIRSPEED_ETS_NBSAMPLES_AVRG)
-      airspeed_ets_buffer_idx = 0;
-    airspeed_ets = 0.0;
-    for (n = 0; n < AIRSPEED_ETS_NBSAMPLES_AVRG; ++n)
-      airspeed_ets += airspeed_ets_buffer[n];
-    airspeed_ets = airspeed_ets / (float)AIRSPEED_ETS_NBSAMPLES_AVRG;
-  } else {
-    airspeed_ets = 0.0;
-  }
-}
-
-
-
-

Deleted: paparazzi3/trunk/sw/airborne/airspeed_ets.h
===================================================================
--- paparazzi3/trunk/sw/airborne/airspeed_ets.h 2010-10-26 11:21:33 UTC (rev 
6268)
+++ paparazzi3/trunk/sw/airborne/airspeed_ets.h 2010-10-26 11:21:39 UTC (rev 
6269)
@@ -1,22 +0,0 @@
-/*
- * Driver for the EagleTree Systems Airspeed Sensor
- * Modified by Mark Griffin on 8 September 2010 to work with new i2c 
transaction routines.
- */
-#ifndef AIRSPEED_ETS_H
-#define AIRSPEED_ETS_H
-
-#include "std.h"
-#include "i2c.h"
-
-extern struct i2c_transaction airspeed_ets_i2c_trans;
-
-extern void airspeed_ets_periodic( void );
-extern void airspeed_ets_read( void );
-extern void airspeed_ets_init( void );
-
-extern uint16_t airspeed_ets_raw;
-extern uint16_t airspeed_ets_offset;
-extern bool_t airspeed_ets_valid;
-extern float airspeed_ets;
-
-#endif // AIRSPEED_ETS_H

Modified: paparazzi3/trunk/sw/airborne/estimator.h
===================================================================
--- paparazzi3/trunk/sw/airborne/estimator.h    2010-10-26 11:21:33 UTC (rev 
6268)
+++ paparazzi3/trunk/sw/airborne/estimator.h    2010-10-26 11:21:39 UTC (rev 
6269)
@@ -1,6 +1,6 @@
 /*
  * $Id$
- *  
+ *
  * Copyright (C) 2004-2006  Pascal Brisset, Antoine Drouin
  *
  * This file is part of paparazzi.
@@ -18,7 +18,7 @@
  * You should have received a copy of the GNU General Public License
  * along with paparazzi; see the file COPYING.  If not, write to
  * the Free Software Foundation, 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA. 
+ * Boston, MA 02111-1307, USA.
  *
  */
 
@@ -103,7 +103,7 @@
   } \
 }
 #endif /* ! USE_BARO_MS5534A */
-  
+
 #define EstimatorSetSpeedPol(vhmod, vhdir, vz) { \
   estimator_hspeed_mod = vhmod; \
   estimator_hspeed_dir = vhdir; \

Modified: paparazzi3/trunk/sw/airborne/main_ap.c
===================================================================
--- paparazzi3/trunk/sw/airborne/main_ap.c      2010-10-26 11:21:33 UTC (rev 
6268)
+++ paparazzi3/trunk/sw/airborne/main_ap.c      2010-10-26 11:21:39 UTC (rev 
6269)
@@ -71,10 +71,6 @@
 #include "adc_generic.h"
 #endif
 
-#if defined USE_AIRSPEED || defined MEASURE_AIRSPEED
-#include "airspeed.h"
-#endif
-
 #if defined USE_I2C0 || USE_I2C1
 #include "i2c.h"
 #endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]