diff --git a/libraries/AP_HAL_SITL/SITL_State_common.cpp b/libraries/AP_HAL_SITL/SITL_State_common.cpp index 260a9b28da..718d80537e 100644 --- a/libraries/AP_HAL_SITL/SITL_State_common.cpp +++ b/libraries/AP_HAL_SITL/SITL_State_common.cpp @@ -269,6 +269,13 @@ SITL::SerialDevice *SITL_State_Common::create_serial_sim(const char *name, const } microstrain5 = new SITL::MicroStrain5(); return microstrain5; + + } else if (streq(name, "MicroStrain7")) { + if (microstrain7 != nullptr) { + AP_HAL::panic("Only one MicroStrain7 at a time"); + } + microstrain7 = new SITL::MicroStrain7(); + return microstrain7; #if HAL_SIM_AIS_ENABLED } else if (streq(name, "AIS")) { if (ais != nullptr) { @@ -435,6 +442,10 @@ void SITL_State_Common::sim_update(void) microstrain5->update(); } + if (microstrain7 != nullptr) { + microstrain7->update(); + } + #if HAL_SIM_AIS_ENABLED if (ais != nullptr) { ais->update(); diff --git a/libraries/AP_HAL_SITL/SITL_State_common.h b/libraries/AP_HAL_SITL/SITL_State_common.h index e7b82c2c91..3a2d722fc5 100644 --- a/libraries/AP_HAL_SITL/SITL_State_common.h +++ b/libraries/AP_HAL_SITL/SITL_State_common.h @@ -197,9 +197,12 @@ public: // simulated VectorNav system: SITL::VectorNav *vectornav; - // simulated LORD MicroStrain system + // simulated MicroStrain system SITL::MicroStrain5 *microstrain5; + // simulated MicroStrain system + SITL::MicroStrain7 *microstrain7; + #if HAL_SIM_JSON_MASTER_ENABLED // Ride along instances via JSON SITL backend SITL::JSON_Master ride_along;