From c0c61660b03ad93d5aa26bb968e985251231f597 Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Fri, 17 Jan 2020 21:19:40 +0000 Subject: [PATCH] SITL: quadplane updates --- libraries/SITL/SIM_Aircraft.h | 10 ++++++++++ libraries/SITL/SIM_Multicopter.h | 5 +++++ libraries/SITL/SIM_QuadPlane.h | 7 +++++++ 3 files changed, 22 insertions(+) diff --git a/libraries/SITL/SIM_Aircraft.h b/libraries/SITL/SIM_Aircraft.h index 225b3aaaff..2e5f4248ad 100644 --- a/libraries/SITL/SIM_Aircraft.h +++ b/libraries/SITL/SIM_Aircraft.h @@ -84,6 +84,16 @@ public: // get frame rate of model in Hz float get_rate_hz(void) const { return rate_hz; } + // get number of motors for model + uint16_t get_num_motors() const { + return num_motors; + } + + // get motor offset for model + virtual uint16_t get_motors_offset() const { + return 0; + } + const Vector3f &get_gyro(void) const { return gyro; } diff --git a/libraries/SITL/SIM_Multicopter.h b/libraries/SITL/SIM_Multicopter.h index fa9a869358..bac5b6a80a 100644 --- a/libraries/SITL/SIM_Multicopter.h +++ b/libraries/SITL/SIM_Multicopter.h @@ -34,6 +34,11 @@ public: /* update model by one time step */ void update(const struct sitl_input &input) override; + // get motor offset for model + virtual uint16_t get_motors_offset() const override { + return frame->motor_offset; + } + /* static object creator */ static Aircraft *create(const char *frame_str) { return new MultiCopter(frame_str); diff --git a/libraries/SITL/SIM_QuadPlane.h b/libraries/SITL/SIM_QuadPlane.h index 38c26a394e..9df0212d4a 100644 --- a/libraries/SITL/SIM_QuadPlane.h +++ b/libraries/SITL/SIM_QuadPlane.h @@ -38,6 +38,13 @@ public: static Aircraft *create(const char *frame_str) { return new QuadPlane(frame_str); } + + // get motor offset for model + virtual uint16_t get_motors_offset() const override { + return frame->motor_offset; + } + + private: Frame *frame; };