mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-07 01:04:19 +08:00
voted_sensors_update: make msl_pressure static const
This commit is contained in:
@@ -50,6 +50,9 @@
|
||||
using namespace sensors;
|
||||
using namespace DriverFramework;
|
||||
|
||||
|
||||
const double VotedSensorsUpdate::_msl_pressure = 101.325f;
|
||||
|
||||
VotedSensorsUpdate::VotedSensorsUpdate(const Parameters ¶meters)
|
||||
: _parameters(parameters)
|
||||
{
|
||||
@@ -816,10 +819,10 @@ void VotedSensorsUpdate::baro_poll(struct sensor_combined_s &raw)
|
||||
const double R = 287.05; /* ideal gas constant in J/kg/K */
|
||||
|
||||
/* current pressure at MSL in kPa */
|
||||
double p1 = _msl_pressure / 1000.0;
|
||||
const double p1 = _msl_pressure;
|
||||
|
||||
/* measured pressure in kPa */
|
||||
double p = 0.001f * _last_best_baro_pressure;
|
||||
const double p = 0.001f * _last_best_baro_pressure;
|
||||
|
||||
/*
|
||||
* Solve:
|
||||
|
||||
@@ -276,9 +276,7 @@ private:
|
||||
float _baro_offset[SENSOR_COUNT_MAX]; /**< offsets to be added to the raw baro pressure data after scale factor correction */
|
||||
float _baro_scale[SENSOR_COUNT_MAX]; /**< scale factor corrections to be applied to the raw barp pressure data before offsets are added */
|
||||
|
||||
/* altitude conversion calibration */
|
||||
unsigned _msl_pressure; /* in Pa */
|
||||
|
||||
static const double _msl_pressure; /** average sea-level pressure in kPa */
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user