mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-27 17:06:31 +08:00
Merge branch 'baro' into dev
This commit is contained in:
+1
-5
@@ -1330,11 +1330,7 @@
|
|||||||
<field name="status" type="uint8" values="OK|LOST|REALLY_LOST"/>
|
<field name="status" type="uint8" values="OK|LOST|REALLY_LOST"/>
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
<message name="BOOZ_BARO_RAW" id="161">
|
<!-- 161 is free -->
|
||||||
<field name="offset" type="uint16"/>
|
|
||||||
<field name="value" type="uint16"/>
|
|
||||||
<field name="value_filtered" type="uint16"/>
|
|
||||||
</message>
|
|
||||||
|
|
||||||
<message name="VFF" id="162">
|
<message name="VFF" id="162">
|
||||||
<field name="measure" type="float"/>
|
<field name="measure" type="float"/>
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
</header>
|
</header>
|
||||||
<init fun="baro_init()"/>
|
<init fun="baro_init()"/>
|
||||||
<periodic fun="baro_periodic()" freq="60."/>
|
<periodic fun="baro_periodic()" freq="60."/>
|
||||||
<periodic fun="baro_downlink_raw()" freq="10." autorun="FALSE"/>
|
|
||||||
<event fun="BaroEvent(baro_abs,baro_diff)"/>
|
<event fun="BaroEvent(baro_abs,baro_diff)"/>
|
||||||
<makefile target="ap">
|
<makefile target="ap">
|
||||||
<file name="baro_board.c" dir="boards/$(BOARD)"/>
|
<file name="baro_board.c" dir="boards/$(BOARD)"/>
|
||||||
|
|||||||
@@ -69,13 +69,14 @@
|
|||||||
<message name="IMU_ACCEL_RAW" period=".05"/>
|
<message name="IMU_ACCEL_RAW" period=".05"/>
|
||||||
<message name="IMU_GYRO_RAW" period=".05"/>
|
<message name="IMU_GYRO_RAW" period=".05"/>
|
||||||
<message name="IMU_MAG_RAW" period=".05"/>
|
<message name="IMU_MAG_RAW" period=".05"/>
|
||||||
|
<message name="BARO_RAW" period="0.5"/>
|
||||||
</mode>
|
</mode>
|
||||||
<mode name="scaled_sensors">
|
<mode name="scaled_sensors">
|
||||||
<message name="DL_VALUE" period="0.5"/>
|
<message name="DL_VALUE" period="0.5"/>
|
||||||
<message name="ALIVE" period="2.1"/>
|
<message name="ALIVE" period="2.1"/>
|
||||||
<message name="IMU_GYRO" period=".075"/>
|
<message name="IMU_GYRO" period=".075"/>
|
||||||
<message name="IMU_ACCEL" period=".075"/>
|
<message name="IMU_ACCEL" period=".075"/>
|
||||||
<message name="IMU_MAG" period=".1"/>
|
<message name="IMU_MAG" period=".1"/>
|
||||||
</mode>
|
</mode>
|
||||||
<mode name="debug_imu">
|
<mode name="debug_imu">
|
||||||
<message name="ATTITUDE" period="0.1"/>
|
<message name="ATTITUDE" period="0.1"/>
|
||||||
|
|||||||
@@ -69,6 +69,7 @@
|
|||||||
<message name="IMU_ACCEL_RAW" period=".05"/>
|
<message name="IMU_ACCEL_RAW" period=".05"/>
|
||||||
<message name="IMU_GYRO_RAW" period=".05"/>
|
<message name="IMU_GYRO_RAW" period=".05"/>
|
||||||
<message name="IMU_MAG_RAW" period=".05"/>
|
<message name="IMU_MAG_RAW" period=".05"/>
|
||||||
|
<message name="BARO_RAW" period="0.5"/>
|
||||||
</mode>
|
</mode>
|
||||||
<mode name="scaled_sensors">
|
<mode name="scaled_sensors">
|
||||||
<message name="DL_VALUE" period="0.5"/>
|
<message name="DL_VALUE" period="0.5"/>
|
||||||
|
|||||||
@@ -27,14 +27,6 @@
|
|||||||
|
|
||||||
#include "subsystems/sensors/baro.h"
|
#include "subsystems/sensors/baro.h"
|
||||||
|
|
||||||
// Downlink
|
|
||||||
#include "mcu_periph/uart.h"
|
|
||||||
#include "messages.h"
|
|
||||||
#include "subsystems/datalink/downlink.h"
|
|
||||||
|
|
||||||
#ifndef DOWNLINK_DEVICE
|
|
||||||
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Common Baro struct */
|
/* Common Baro struct */
|
||||||
struct Baro baro;
|
struct Baro baro;
|
||||||
@@ -78,8 +70,3 @@ void baro_periodic( void ) {
|
|||||||
ads1114_read(&BARO_ABS_ADS);
|
ads1114_read(&BARO_ABS_ADS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void baro_downlink_raw( void )
|
|
||||||
{
|
|
||||||
DOWNLINK_SEND_BARO_RAW(DefaultChannel, DefaultDevice,&baro.absolute,&baro.differential);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -46,8 +46,6 @@ extern float baro_alt_offset;
|
|||||||
#define BaroAltHandler() { baro_alt = BARO_SENS*(baro_alt_offset - (float)baro.absolute); }
|
#define BaroAltHandler() { baro_alt = BARO_SENS*(baro_alt_offset - (float)baro.absolute); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void baro_downlink_raw( void );
|
|
||||||
|
|
||||||
#define BARO_ABS_ADS ads1114_1
|
#define BARO_ABS_ADS ads1114_1
|
||||||
|
|
||||||
#define BaroAbs(_ads, _handler) { \
|
#define BaroAbs(_ads, _handler) { \
|
||||||
|
|||||||
@@ -239,6 +239,16 @@ extern uint8_t telemetry_mode_Ap_DefaultChannel;
|
|||||||
#define PERIODIC_SEND_SCP_STATUS(_trans, _dev) {}
|
#define PERIODIC_SEND_SCP_STATUS(_trans, _dev) {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef BOARD_HAS_BARO
|
||||||
|
#define PERIODIC_SEND_BARO_RAW(_chan) { \
|
||||||
|
DOWNLINK_SEND_BARO_RAW(_chan, \
|
||||||
|
&baro.absolute, \
|
||||||
|
&baro.differential); \
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#define PERIODIC_SEND_BARO_RAW(_chan) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef MEASURE_AIRSPEED
|
#ifdef MEASURE_AIRSPEED
|
||||||
#define PERIODIC_SEND_AIRSPEED(_trans, _dev) DOWNLINK_SEND_AIRSPEED (_trans, _dev, &estimator_airspeed, &estimator_airspeed, &estimator_airspeed, &estimator_airspeed)
|
#define PERIODIC_SEND_AIRSPEED(_trans, _dev) DOWNLINK_SEND_AIRSPEED (_trans, _dev, &estimator_airspeed, &estimator_airspeed, &estimator_airspeed, &estimator_airspeed)
|
||||||
#elif USE_AIRSPEED
|
#elif USE_AIRSPEED
|
||||||
|
|||||||
@@ -174,23 +174,13 @@ extern uint8_t telemetry_mode_Main_DefaultChannel;
|
|||||||
&imu.mag_unscaled.z); \
|
&imu.mag_unscaled.z); \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: make that depend on board */
|
#define PERIODIC_SEND_BARO_RAW(_trans, _dev) { \
|
||||||
#define PERIODIC_SEND_BOOZ_BARO_RAW(_trans, _dev) { \
|
DOWNLINK_SEND_BARO_RAW(_trans, _dev, \
|
||||||
DOWNLINK_SEND_BOOZ2_BARO_RAW(_trans, _dev, \
|
&baro.absolute, \
|
||||||
&baro_board.offset, \
|
&baro.differential); \
|
||||||
&baro.absolute, \
|
|
||||||
&baro_board.value_filtered); \
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define PERIODIC_SEND_BARO_RAW(_trans, _dev) { \
|
|
||||||
DOWNLINK_SEND_BARO_RAW(_trans, _dev, \
|
|
||||||
&baro.absolute, \
|
|
||||||
&baro.differential); \
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "firmwares/rotorcraft/stabilization.h"
|
#include "firmwares/rotorcraft/stabilization.h"
|
||||||
#define PERIODIC_SEND_RATE_LOOP(_trans, _dev) { \
|
#define PERIODIC_SEND_RATE_LOOP(_trans, _dev) { \
|
||||||
|
|||||||
Reference in New Issue
Block a user