mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 00:53:34 +08:00
Added support for battery voltage and differential pressure to logging and plot script
This commit is contained in:
@@ -42,6 +42,10 @@
|
||||
|
||||
#include "conversions.h"
|
||||
|
||||
#define air_gas_constant 8.31432f
|
||||
#define air_density_sea_level 1.225f
|
||||
#define absolute_null_kelvin 273.15f
|
||||
|
||||
int16_t
|
||||
int16_t_from_bytes(uint8_t bytes[])
|
||||
{
|
||||
@@ -55,3 +59,8 @@ int16_t_from_bytes(uint8_t bytes[])
|
||||
|
||||
return u.w;
|
||||
}
|
||||
|
||||
float get_air_density(float static_pressure, float temperature_celsius)
|
||||
{
|
||||
return static_pressure/(air_gas_constant * (temperature_celsius + absolute_null_kelvin));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user