mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-16 23:57:34 +08:00
VehicleAirData: remove unused air temperature handling
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -78,23 +78,6 @@ void VehicleAirData::Stop()
|
||||
}
|
||||
}
|
||||
|
||||
void VehicleAirData::AirTemperatureUpdate()
|
||||
{
|
||||
differential_pressure_s differential_pressure;
|
||||
|
||||
static constexpr float temperature_min_celsius = -20.f;
|
||||
static constexpr float temperature_max_celsius = 35.f;
|
||||
|
||||
// update air temperature if data from differential pressure sensor is finite and not exactly 0
|
||||
// limit the range to max 35°C to limt the error due to heated up airspeed sensors prior flight
|
||||
if (_differential_pressure_sub.update(&differential_pressure) && PX4_ISFINITE(differential_pressure.temperature)
|
||||
&& fabsf(differential_pressure.temperature) > FLT_EPSILON) {
|
||||
|
||||
_air_temperature_celsius = math::constrain(differential_pressure.temperature, temperature_min_celsius,
|
||||
temperature_max_celsius);
|
||||
}
|
||||
}
|
||||
|
||||
bool VehicleAirData::ParametersUpdate(bool force)
|
||||
{
|
||||
// Check if parameters have changed
|
||||
@@ -140,8 +123,6 @@ void VehicleAirData::Run()
|
||||
|
||||
const bool parameter_update = ParametersUpdate();
|
||||
|
||||
AirTemperatureUpdate();
|
||||
|
||||
bool updated[MAX_SENSOR_COUNT] {};
|
||||
|
||||
for (int uorb_index = 0; uorb_index < MAX_SENSOR_COUNT; uorb_index++) {
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
#include <uORB/Subscription.hpp>
|
||||
#include <uORB/SubscriptionMultiArray.hpp>
|
||||
#include <uORB/SubscriptionCallback.hpp>
|
||||
#include <uORB/topics/differential_pressure.h>
|
||||
#include <uORB/topics/parameter_update.h>
|
||||
#include <uORB/topics/sensor_baro.h>
|
||||
#include <uORB/topics/sensors_status.h>
|
||||
@@ -73,8 +72,6 @@ public:
|
||||
|
||||
private:
|
||||
void Run() override;
|
||||
|
||||
void AirTemperatureUpdate();
|
||||
void CheckFailover(const hrt_abstime &time_now_us);
|
||||
bool ParametersUpdate(bool force = false);
|
||||
void UpdateStatus();
|
||||
@@ -87,8 +84,6 @@ private:
|
||||
|
||||
uORB::SubscriptionInterval _parameter_update_sub{ORB_ID(parameter_update), 1_s};
|
||||
|
||||
uORB::Subscription _differential_pressure_sub{ORB_ID(differential_pressure)};
|
||||
|
||||
uORB::SubscriptionCallbackWorkItem _sensor_sub[MAX_SENSOR_COUNT] {
|
||||
{this, ORB_ID(sensor_baro), 0},
|
||||
{this, ORB_ID(sensor_baro), 1},
|
||||
@@ -121,8 +116,6 @@ private:
|
||||
|
||||
int8_t _selected_sensor_sub_index{-1};
|
||||
|
||||
float _air_temperature_celsius{20.f}; // initialize with typical 20degC ambient temperature
|
||||
|
||||
DEFINE_PARAMETERS(
|
||||
(ParamFloat<px4::params::SENS_BARO_QNH>) _param_sens_baro_qnh,
|
||||
(ParamFloat<px4::params::SENS_BARO_RATE>) _param_sens_baro_rate
|
||||
|
||||
Reference in New Issue
Block a user