mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 00:43:35 +08:00
WindEstimator: remove option to disable scale estimation
The situation where this would be desired is unclear, plus it's basically the same as setting ASPD_SC_P_NOISE to a very small value. Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -177,13 +177,10 @@ AirspeedValidator::update_CAS_scale_applied()
|
||||
|
||||
/* fallthrough */
|
||||
case 1:
|
||||
|
||||
/* fallthrough */
|
||||
case 2:
|
||||
_CAS_scale_applied = _tas_scale_init;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
case 2:
|
||||
_CAS_scale_applied = _CAS_scale_validated;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,6 @@ public:
|
||||
void set_tas_scale_apply(int tas_scale_apply) { _tas_scale_apply = tas_scale_apply; }
|
||||
void set_CAS_scale_validated(float scale) { _CAS_scale_validated = scale; }
|
||||
void set_scale_init(float scale) { _wind_estimator.set_scale_init(scale); }
|
||||
void set_disable_tas_scale_estimate(bool disable_scale_est) {_wind_estimator.set_disable_tas_scale_estimate(disable_scale_est); }
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -387,7 +387,7 @@ AirspeedModule::Run()
|
||||
|
||||
// save estimated airspeed scale after disarm
|
||||
if (!armed && _armed_prev) {
|
||||
if (_param_aspd_scale_apply.get() > 1) {
|
||||
if (_param_aspd_scale_apply.get() > 0) {
|
||||
if (fabsf(_airspeed_validator[i].get_CAS_scale_validated() - _param_airspeed_scale[i]) > 0.01f) {
|
||||
// apply the new scale if changed more than 0.01
|
||||
mavlink_log_info(&_mavlink_log_pub, "Airspeed sensor Nr. %d ASPD_SCALE updated: %.2f --> %.2f", i + 1,
|
||||
@@ -460,7 +460,6 @@ void AirspeedModule::update_params()
|
||||
_airspeed_validator[i].set_checks_fail_delay(_checks_fail_delay.get());
|
||||
_airspeed_validator[i].set_checks_clear_delay(_checks_clear_delay.get());
|
||||
_airspeed_validator[i].set_airspeed_stall(_param_fw_airspd_stall.get());
|
||||
_airspeed_validator[i].set_disable_tas_scale_estimate(_param_aspd_scale_apply.get() == 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,15 +76,14 @@ PARAM_DEFINE_INT32(ASPD_TAS_GATE, 3);
|
||||
PARAM_DEFINE_INT32(ASPD_BETA_GATE, 1);
|
||||
|
||||
/**
|
||||
* Controls when to apply the new estimated airspeed scale
|
||||
* Controls when to apply the new estimated airspeed scale(s)
|
||||
*
|
||||
* @value 0 Disable airspeed scale estimation completely
|
||||
* @value 1 Do not apply the new gains (logging and inside wind estimator)
|
||||
* @value 2 Apply the new scale after disarm
|
||||
* @value 3 Apply the new gains in air
|
||||
* @value 0 Do not automatically apply the estimated scale
|
||||
* @value 1 Apply the estimated scale after disarm
|
||||
* @value 2 Apply the estimated scale in air
|
||||
* @group Airspeed Validator
|
||||
*/
|
||||
PARAM_DEFINE_INT32(ASPD_SCALE_APPLY, 2);
|
||||
PARAM_DEFINE_INT32(ASPD_SCALE_APPLY, 1);
|
||||
|
||||
/**
|
||||
* Scale of airspeed sensor 1
|
||||
|
||||
Reference in New Issue
Block a user