mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 20:43:33 +08:00
Fixed-wing autoland: Adapt according to @dagar's and @antiheavy's comments.
This commit is contained in:
committed by
Daniel Agar
parent
08ceddaddb
commit
20c02ae093
@@ -854,7 +854,7 @@ Navigator::get_acceptance_radius()
|
||||
}
|
||||
|
||||
float
|
||||
Navigator::get_altitude_acceptance_radius()
|
||||
Navigator::get_default_altitude_acceptance_radius()
|
||||
{
|
||||
if (!get_vstatus()->is_rotary_wing) {
|
||||
return _param_fw_alt_acceptance_radius.get();
|
||||
@@ -864,6 +864,25 @@ Navigator::get_altitude_acceptance_radius()
|
||||
}
|
||||
}
|
||||
|
||||
float
|
||||
Navigator::get_altitude_acceptance_radius()
|
||||
{
|
||||
if (!get_vstatus()->is_rotary_wing) {
|
||||
// The fixed-wing altitude acceptance radius default is the respective parameter. However, before a landing
|
||||
// approach it needs to be tighter: Assume a 30% error w.r.t. the remaining descent altitude is OK, but enforce
|
||||
// min/max values (e.g. min=3m to make sure that the waypoint can still be reached in case of wrong user input).
|
||||
|
||||
const position_setpoint_s &next_sp = get_position_setpoint_triplet()->next;
|
||||
const position_setpoint_s &curr_sp = get_position_setpoint_triplet()->current;
|
||||
|
||||
if (next_sp.type == position_setpoint_s::SETPOINT_TYPE_LAND && next_sp.valid) {
|
||||
return math::constrain(0.3f * (curr_sp.alt - next_sp.alt), 3.0f, _param_fw_alt_acceptance_radius.get());
|
||||
}
|
||||
}
|
||||
|
||||
return get_default_altitude_acceptance_radius();
|
||||
}
|
||||
|
||||
float
|
||||
Navigator::get_cruising_speed()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user