From 51d4029f03fe108dff2b23b10ecd8f42ae62e250 Mon Sep 17 00:00:00 2001 From: bnsgeyer Date: Sun, 10 Feb 2019 15:57:05 -0500 Subject: [PATCH] AP_Motors: Tradheli - maintain consistent variable types as used in calcs add override to declaration of new functions --- libraries/AP_Motors/AP_MotorsHeli_Dual.h | 4 ++-- libraries/AP_Motors/AP_MotorsHeli_Quad.h | 4 ++-- libraries/AP_Motors/AP_MotorsHeli_RSC.h | 6 +++--- libraries/AP_Motors/AP_MotorsHeli_Single.h | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libraries/AP_Motors/AP_MotorsHeli_Dual.h b/libraries/AP_Motors/AP_MotorsHeli_Dual.h index 1b81478295..ade8ffa811 100644 --- a/libraries/AP_Motors/AP_MotorsHeli_Dual.h +++ b/libraries/AP_Motors/AP_MotorsHeli_Dual.h @@ -74,10 +74,10 @@ public: bool rotor_speed_above_critical() const override { return _rotor.get_rotor_speed() > _rotor.get_critical_speed(); } // get_governor_output - float get_governor_output() const { return _rotor.get_governor_output(); } + float get_governor_output() const override { return _rotor.get_governor_output(); } // get_control_output - float get_control_output() const { return _rotor.get_control_output(); } + float get_control_output() const override { return _rotor.get_control_output(); } // calculate_scalars - recalculates various scalars used void calculate_scalars() override; diff --git a/libraries/AP_Motors/AP_MotorsHeli_Quad.h b/libraries/AP_Motors/AP_MotorsHeli_Quad.h index 63945e6bdc..74152c882b 100644 --- a/libraries/AP_Motors/AP_MotorsHeli_Quad.h +++ b/libraries/AP_Motors/AP_MotorsHeli_Quad.h @@ -55,10 +55,10 @@ public: bool rotor_speed_above_critical() const override { return _rotor.get_rotor_speed() > _rotor.get_critical_speed(); } // get_governor_output - float get_governor_output() const { return _rotor.get_governor_output(); } + float get_governor_output() const override { return _rotor.get_governor_output(); } // get_control_output - float get_control_output() const { return _rotor.get_control_output(); } + float get_control_output() const override { return _rotor.get_control_output(); } // calculate_scalars - recalculates various scalars used void calculate_scalars() override; diff --git a/libraries/AP_Motors/AP_MotorsHeli_RSC.h b/libraries/AP_Motors/AP_MotorsHeli_RSC.h index befb2ab504..4dbac6732b 100644 --- a/libraries/AP_Motors/AP_MotorsHeli_RSC.h +++ b/libraries/AP_Motors/AP_MotorsHeli_RSC.h @@ -69,7 +69,7 @@ public: float get_rotor_speed() const; // set_rotor_rpm - when speed sensor is available for governor - void set_rotor_rpm(int16_t rotor_rpm) {_rotor_rpm = rotor_rpm; } + void set_rotor_rpm(int16_t rotor_rpm) {_rotor_rpm = (float)rotor_rpm; } // get_governor_output float get_governor_output() const { return _governor_output; } @@ -113,11 +113,11 @@ private: float _thrcrv_poly[4][4]; // spline polynomials for throttle curve interpolation uint16_t _power_slewrate = 0; // slewrate for throttle (percentage per second) float _collective_in; // collective in for throttle curve calculation, range 0-1.0f - int16_t _rotor_rpm; // rotor rpm from speed sensor for governor + float _rotor_rpm; // rotor rpm from speed sensor for governor float _governor_disengage = 0.0f; // throttle percentage where governor disenages to allow return to flight idle float _governor_droop_setting = 0.0f; // governor droop setting, range 0-100% float _governor_output = 0.0f; // governor output for rotor speed control - int16_t _governor_setpoint = 0.0f; // governor speed setpoint, range 800-3500 rpm + float _governor_setpoint = 0.0f; // governor speed setpoint, range 800-3500 rpm bool _governor_engage = false; // RSC governor status flag for soft-start float _governor_tc = 0.0f; // governor throttle curve gain, range 50-100% diff --git a/libraries/AP_Motors/AP_MotorsHeli_Single.h b/libraries/AP_Motors/AP_MotorsHeli_Single.h index ee1dedde59..c7e2529101 100644 --- a/libraries/AP_Motors/AP_MotorsHeli_Single.h +++ b/libraries/AP_Motors/AP_MotorsHeli_Single.h @@ -73,10 +73,10 @@ public: bool rotor_speed_above_critical() const override { return _main_rotor.get_rotor_speed() > _main_rotor.get_critical_speed(); } // get_governor_output - float get_governor_output() const { return _main_rotor.get_governor_output(); } + float get_governor_output() const override { return _main_rotor.get_governor_output(); } // get_control_output - float get_control_output() const { return _main_rotor.get_control_output(); } + float get_control_output() const override{ return _main_rotor.get_control_output(); } // calculate_scalars - recalculates various scalars used void calculate_scalars() override;