mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 08:13:33 +08:00
Navigator: use NAV_FW_ALTL_RAD only for FW landings, not VTOL landings
Also containst a mini refactor by removing the unnecessary function get_default_altitude_acceptance_radius(). Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -988,10 +988,18 @@ float Navigator::get_default_acceptance_radius()
|
||||
return _param_nav_acc_rad.get();
|
||||
}
|
||||
|
||||
float Navigator::get_default_altitude_acceptance_radius()
|
||||
float Navigator::get_altitude_acceptance_radius()
|
||||
{
|
||||
if (get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_FIXED_WING) {
|
||||
return _param_nav_fw_alt_rad.get();
|
||||
const position_setpoint_s &next_sp = get_position_setpoint_triplet()->next;
|
||||
|
||||
if (!force_vtol() && next_sp.type == position_setpoint_s::SETPOINT_TYPE_LAND && next_sp.valid) {
|
||||
// Use separate (tighter) altitude acceptance for clean altitude starting point before FW landing
|
||||
return _param_nav_fw_altl_rad.get();
|
||||
|
||||
} else {
|
||||
return _param_nav_fw_alt_rad.get();
|
||||
}
|
||||
|
||||
} else if (get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROVER) {
|
||||
return INFINITY;
|
||||
@@ -1010,20 +1018,6 @@ float Navigator::get_default_altitude_acceptance_radius()
|
||||
}
|
||||
}
|
||||
|
||||
float Navigator::get_altitude_acceptance_radius()
|
||||
{
|
||||
if (get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_FIXED_WING) {
|
||||
const position_setpoint_s &next_sp = get_position_setpoint_triplet()->next;
|
||||
|
||||
if (next_sp.type == position_setpoint_s::SETPOINT_TYPE_LAND && next_sp.valid) {
|
||||
// Use separate (tighter) altitude acceptance for clean altitude starting point before landing
|
||||
return _param_nav_fw_altl_rad.get();
|
||||
}
|
||||
}
|
||||
|
||||
return get_default_altitude_acceptance_radius();
|
||||
}
|
||||
|
||||
float Navigator::get_cruising_speed()
|
||||
{
|
||||
/* there are three options: The mission-requested cruise speed, or the current hover / plane speed */
|
||||
|
||||
Reference in New Issue
Block a user