From e360c6117ec2425b561e6d715b9203a7bb79cc49 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 17 Jun 2016 08:35:08 +1000 Subject: [PATCH] SITL: make SIM_* variables available to simulator backends directly --- libraries/SITL/SIM_Aircraft.cpp | 2 ++ libraries/SITL/SIM_Aircraft.h | 1 + 2 files changed, 3 insertions(+) diff --git a/libraries/SITL/SIM_Aircraft.cpp b/libraries/SITL/SIM_Aircraft.cpp index 95d951ff83..2981990ff9 100644 --- a/libraries/SITL/SIM_Aircraft.cpp +++ b/libraries/SITL/SIM_Aircraft.cpp @@ -57,6 +57,8 @@ Aircraft::Aircraft(const char *home_str, const char *frame_str) : min_sleep_time(5000) #endif { + // make the SIM_* variables available to simulator backends + sitl = (SITL *)AP_Param::find_object("SIM_"); parse_home(home_str, home, home_yaw); location = home; ground_level = home.alt*0.01; diff --git a/libraries/SITL/SIM_Aircraft.h b/libraries/SITL/SIM_Aircraft.h index ff4a05dfa7..84b7dedf05 100644 --- a/libraries/SITL/SIM_Aircraft.h +++ b/libraries/SITL/SIM_Aircraft.h @@ -98,6 +98,7 @@ public: } protected: + SITL *sitl; Location home; Location location;