From c4a86919bb7d130a6bf0fb498b0bf99721f864b8 Mon Sep 17 00:00:00 2001 From: Rhys Mainwaring Date: Wed, 15 Mar 2023 00:45:46 +0000 Subject: [PATCH] AP_WindVane: use body frame when setting apparent wind in sitl physics backend - Change behaviour to expect apparent wind in body rather than NED frame. - Remove dependency on AP::ahrs().yaw. Signed-off-by: Rhys Mainwaring --- libraries/AP_WindVane/AP_WindVane_SITL.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_WindVane/AP_WindVane_SITL.cpp b/libraries/AP_WindVane/AP_WindVane_SITL.cpp index c853185b97..8460bbf5cd 100644 --- a/libraries/AP_WindVane/AP_WindVane_SITL.cpp +++ b/libraries/AP_WindVane/AP_WindVane_SITL.cpp @@ -42,8 +42,8 @@ void AP_WindVane_SITL::update_direction() _frontend._direction_apparent_raw = wrap_PI(atan2f(wind_vector_ef.y, wind_vector_ef.x) - AP::ahrs().yaw); } else { // WINDVANE_SITL_APARRENT - // directly read the apparent wind from as set by physics backend - _frontend._direction_apparent_raw = wrap_PI(AP::sitl()->get_apparent_wind_dir() - AP::ahrs().yaw); + // directly read the body frame apparent wind set by physics backend + _frontend._direction_apparent_raw = wrap_PI(AP::sitl()->get_apparent_wind_dir()); } }