vtol_att_control: disable maximum height for quadchute by default

Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
RomanBapst 2022-12-15 09:40:54 +03:00 committed by Roman Bapst
parent 9ed51ba8ed
commit 48e8477799
3 changed files with 7 additions and 4 deletions

View File

@ -255,13 +255,14 @@ PARAM_DEFINE_INT32(VT_FW_QC_R, 0);
* Triggering a quadchute always means transitioning the vehicle to hover flight in which generally a lot of energy is consumed.
* At high altitudes there is therefore a big risk to deplete the battery and therefore crash. Currently, there is no automated
* re-transition to fixed wing mode implemented and therefore this parameter serves and an intermediate measure to increase safety.
* Setting this value to 0 deactivates the behavior.
*
* @unit m
* @min 0
* @increment 1
* @decimal 1
* @group VTOL Attitude Control
*/
PARAM_DEFINE_FLOAT(VT_FW_QC_HMAX, 200.0f);
PARAM_DEFINE_INT32(VT_FW_QC_HMAX, 0);
/**
* Airspeed less front transition time (open loop)

View File

@ -228,7 +228,9 @@ bool VtolType::isQuadchuteEnabled()
}
return _v_control_mode->flag_armed && !_land_detected->landed && dist_to_ground < _param_quadchute_max_height.get();
return _v_control_mode->flag_armed &&
!_land_detected->landed && _param_quadchute_max_height.get() > 0 &&
dist_to_ground < (float)_param_quadchute_max_height.get();
}
bool VtolType::isMinAltBreached()

View File

@ -314,7 +314,7 @@ protected:
(ParamFloat<px4::params::VT_FW_ALT_ERR>) _param_vt_fw_alt_err,
(ParamInt<px4::params::VT_FW_QC_P>) _param_vt_fw_qc_p,
(ParamInt<px4::params::VT_FW_QC_R>) _param_vt_fw_qc_r,
(ParamFloat<px4::params::VT_FW_QC_HMAX>) _param_quadchute_max_height,
(ParamInt<px4::params::VT_FW_QC_HMAX>) _param_quadchute_max_height,
(ParamFloat<px4::params::VT_F_TR_OL_TM>) _param_vt_f_tr_ol_tm,
(ParamFloat<px4::params::VT_TRANS_MIN_TM>) _param_vt_trans_min_tm,