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;