Skip to content

Commit

Permalink
Airspeed Selector: two fixes:
Browse files Browse the repository at this point in the history
-use temperature measurement from differential pressure sensor for TAS converison
-first apply scale and then fuse wind estimator in airspeed validator with this TAS, not the raw TAS

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
  • Loading branch information
sfuhrer committed Jul 11, 2019
1 parent a529ea4 commit 7880e2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/lib/AirspeedValidator/AirspeedValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ AirspeedValidator::update_airspeed_validator(struct airspeed_validator_update_da
}

update_wind_estimator_params();
update_EAS_scale();
update_EAS_TAS(input_data.air_pressure_pa, input_data.air_temperature_celsius);
update_wind_estimator(input_data.timestamp, input_data.airspeed_true_raw, input_data.lpos_valid, input_data.lpos_vx,
input_data.lpos_vy,
input_data.lpos_vz, input_data.lpos_evh, input_data.lpos_evv, input_data.att_q);
update_EAS_scale();
update_EAS_TAS(input_data.air_pressure_pa, input_data.air_temperature_celsius);
update_in_fixed_wing_flight(input_data.in_fixed_wing_flight);
check_airspeed_innovation(input_data.timestamp, input_data.vel_test_ratio, input_data.mag_test_ratio);
check_load_factor(input_data.accel_z);
Expand Down
8 changes: 4 additions & 4 deletions src/modules/airspeed_selector/airspeed_selector_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ AirspeedModule::Run()
input_data.att_q[2] = _vehicle_attitude.q[2];
input_data.att_q[3] = _vehicle_attitude.q[3];
input_data.air_pressure_pa = _vehicle_air_data.baro_pressure_pa;
input_data.air_temperature_celsius = _vehicle_air_data.baro_temp_celcius;
input_data.accel_z = _sensor_bias.accel_z;
input_data.vel_test_ratio = _estimator_status.vel_test_ratio;
input_data.mag_test_ratio = _estimator_status.mag_test_ratio;
Expand All @@ -298,6 +297,7 @@ AirspeedModule::Run()
input_data.airspeed_indicated_raw = airspeed_raw.indicated_airspeed_m_s;
input_data.airspeed_true_raw = airspeed_raw.true_airspeed_m_s;
input_data.airspeed_timestamp = airspeed_raw.timestamp;
input_data.air_temperature_celsius = airspeed_raw.air_temperature_celsius;

/* update in_fixed_wing_flight for the current airspeed sensor validator */
/* takeoff situation is active from start till one of the sensors' IAS or groundspeed_EAS is above stall speed */
Expand Down Expand Up @@ -368,11 +368,11 @@ void AirspeedModule::update_params()
_param_west_airspeed_scale.set(_airspeed_validator[_valid_airspeed_index].get_EAS_scale());
_param_west_airspeed_scale.commit_no_notification();

mavlink_log_critical(&_mavlink_log_pub, "Airspeed: estimated scale: %1.2f. Saved in as ARSPV_ARSP_SCALE.",
(double)_airspeed_validator[_valid_airspeed_index].get_EAS_scale());
mavlink_and_console_log_info(&_mavlink_log_pub, "Airspeed: estimated scale (ARSPV_ARSP_SCALE): %1.2f",
(double)_airspeed_validator[_valid_airspeed_index].get_EAS_scale());

} else {
mavlink_log_critical(&_mavlink_log_pub, "Airspeed: can't estimate scale as no valid sensor.");
mavlink_and_console_log_info(&_mavlink_log_pub, "Airspeed: can't estimate scale as no valid sensor.");
}
}

Expand Down

0 comments on commit 7880e2e

Please sign in to comment.