mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-13 10:27:35 +08:00
flight_modes: use precision landing when landing
This also enables precision landing in landing mode, not just during RTL. This required an additional fix during the horizontal approach. It seems like the z setpoint is not set when landing, so we can't blindly use that setpoint but rather need to keep the altitude.
This commit is contained in:
committed by
Alessandro Simovic
parent
a214d6de94
commit
f08268adbc
@@ -166,7 +166,8 @@ void FlightModeManager::start_flight_task()
|
||||
|
||||
// Take-over landing from navigator if precision landing is enabled
|
||||
|
||||
} else if (_vehicle_status_sub.get().nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_RTL
|
||||
} else if ((_vehicle_status_sub.get().nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_RTL ||
|
||||
_vehicle_status_sub.get().nav_state == vehicle_status_s::NAVIGATION_STATE_AUTO_LAND)
|
||||
&& _param_rtl_pld_md.get() > 0) {
|
||||
should_disable_task = false;
|
||||
|
||||
|
||||
+7
-1
@@ -150,7 +150,13 @@ FlightTaskAutoPrecisionLanding::run_state_horizontal_approach()
|
||||
_position_setpoint(0) = x;
|
||||
_position_setpoint(1) = y;
|
||||
_position_setpoint(2) = _target(2);
|
||||
_velocity_setpoint(0) = _velocity_setpoint(1) = _velocity_setpoint(2) = NAN;
|
||||
|
||||
_velocity_setpoint(0) = _velocity_setpoint(1) = NAN;
|
||||
|
||||
// If altitude setpoint is NAN, we stay at the current altitude
|
||||
if (!PX4_ISFINITE(_position_setpoint(2))) {
|
||||
_velocity_setpoint(2) = 0.0f;
|
||||
}
|
||||
|
||||
// check if target visible, if not go to start
|
||||
if (!check_state_conditions(PrecLandState::HorizontalApproach)) {
|
||||
|
||||
Reference in New Issue
Block a user