mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
add parameter to enable/disable ground effect zone
This commit is contained in:
committed by
Roman Bapst
parent
ecc8a696d0
commit
5fa0a647e5
@@ -337,6 +337,10 @@ private:
|
|||||||
(ParamExtFloat<px4::params::EKF2_BARO_NOISE>) _baro_noise, ///< observation noise for barometric height fusion (m)
|
(ParamExtFloat<px4::params::EKF2_BARO_NOISE>) _baro_noise, ///< observation noise for barometric height fusion (m)
|
||||||
(ParamExtFloat<px4::params::EKF2_BARO_GATE>)
|
(ParamExtFloat<px4::params::EKF2_BARO_GATE>)
|
||||||
_baro_innov_gate, ///< barometric height innovation consistency gate size (STD)
|
_baro_innov_gate, ///< barometric height innovation consistency gate size (STD)
|
||||||
|
(ParamInt<px4::params::EKF2_GND_EFF_EN>)
|
||||||
|
_enable_gnd_effect, ///< Controls barometric deadzone fusion, 0 disables, 1 enables
|
||||||
|
(ParamExtFloat<px4::params::EKF2_GND_EFF_DZ>)
|
||||||
|
_gnd_effect_deadzone, ///< barometric deadzone range for negative innovations (m)
|
||||||
(ParamExtFloat<px4::params::EKF2_GPS_P_GATE>)
|
(ParamExtFloat<px4::params::EKF2_GPS_P_GATE>)
|
||||||
_posNE_innov_gate, ///< GPS horizontal position innovation consistency gate size (STD)
|
_posNE_innov_gate, ///< GPS horizontal position innovation consistency gate size (STD)
|
||||||
(ParamExtFloat<px4::params::EKF2_GPS_V_GATE>) _vel_innov_gate, ///< GPS velocity innovation consistency gate size (STD)
|
(ParamExtFloat<px4::params::EKF2_GPS_V_GATE>) _vel_innov_gate, ///< GPS velocity innovation consistency gate size (STD)
|
||||||
@@ -537,6 +541,7 @@ Ekf2::Ekf2():
|
|||||||
_pos_noaid_noise(_params->pos_noaid_noise),
|
_pos_noaid_noise(_params->pos_noaid_noise),
|
||||||
_baro_noise(_params->baro_noise),
|
_baro_noise(_params->baro_noise),
|
||||||
_baro_innov_gate(_params->baro_innov_gate),
|
_baro_innov_gate(_params->baro_innov_gate),
|
||||||
|
_gnd_effect_deadzone(_params->gnd_effect_deadzone),
|
||||||
_posNE_innov_gate(_params->posNE_innov_gate),
|
_posNE_innov_gate(_params->posNE_innov_gate),
|
||||||
_vel_innov_gate(_params->vel_innov_gate),
|
_vel_innov_gate(_params->vel_innov_gate),
|
||||||
_tas_innov_gate(_params->tas_innov_gate),
|
_tas_innov_gate(_params->tas_innov_gate),
|
||||||
@@ -1250,7 +1255,8 @@ void Ekf2::run()
|
|||||||
if (vehicle_land_detected_updated) {
|
if (vehicle_land_detected_updated) {
|
||||||
if (orb_copy(ORB_ID(vehicle_land_detected), _vehicle_land_detected_sub, &vehicle_land_detected) == PX4_OK) {
|
if (orb_copy(ORB_ID(vehicle_land_detected), _vehicle_land_detected_sub, &vehicle_land_detected) == PX4_OK) {
|
||||||
_ekf.set_in_air_status(!vehicle_land_detected.landed);
|
_ekf.set_in_air_status(!vehicle_land_detected.landed);
|
||||||
//_ekf.set_gnd_effect_flag(vehicle_land_detected.in_ground_effect);
|
if(_enable_gnd_effect.get())
|
||||||
|
_ekf.set_gnd_effect_flag(vehicle_land_detected.in_ground_effect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -538,6 +538,29 @@ PARAM_DEFINE_FLOAT(EKF2_MAG_YAWLIM, 0.25f);
|
|||||||
*/
|
*/
|
||||||
PARAM_DEFINE_FLOAT(EKF2_BARO_GATE, 5.0f);
|
PARAM_DEFINE_FLOAT(EKF2_BARO_GATE, 5.0f);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Boolean determining if barometer deadzone near ground should be accounted.
|
||||||
|
*
|
||||||
|
* A value of 1 indicates that deadzone is active
|
||||||
|
*
|
||||||
|
* @group EKF2
|
||||||
|
* @boolean
|
||||||
|
*/
|
||||||
|
PARAM_DEFINE_INT32(EKF2_GND_EFF_EN, 0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Baro deadzone range for height fusion
|
||||||
|
*
|
||||||
|
* Sets the value of deadzone applied to negative baro innovations when ground effect compensation is active
|
||||||
|
*
|
||||||
|
* @group EKF2
|
||||||
|
* @min 0.5
|
||||||
|
* @max 10.0
|
||||||
|
* @unit M
|
||||||
|
* @decimal 1
|
||||||
|
*/
|
||||||
|
PARAM_DEFINE_FLOAT(EKF2_GND_EFF_DZ, 5.0f);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gate size for GPS horizontal position fusion
|
* Gate size for GPS horizontal position fusion
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user