From 6056cc9d54118c7663f77f3861805034bd4cfcff Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 29 Oct 2019 13:53:01 +1100 Subject: [PATCH] AP_HAL_SITL: add support for simulated RichenPower generator --- libraries/AP_HAL_SITL/SITL_State.cpp | 5 +++++ libraries/AP_HAL_SITL/SITL_State.h | 1 + 2 files changed, 6 insertions(+) diff --git a/libraries/AP_HAL_SITL/SITL_State.cpp b/libraries/AP_HAL_SITL/SITL_State.cpp index 39f0cfd688..06803ee021 100644 --- a/libraries/AP_HAL_SITL/SITL_State.cpp +++ b/libraries/AP_HAL_SITL/SITL_State.cpp @@ -348,6 +348,9 @@ int SITL_State::sim_fd(const char *name, const char *arg) } rplidara2 = new SITL::PS_RPLidarA2(); return rplidara2->fd(); + } else if (streq(name, "richenpower")) { + sitl_model->set_richenpower(&_sitl->richenpower_sim); + return _sitl->richenpower_sim.fd(); } AP_HAL::panic("unknown simulated device: %s", name); @@ -439,6 +442,8 @@ int SITL_State::sim_fd_write(const char *name) AP_HAL::panic("No rplidara2 created"); } return rplidara2->write_fd(); + } else if (streq(name, "richenpower")) { + return _sitl->richenpower_sim.write_fd(); } AP_HAL::panic("unknown simulated device: %s", name); } diff --git a/libraries/AP_HAL_SITL/SITL_State.h b/libraries/AP_HAL_SITL/SITL_State.h index f84b5be206..d12ffd9bdf 100644 --- a/libraries/AP_HAL_SITL/SITL_State.h +++ b/libraries/AP_HAL_SITL/SITL_State.h @@ -44,6 +44,7 @@ // #include #include +#include #include class HAL_SITL;