From d425965f6dfabbac6df6572db173bde49d508afc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 24 Nov 2015 09:14:47 +1100 Subject: [PATCH] SITL: expose home yaw to FDMs --- libraries/SITL/SIM_Aircraft.cpp | 6 ++---- libraries/SITL/SIM_Aircraft.h | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/libraries/SITL/SIM_Aircraft.cpp b/libraries/SITL/SIM_Aircraft.cpp index 70d996b5de..c56c5b1b8b 100644 --- a/libraries/SITL/SIM_Aircraft.cpp +++ b/libraries/SITL/SIM_Aircraft.cpp @@ -55,13 +55,11 @@ Aircraft::Aircraft(const char *home_str, const char *frame_str) : min_sleep_time(5000) #endif { - float yaw_degrees; - - parse_home(home_str, home, yaw_degrees); + parse_home(home_str, home, home_yaw); location = home; ground_level = home.alt*0.01; - dcm.from_euler(0, 0, radians(yaw_degrees)); + dcm.from_euler(0, 0, radians(home_yaw)); set_speedup(1); diff --git a/libraries/SITL/SIM_Aircraft.h b/libraries/SITL/SIM_Aircraft.h index 78c7af86a4..0fcafdf96f 100644 --- a/libraries/SITL/SIM_Aircraft.h +++ b/libraries/SITL/SIM_Aircraft.h @@ -98,6 +98,7 @@ protected: Location location; float ground_level; + float home_yaw; float frame_height; Matrix3f dcm; // rotation matrix, APM conventions, from body to earth Vector3f gyro; // rad/s