mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 23:33:57 -04:00
Plane: quadplane: fix wp_dist reporting for VTOL landings
After hitting the approach stage of a VTOL landing in auto, nav_controller_output sends zero as the distance to waypoint.
This commit is contained in:
parent
db6490818f
commit
f2d32fc800
@ -181,7 +181,7 @@ void GCS_MAVLINK_Plane::send_nav_controller_output() const
|
||||
targets.y * 1.0e-2f,
|
||||
targets.z * 1.0e-2f,
|
||||
wp_nav_valid ? quadplane.wp_nav->get_wp_bearing_to_destination() : 0,
|
||||
wp_nav_valid ? MIN(quadplane.wp_nav->get_wp_distance_to_destination(), UINT16_MAX) : 0,
|
||||
wp_nav_valid ? MIN(quadplane.wp_nav->get_wp_distance_to_destination() * 1.0e-2f, UINT16_MAX) : 0,
|
||||
(plane.control_mode != &plane.mode_qstabilize) ? quadplane.pos_control->get_pos_error_z_cm() * 1.0e-2f : 0,
|
||||
plane.airspeed_error * 100,
|
||||
wp_nav_valid ? quadplane.wp_nav->crosstrack_error() : 0);
|
||||
|
@ -3371,6 +3371,9 @@ bool QuadPlane::using_wp_nav(void) const
|
||||
if (plane.control_mode == &plane.mode_qrtl && poscontrol.get_state() >= QPOS_POSITION2) {
|
||||
return true;
|
||||
}
|
||||
if (plane.control_mode == &plane.mode_auto && poscontrol.get_state() > QPOS_APPROACH) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user