mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-18 03:37:35 +08:00
corrected some wrong units (used in airspeed calculation)
This commit is contained in:
@@ -150,5 +150,5 @@ void quat2rot(const float Q[4], float R[9])
|
||||
|
||||
float get_air_density(float static_pressure, float temperature_celsius)
|
||||
{
|
||||
return static_pressure / (CONSTANTS_AIR_GAS_CONST * (temperature_celsius + CONSTANTS_ABSOLUTE_NULL_KELVIN));
|
||||
return static_pressure / (CONSTANTS_AIR_GAS_CONST * (temperature_celsius - CONSTANTS_ABSOLUTE_NULL_CELSIUS));
|
||||
}
|
||||
|
||||
@@ -44,10 +44,10 @@
|
||||
#include <float.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define CONSTANTS_ONE_G 9.80665f
|
||||
#define CONSTANTS_AIR_DENSITY_SEA_LEVEL_15C 1.225f
|
||||
#define CONSTANTS_AIR_GAS_CONST 8.31432f
|
||||
#define CONSTANTS_ABSOLUTE_NULL_KELVIN 273.15f
|
||||
#define CONSTANTS_ONE_G 9.80665f // m/s^2
|
||||
#define CONSTANTS_AIR_DENSITY_SEA_LEVEL_15C 1.225f // kg/m^3
|
||||
#define CONSTANTS_AIR_GAS_CONST 287.1f // J/(kg * K)
|
||||
#define CONSTANTS_ABSOLUTE_NULL_CELSIUS -273.15f // °C
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user