mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 03:11:35 +08:00
fw pos ctrl: add option to fix the glide slope reference altitude
- new param, FW_LND_TER_REL - fixing the glide slope helps keep the landing glide behavior steady (avoiding bumps in the altitude setpoint from e.g. trees) - flare is still triggered via the distance sensor, if enabled by FW_LND_USETERR
This commit is contained in:
committed by
Daniel Agar
parent
c60b215574
commit
888e72661f
@@ -1681,9 +1681,15 @@ FixedwingPositionControl::control_auto_landing(const hrt_abstime &now, const flo
|
|||||||
const float terrain_alt = getLandingTerrainAltitudeEstimate(now, pos_sp_curr.alt);
|
const float terrain_alt = getLandingTerrainAltitudeEstimate(now, pos_sp_curr.alt);
|
||||||
float altitude_setpoint;
|
float altitude_setpoint;
|
||||||
|
|
||||||
if (_current_altitude > terrain_alt + glide_slope_rel_alt) {
|
// by default the landing waypoint altitude is used for the glide slope reference. this ensures a constant slope
|
||||||
|
// during the landing approach, despite any terrain bumps (think tall trees below the landing approach) disrupting
|
||||||
|
// the glide behavior. in this case, when FW_LND_USETER==1, the terrain estimate is only used to trigger the flare.
|
||||||
|
// however - the option still exists to make the glide slope terrain relative via FW_LND_TER_REL.
|
||||||
|
const float glide_slope_reference_alt = (_param_fw_lnd_ter_rel.get()) ? terrain_alt : pos_sp_curr.alt;
|
||||||
|
|
||||||
|
if (_current_altitude > glide_slope_reference_alt + glide_slope_rel_alt) {
|
||||||
// descend to the glide slope
|
// descend to the glide slope
|
||||||
altitude_setpoint = terrain_alt + glide_slope_rel_alt;
|
altitude_setpoint = glide_slope_reference_alt + glide_slope_rel_alt;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// continue horizontally
|
// continue horizontally
|
||||||
|
|||||||
@@ -849,7 +849,8 @@ private:
|
|||||||
(ParamFloat<px4::params::FW_LND_FL_SINK>) _param_fw_lnd_fl_sink,
|
(ParamFloat<px4::params::FW_LND_FL_SINK>) _param_fw_lnd_fl_sink,
|
||||||
(ParamFloat<px4::params::FW_LND_TD_OFF>) _param_fw_lnd_td_off,
|
(ParamFloat<px4::params::FW_LND_TD_OFF>) _param_fw_lnd_td_off,
|
||||||
(ParamInt<px4::params::FW_LND_NUDGE>) _param_fw_lnd_nudge,
|
(ParamInt<px4::params::FW_LND_NUDGE>) _param_fw_lnd_nudge,
|
||||||
(ParamInt<px4::params::FW_LND_ABORT>) _param_fw_lnd_abort
|
(ParamInt<px4::params::FW_LND_ABORT>) _param_fw_lnd_abort,
|
||||||
|
(ParamBool<px4::params::FW_LND_TER_REL>) _param_fw_lnd_ter_rel
|
||||||
)
|
)
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1068,3 +1068,17 @@ PARAM_DEFINE_INT32(FW_LND_NUDGE, 0);
|
|||||||
* @group FW L1 Control
|
* @group FW L1 Control
|
||||||
*/
|
*/
|
||||||
PARAM_DEFINE_INT32(FW_LND_ABORT, 0);
|
PARAM_DEFINE_INT32(FW_LND_ABORT, 0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculate the landing glide slope relative to the terrain estimate.
|
||||||
|
*
|
||||||
|
* If enabled, the terrain estimate (e.g. via distance sensor) will be used as the glide slope reference altitude, following
|
||||||
|
* all bumps in the terrain below the landing approach.
|
||||||
|
*
|
||||||
|
* If disabled, the land waypoint altitude will be a fixed glide slope reference, and the distance sensor (if enabled via
|
||||||
|
* FW_LND_USETER) will only be used to trigger the flare.
|
||||||
|
*
|
||||||
|
* @boolean
|
||||||
|
* @group FW L1 Control
|
||||||
|
*/
|
||||||
|
PARAM_DEFINE_INT32(FW_LND_TER_REL, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user