[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paparazzi-commits] [5561] changed for new baro
From: |
antoine drouin |
Subject: |
[paparazzi-commits] [5561] changed for new baro |
Date: |
Sun, 22 Aug 2010 01:20:58 +0000 |
Revision: 5561
http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=5561
Author: poine
Date: 2010-08-22 01:20:58 +0000 (Sun, 22 Aug 2010)
Log Message:
-----------
changed for new baro
Modified Paths:
--------------
paparazzi3/trunk/sw/airborne/booz/booz2_ins.c
paparazzi3/trunk/sw/airborne/booz/booz2_main.c
paparazzi3/trunk/sw/airborne/booz/booz2_telemetry.h
Modified: paparazzi3/trunk/sw/airborne/booz/booz2_ins.c
===================================================================
--- paparazzi3/trunk/sw/airborne/booz/booz2_ins.c 2010-08-22 01:20:19 UTC
(rev 5560)
+++ paparazzi3/trunk/sw/airborne/booz/booz2_ins.c 2010-08-22 01:20:58 UTC
(rev 5561)
@@ -25,7 +25,7 @@
#include "booz2_ins.h"
#include "booz_imu.h"
-#include "booz2_analog_baro.h"
+#include "rotorcraft/baro.h"
#include "booz_gps.h"
#include "airframe.h"
@@ -150,7 +150,7 @@
float z_accel_float = ACCEL_FLOAT_OF_BFP(accel_ltp.z);
#ifdef USE_VFF
- if (booz2_analog_baro_status == BOOZ2_ANALOG_BARO_RUNNING &&
booz_ins_baro_initialised) {
+ if (baro.status == BS_RUNNING && booz_ins_baro_initialised) {
b2_vff_propagate(z_accel_float);
booz_ins_ltp_accel.z = ACCEL_BFP_OF_REAL(b2_vff_zdotdot);
booz_ins_ltp_speed.z = SPEED_BFP_OF_REAL(b2_vff_zdot);
@@ -178,16 +178,16 @@
void booz_ins_update_baro() {
#ifdef USE_VFF
- if (booz2_analog_baro_status == BOOZ2_ANALOG_BARO_RUNNING) {
+ if (baro.status == BS_RUNNING) {
if (!booz_ins_baro_initialised) {
- booz_ins_qfe = booz2_analog_baro_value;
+ booz_ins_qfe = baro.absolute;
booz_ins_baro_initialised = TRUE;
}
- booz_ins_baro_alt = (((int32_t)booz2_analog_baro_value - booz_ins_qfe) *
BOOZ_INS_BARO_SENS_NUM)/BOOZ_INS_BARO_SENS_DEN;
+ booz_ins_baro_alt = ((baro.absolute - booz_ins_qfe) *
BOOZ_INS_BARO_SENS_NUM)/BOOZ_INS_BARO_SENS_DEN;
float alt_float = POS_FLOAT_OF_BFP(booz_ins_baro_alt);
if (booz_ins_vf_realign) {
booz_ins_vf_realign = FALSE;
- booz_ins_qfe = booz2_analog_baro_value;
+ booz_ins_qfe = baro.absolute;
b2_vff_realign(0.);
booz_ins_ltp_accel.z = ACCEL_BFP_OF_REAL(b2_vff_zdotdot);
booz_ins_ltp_speed.z = SPEED_BFP_OF_REAL(b2_vff_zdot);
Modified: paparazzi3/trunk/sw/airborne/booz/booz2_main.c
===================================================================
--- paparazzi3/trunk/sw/airborne/booz/booz2_main.c 2010-08-22 01:20:19 UTC
(rev 5560)
+++ paparazzi3/trunk/sw/airborne/booz/booz2_main.c 2010-08-22 01:20:58 UTC
(rev 5561)
@@ -41,7 +41,8 @@
#include "booz_imu.h"
#include "booz_gps.h"
-#include "booz2_analog_baro.h"
+#include "rotorcraft/baro.h"
+
#include "booz2_battery.h"
#include "booz_fms.h"
@@ -68,7 +69,8 @@
#endif
static inline void on_gyro_accel_event( void );
-static inline void on_baro_event( void );
+static inline void on_baro_abs_event( void );
+static inline void on_baro_dif_event( void );
static inline void on_gps_event( void );
static inline void on_mag_event( void );
@@ -102,8 +104,7 @@
actuators_init();
radio_control_init();
- booz2_analog_init();
- booz2_analog_baro_init();
+ baro_init();
#if defined USE_CAM || USE_DROP
booz2_pwm_init_hw();
@@ -163,11 +164,12 @@
{ \
LED_PERIODIC(); \
}, \
+ { baro_periodic();
+ }, \
{},
\
{},
\
{},
\
{},
\
- {},
\
{ \
Booz2TelemetryPeriodic();
\
} \
@@ -204,7 +206,7 @@
BoozImuEvent(on_gyro_accel_event, on_mag_event);
- Booz2AnalogBaroEvent(on_baro_event);
+ BaroEvent(on_baro_abs_event, on_baro_dif_event);
#ifdef USE_GPS
BoozGpsEvent(on_gps_event);
@@ -240,11 +242,14 @@
}
}
-static inline void on_baro_event( void ) {
+static inline void on_baro_abs_event( void ) {
booz_ins_update_baro();
}
+static inline void on_baro_dif_event( void ) {
+}
+
static inline void on_gps_event(void) {
booz_ins_update_gps();
}
Modified: paparazzi3/trunk/sw/airborne/booz/booz2_telemetry.h
===================================================================
--- paparazzi3/trunk/sw/airborne/booz/booz2_telemetry.h 2010-08-22 01:20:19 UTC
(rev 5560)
+++ paparazzi3/trunk/sw/airborne/booz/booz2_telemetry.h 2010-08-22 01:20:58 UTC
(rev 5561)
@@ -170,13 +170,24 @@
&booz_imu.mag_unscaled.z); \
}
-#define PERIODIC_SEND_BOOZ2_BARO_RAW(_chan) { \
+/* FIXME: make that depend on board */
+#define PERIODIC_SEND_BOOZ_BARO_RAW(_chan) { \
DOWNLINK_SEND_BOOZ2_BARO_RAW(_chan,
\
- &booz2_analog_baro_offset, \
- &booz2_analog_baro_value, \
- &booz2_analog_baro_value_filtered); \
+ &baro_board.offset, \
+ &baro.absolute, \
+ &baro_board.value_filtered); \
}
+
+#define PERIODIC_SEND_BARO_RAW(_chan) {
\
+ DOWNLINK_SEND_BARO_RAW(_chan, \
+ &baro.absolute, \
+ &baro.differential); \
+ }
+
+
+
+
#include "booz_stabilization.h"
#define PERIODIC_SEND_BOOZ2_RATE_LOOP(_chan) { \
DOWNLINK_SEND_BOOZ2_RATE_LOOP(_chan, \
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paparazzi-commits] [5561] changed for new baro,
antoine drouin <=