FW bug in checking if landing point has been passed

* the bearing difference between the waypoints and aircraft to landing point should be wrap_pi'ed
This commit is contained in:
Alvar Martti
2018-12-21 10:03:31 -08:00
committed by Daniel Agar
parent cfd1be584e
commit 63651da309
2 changed files with 2 additions and 1 deletions
@@ -1463,7 +1463,7 @@ FixedwingPositionControl::control_landing(const Vector2f &curr_pos, const Vector
/* calculate a waypoint distance value which is 0 when the aircraft is behind the waypoint */
float wp_distance_save = wp_distance;
if (fabsf(bearing_airplane_currwp - bearing_lastwp_currwp) >= radians(90.0f)) {
if (fabsf(wrap_pi(bearing_airplane_currwp - bearing_lastwp_currwp)) >= radians(90.0f)) {
wp_distance_save = 0.0f;
}
@@ -97,6 +97,7 @@ using matrix::Eulerf;
using matrix::Quatf;
using matrix::Vector2f;
using matrix::Vector3f;
using matrix::wrap_pi;
using uORB::Subscription;