From 7d536666b4623476fd054a2089b57e3c74024416 Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Sun, 29 Aug 2021 20:04:37 +0100 Subject: [PATCH] SITL: SIM_Sailboat: remove use of AHRS --- libraries/SITL/SIM_Sailboat.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/SITL/SIM_Sailboat.cpp b/libraries/SITL/SIM_Sailboat.cpp index 1ba638176d..945b53606c 100644 --- a/libraries/SITL/SIM_Sailboat.cpp +++ b/libraries/SITL/SIM_Sailboat.cpp @@ -22,7 +22,6 @@ #include "SIM_Sailboat.h" #include -#include #include #include @@ -189,7 +188,10 @@ void Sailboat::update(const struct sitl_input &input) const float wind_apparent_dir_ef = degrees(atan2f(wind_apparent_ef.y, wind_apparent_ef.x)); const float wind_apparent_speed = safe_sqrt(sq(wind_apparent_ef.x)+sq(wind_apparent_ef.y)); - const float wind_apparent_dir_bf = wrap_180(wind_apparent_dir_ef - degrees(AP::ahrs().yaw)); + float roll, pitch, yaw; + dcm.to_euler(&roll, &pitch, &yaw); + + const float wind_apparent_dir_bf = wrap_180(wind_apparent_dir_ef - degrees(yaw)); // set RPM and airspeed from wind speed, allows to test RPM and Airspeed wind vane back end in SITL rpm[0] = wind_apparent_speed;