From df42618e0e1beba669b4df49b87f9db03f13f915 Mon Sep 17 00:00:00 2001 From: ashvath100 Date: Sat, 8 Aug 2020 08:04:16 +0900 Subject: [PATCH] AP_Vehicle: add get_control_outputs() for lua motor drivers --- libraries/AP_Vehicle/AP_Vehicle.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libraries/AP_Vehicle/AP_Vehicle.h b/libraries/AP_Vehicle/AP_Vehicle.h index bd9e3bbf1e..39b65d6376 100644 --- a/libraries/AP_Vehicle/AP_Vehicle.h +++ b/libraries/AP_Vehicle/AP_Vehicle.h @@ -183,6 +183,22 @@ public: // set steering and throttle (-1 to +1) (for use by scripting with Rover) virtual bool set_steering_and_throttle(float steering, float throttle) { return false; } + // control outputs enumeration + enum class ControlOutput { + Roll = 1, + Pitch = 2, + Throttle = 3, + Yaw = 4, + Lateral = 5, + MainSail = 6, + WingSail = 7, + Last_ControlOutput // place new values before this + }; + + // get control output (for use in scripting) + // returns true on success and control_value is set to a value in the range -1 to +1 + virtual bool get_control_output(AP_Vehicle::ControlOutput control_output, float &control_value) { return false; } + // write out harmonic notch log messages void write_notch_log_messages() const; // update the harmonic notch