Browse Source

corrected some wrong units (used in airspeed calculation)

sbg
Thomas Gubler 12 years ago
parent
commit
2c2c65d446
  1. 2
      apps/systemlib/conversions.c
  2. 8
      apps/systemlib/conversions.h

2
apps/systemlib/conversions.c

@ -150,5 +150,5 @@ void quat2rot(const float Q[4], float R[9]) @@ -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));
}

8
apps/systemlib/conversions.h

@ -44,10 +44,10 @@ @@ -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

Loading…
Cancel
Save