mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-28 09:58:23 +08:00
[sensors] Fix airspeed ets to work with air_data module (#2733)
This commit is contained in:
@@ -22,10 +22,7 @@
|
|||||||
</module>
|
</module>
|
||||||
|
|
||||||
<module name="airspeed_ets.xml">
|
<module name="airspeed_ets.xml">
|
||||||
<define name="USE_I2C4"/>
|
|
||||||
<configure name="AIRSPEED_ETS_I2C_DEV" value="I2C4"/>
|
<configure name="AIRSPEED_ETS_I2C_DEV" value="I2C4"/>
|
||||||
<define name="AIRSPEED_ETS_SYNC_SEND"/>
|
|
||||||
<define name="USE_AIRSPEED_ETS" value="TRUE"/>
|
|
||||||
<define name="AIRSPEED_ETS_SCALE" value="1.24"/>
|
<define name="AIRSPEED_ETS_SCALE" value="1.24"/>
|
||||||
</module>
|
</module>
|
||||||
|
|
||||||
@@ -351,6 +348,7 @@
|
|||||||
<define name="CRITIC_BAT_LEVEL" value="18.6" unit="V"/>
|
<define name="CRITIC_BAT_LEVEL" value="18.6" unit="V"/>
|
||||||
<define name="LOW_BAT_LEVEL" value="19.2" unit="V"/>
|
<define name="LOW_BAT_LEVEL" value="19.2" unit="V"/>
|
||||||
<define name="MAX_BAT_LEVEL" value="25.2" unit="V"/>
|
<define name="MAX_BAT_LEVEL" value="25.2" unit="V"/>
|
||||||
|
<define name="BAT_NB_CELLS" value="6"/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</airframe>
|
</airframe>
|
||||||
|
|||||||
@@ -357,6 +357,7 @@
|
|||||||
<define name="CRITIC_BAT_LEVEL" value="18.6" unit="V"/>
|
<define name="CRITIC_BAT_LEVEL" value="18.6" unit="V"/>
|
||||||
<define name="LOW_BAT_LEVEL" value="19.2" unit="V"/>
|
<define name="LOW_BAT_LEVEL" value="19.2" unit="V"/>
|
||||||
<define name="MAX_BAT_LEVEL" value="25.2" unit="V"/>
|
<define name="MAX_BAT_LEVEL" value="25.2" unit="V"/>
|
||||||
|
<define name="BAT_NB_CELLS" value="6"/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</airframe>
|
</airframe>
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
#include "mcu_periph/uart.h"
|
#include "mcu_periph/uart.h"
|
||||||
#include "mcu_periph/sys_time.h"
|
#include "mcu_periph/sys_time.h"
|
||||||
#include "pprzlink/messages.h"
|
#include "pprzlink/messages.h"
|
||||||
|
#include "subsystems/abi.h"
|
||||||
#include "subsystems/datalink/downlink.h"
|
#include "subsystems/datalink/downlink.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
@@ -225,6 +226,10 @@ void airspeed_ets_read_event(void)
|
|||||||
airspeed_ets += airspeed_ets_buffer[n];
|
airspeed_ets += airspeed_ets_buffer[n];
|
||||||
}
|
}
|
||||||
airspeed_ets = airspeed_ets / (float)AIRSPEED_ETS_NBSAMPLES_AVRG;
|
airspeed_ets = airspeed_ets / (float)AIRSPEED_ETS_NBSAMPLES_AVRG;
|
||||||
|
|
||||||
|
// Publish airspeed sensor
|
||||||
|
AbiSendMsgAIRSPEED(AIRSPEED_ETS_ID, airspeed_ets);
|
||||||
|
|
||||||
#if USE_AIRSPEED_ETS
|
#if USE_AIRSPEED_ETS
|
||||||
stateSetAirspeed_f(airspeed_ets);
|
stateSetAirspeed_f(airspeed_ets);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -107,6 +107,10 @@
|
|||||||
#define AIRSPEED_SDP3X_ID 3
|
#define AIRSPEED_SDP3X_ID 3
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef AIRSPEED_ETS_ID
|
||||||
|
#define AIRSPEED_ETS_ID 4
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* IDs of Incidence angles (message 24)
|
* IDs of Incidence angles (message 24)
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user