From 1209c946e6a4d6932ee487c9b14496118db2e772 Mon Sep 17 00:00:00 2001 From: Willian Galvani Date: Thu, 26 Sep 2019 22:50:38 -0300 Subject: [PATCH] Sub: AP_Motors6DOF: create get_throttle_in_bidirectional() --- libraries/AP_Motors/AP_Motors6DOF.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_Motors/AP_Motors6DOF.h b/libraries/AP_Motors/AP_Motors6DOF.h index 108e1dc896..15edfdfc43 100644 --- a/libraries/AP_Motors/AP_Motors6DOF.h +++ b/libraries/AP_Motors/AP_Motors6DOF.h @@ -41,6 +41,10 @@ public: // output_to_motors - sends minimum values out to the motors void output_to_motors() override; + // This allows us to read back the output of the altidude controllers + // The controllers are in charge of the throttle input, so this gives vehicle access/visibility to the output of those controllers + float get_throttle_in_bidirectional() const { return constrain_float(2*(_throttle_in - 0.5f), -1.0f, 1.0f); } + // var_info for holding Parameter information static const struct AP_Param::GroupInfo var_info[];