mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-26 01:33:56 -04:00
AP_Landing: Fix an error when computing the course offset for deepstall
This commit is contained in:
parent
654bb6ffce
commit
eb9dd8c5a2
@ -484,7 +484,7 @@ float AP_Landing_Deepstall::predict_travel_distance(const Vector3f wind, const f
|
|||||||
float wind_length = MAX(wind_vec.length(), 0.05f); // always assume a slight wind to avoid divide by 0
|
float wind_length = MAX(wind_vec.length(), 0.05f); // always assume a slight wind to avoid divide by 0
|
||||||
Vector2f course_vec(cosf(course), sinf(course));
|
Vector2f course_vec(cosf(course), sinf(course));
|
||||||
|
|
||||||
float offset = course + atan2f(-wind.y, -wind.x) + M_PI;
|
float offset = course - atan2f(-wind.y, -wind.x);
|
||||||
|
|
||||||
// estimator for how far the aircraft will travel while entering the stall
|
// estimator for how far the aircraft will travel while entering the stall
|
||||||
float stall_distance = slope_a * wind_length * cosf(offset) + slope_b;
|
float stall_distance = slope_a * wind_length * cosf(offset) + slope_b;
|
||||||
|
Loading…
Reference in New Issue
Block a user