Skip to content

Commit

Permalink
Merge remote-tracking branch 'paparazzi/master'
Browse files Browse the repository at this point in the history
Conflicts:
	sw/airborne/modules/sensors/baro_board_module.c
  • Loading branch information
gautierhattenberger committed Sep 15, 2012
2 parents bbd2692 + 2e77c82 commit 3f45b20
Show file tree
Hide file tree
Showing 21 changed files with 179 additions and 180 deletions.
4 changes: 4 additions & 0 deletions conf/airframes/examples/easystar_ets.xml
Expand Up @@ -20,6 +20,7 @@
<define name="USE_I2C0"/>
<define name="USE_AIRSPEED"/>
<define name="USE_BARO_ETS"/>
<define name="INS_BARO_SENS" value="0.32"/>

<subsystem name="radio_control" type="ppm"/>
<subsystem name="telemetry" type="transparent"/>
Expand All @@ -36,6 +37,9 @@
<modules>
<load name="airspeed_ets.xml"/>
<load name="baro_ets.xml"/>
<load name="baro_board.xml">
<define name="BARO_ABS_EVENT" value="BaroEtsUpdate"/>
</load>
<load name="infrared_adc.xml"/>
</modules>

Expand Down
68 changes: 0 additions & 68 deletions conf/gui.xml

This file was deleted.

2 changes: 1 addition & 1 deletion conf/modules/baro_board.xml
Expand Up @@ -7,7 +7,7 @@
<header>
<file name="baro_board_module.h"/>
</header>
<makefile target="ap">
<makefile>
<file name="baro_board_module.c"/>
<define name="USE_BAROMETER"/>
</makefile>
Expand Down
1 change: 1 addition & 0 deletions sw/airborne/arch/sim/sim_gps.c
Expand Up @@ -36,6 +36,7 @@ value sim_use_gps_pos(value x, value y, value z, value c, value a, value s, valu
struct UtmCoor_f utm_f;
lla_f.lat = Double_val(lat);
lla_f.lon = Double_val(lon);
lla_f.alt = Double_val(a);
utm_f.zone = nav_utm_zone0;
utm_of_lla_f(&utm_f, &lla_f);
LLA_BFP_OF_REAL(gps.lla_pos, lla_f);
Expand Down
3 changes: 3 additions & 0 deletions sw/airborne/boards/lisa_m_2.0.h
Expand Up @@ -155,4 +155,7 @@
#define PWM5_Pin GPIO0
#define PWM6_Pin GPIO1

// Remap the servos 5 and 6 to TIM5 CH1 and CH2
#define REMAP_SERVOS_5AND6 1

#endif /* CONFIG_LISA_M_2_0_H */
30 changes: 17 additions & 13 deletions sw/airborne/modules/sensors/airspeed_ets.c
@@ -1,17 +1,4 @@
/*
* 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.
*
* 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.
* Converted by Gautier Hattenberger to modules (10/2010)
Expand All @@ -32,8 +19,25 @@
* 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 airspeed_ets.c
*
* 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.
*
* Sensor module wire assignments:
* Red wire: 5V
* White wire: Ground
* Yellow wire: SDA
* Brown wire: SCL
*/

#include "sensors/airspeed_ets.h"
#include "state.h"
#include "mcu_periph/i2c.h"
Expand Down
29 changes: 16 additions & 13 deletions sw/airborne/modules/sensors/airspeed_ets.h
@@ -1,17 +1,4 @@
/*
* 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.
*
* 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.
* Converted by Gautier Hattenberger to modules (10/2010)
Expand All @@ -32,7 +19,23 @@
* 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 airspeed_ets.h
*
* 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.
*
* Sensor module wire assignments:
* Red wire: 5V
* White wire: Ground
* Yellow wire: SDA
* Brown wire: SCL
*/

#ifndef AIRSPEED_ETS_H
Expand Down
7 changes: 4 additions & 3 deletions sw/airborne/modules/sensors/baro_board_module.h
Expand Up @@ -17,11 +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.
*
*/

/*
* Wrapper for the board specific barometer
/**
* @file baro_board_module.h
*
* Wrapper for the board specific barometer.
*/

#ifndef BARO_BOARD_MODULE_H
Expand Down
64 changes: 37 additions & 27 deletions sw/airborne/modules/sensors/baro_ets.c
@@ -1,19 +1,4 @@
/*
* Driver for the EagleTree Systems Altitude 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.
* Pitch gains may need to be updated.
*
*
* Sensor module wire assignments:
* Red wire: 5V
* White wire: Ground
* Yellow wire: SDA
* Brown wire: SCL
*
* Copyright (C) 2009 Vassilis Varveropoulos
* Copyright (C) 2010 The Paparazzi Team
*
Expand All @@ -35,6 +20,25 @@
* Boston, MA 02111-1307, USA.
*/

/**
* @file baro_ets.c
*
* Driver for the EagleTree Systems Altitude 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.
* Pitch gains may need to be updated.
*
*
* Sensor module wire assignments:
* Red wire: 5V
* White wire: Ground
* Yellow wire: SDA
* Brown wire: SCL
*/

#include "sensors/baro_ets.h"
#include "mcu_periph/i2c.h"
#include "state.h"
Expand All @@ -46,6 +50,16 @@
#include "subsystems/gps.h"
#endif

#ifdef BARO_ETS_TELEMETRY
#ifndef DOWNLINK_DEVICE
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
#endif

#include "mcu_periph/uart.h"
#include "messages.h"
#include "subsystems/datalink/downlink.h"
#endif //BARO_ETS_TELEMETRY

#define BARO_ETS_ADDR 0xE8
#define BARO_ETS_REG 0x07
#define BARO_ETS_SCALE 0.32
Expand Down Expand Up @@ -97,23 +111,19 @@ void baro_ets_read_periodic( void ) {
if (baro_ets_i2c_trans.status == I2CTransDone)
I2CReceive(BARO_ETS_I2C_DEV, baro_ets_i2c_trans, BARO_ETS_ADDR, 2);
#else // SITL
/* fake an offset so sim works for under hmsl as well */
if (!baro_ets_offset_init) {
baro_ets_offset = 200;
baro_ets_offset_init = TRUE;
}
baro_ets_altitude = gps.hmsl / 1000.0;
baro_ets_adc = baro_ets_altitude / BARO_ETS_SCALE;
baro_ets_adc = baro_ets_offset - baro_ets_altitude / BARO_ETS_SCALE;
baro_ets_valid = TRUE;
#endif
}

#ifdef BARO_ETS_TELEMETRY

#ifndef DOWNLINK_DEVICE
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
DOWNLINK_SEND_BARO_ETS(DefaultChannel, DefaultDevice, &baro_ets_adc, &baro_ets_offset, &baro_ets_altitude);
#endif

#include "mcu_periph/uart.h"
#include "messages.h"
#include "subsystems/datalink/downlink.h"

#endif
}

void baro_ets_read_event( void ) {
// Get raw altimeter from buffer
Expand Down
34 changes: 19 additions & 15 deletions sw/airborne/modules/sensors/baro_ets.h
@@ -1,19 +1,4 @@
/*
* Driver for the EagleTree Systems Altitude 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.
* Pitch gains may need to be updated.
*
*
* Sensor module wire assignments:
* Red wire: 5V
* White wire: Ground
* Yellow wire: SDA
* Brown wire: SCL
*
* Copyright (C) 2009 Vassilis Varveropoulos
* Copyright (C) 2010 The Paparazzi Team
*
Expand All @@ -35,6 +20,25 @@
* Boston, MA 02111-1307, USA.
*/

/**
* @file baro_ets.h
*
* Driver for the EagleTree Systems Altitude 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.
* Pitch gains may need to be updated.
*
*
* Sensor module wire assignments:
* Red wire: 5V
* White wire: Ground
* Yellow wire: SDA
* Brown wire: SCL
*/

#ifndef BARO_ETS_H
#define BARO_ETS_H

Expand Down
2 changes: 1 addition & 1 deletion sw/airborne/subsystems/ins/ins_float.c
Expand Up @@ -113,7 +113,7 @@ void ins_update_gps(void) {
utm.north = gps.utm_pos.north / 100.;
utm.zone = nav_utm_zone0;

#if !USE_BARO_BMP && !USE_BARO_ETS && !USE_BARO_MS5534A
#if !USE_BAROMETER
float falt = gps.hmsl / 1000.;
EstimatorSetAlt(falt);
#endif
Expand Down

0 comments on commit 3f45b20

Please sign in to comment.