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 <rhys.mainwaring@me.com>
This commit is contained in:
Rhys Mainwaring 2023-03-15 00:45:46 +00:00 committed by Peter Hall
parent 2f1956bba0
commit c4a86919bb
1 changed files with 2 additions and 2 deletions

View File

@ -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());
}
}