mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 05:43:33 +08:00
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:
committed by
Daniel Agar
parent
cfd1be584e
commit
63651da309
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user