diff --git a/libraries/AP_Motors/AP_MotorsHeli.h b/libraries/AP_Motors/AP_MotorsHeli.h index ef8ca00022..061c1be995 100644 --- a/libraries/AP_Motors/AP_MotorsHeli.h +++ b/libraries/AP_Motors/AP_MotorsHeli.h @@ -102,9 +102,6 @@ public: // return true if the main rotor is up to speed bool rotor_runup_complete() const { return _heliflags.rotor_runup_complete; } - // rotor_speed_above_critical - return true if rotor speed is above that critical for flight - virtual bool rotor_speed_above_critical() const = 0; - //get rotor governor output virtual float get_governor_output() const = 0; diff --git a/libraries/AP_Motors/AP_MotorsHeli_Dual.h b/libraries/AP_Motors/AP_MotorsHeli_Dual.h index 2987d2fcd8..b7c0e5d511 100644 --- a/libraries/AP_Motors/AP_MotorsHeli_Dual.h +++ b/libraries/AP_Motors/AP_MotorsHeli_Dual.h @@ -61,9 +61,6 @@ public: // get_desired_rotor_speed - gets target rotor speed as a number from 0 ~ 1000 float get_desired_rotor_speed() const override { return _main_rotor.get_rotor_speed(); } - // rotor_speed_above_critical - return true if rotor speed is above that critical for flight - 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 override { return _main_rotor.get_governor_output(); } diff --git a/libraries/AP_Motors/AP_MotorsHeli_Quad.h b/libraries/AP_Motors/AP_MotorsHeli_Quad.h index 19dc56f638..599ad9a99a 100644 --- a/libraries/AP_Motors/AP_MotorsHeli_Quad.h +++ b/libraries/AP_Motors/AP_MotorsHeli_Quad.h @@ -40,9 +40,6 @@ public: // get_desired_rotor_speed - gets target rotor speed as a number from 0 ~ 1000 float get_desired_rotor_speed() const override { return _main_rotor.get_rotor_speed(); } - // rotor_speed_above_critical - return true if rotor speed is above that critical for flight - 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 override { return _main_rotor.get_governor_output(); } diff --git a/libraries/AP_Motors/AP_MotorsHeli_RSC.cpp b/libraries/AP_Motors/AP_MotorsHeli_RSC.cpp index 5af82956f0..f43ba07766 100644 --- a/libraries/AP_Motors/AP_MotorsHeli_RSC.cpp +++ b/libraries/AP_Motors/AP_MotorsHeli_RSC.cpp @@ -461,7 +461,7 @@ void AP_MotorsHeli_RSC::update_rotor_runup(float dt) } // if in autorotation, don't let rotor_runup_output go less than critical speed to keep // runup complete flag from being set to false - if (_autorotating && _rotor_runup_output < get_critical_speed()) { + if (_autorotating && !rotor_speed_above_critical()) { _rotor_runup_output = get_critical_speed(); } @@ -479,7 +479,7 @@ void AP_MotorsHeli_RSC::update_rotor_runup(float dt) } // if rotor speed is less than critical speed, then run-up is not complete // this will prevent the case where the target rotor speed is less than critical speed - if (_runup_complete && (get_rotor_speed() < get_critical_speed())) { + if (_runup_complete && !rotor_speed_above_critical()) { _runup_complete = false; } // if rotor estimated speed is zero, then spooldown has been completed diff --git a/libraries/AP_Motors/AP_MotorsHeli_RSC.h b/libraries/AP_Motors/AP_MotorsHeli_RSC.h index 6f606ca012..5d06b37b43 100644 --- a/libraries/AP_Motors/AP_MotorsHeli_RSC.h +++ b/libraries/AP_Motors/AP_MotorsHeli_RSC.h @@ -128,6 +128,9 @@ public: // Return mask of output channels which the RSC is outputting on uint32_t get_output_mask() const; + // rotor_speed_above_critical - return true if rotor speed is above that critical for flight + bool rotor_speed_above_critical(void) const { return get_rotor_speed() > get_critical_speed(); } + // var_info for holding Parameter information static const struct AP_Param::GroupInfo var_info[]; diff --git a/libraries/AP_Motors/AP_MotorsHeli_Single.h b/libraries/AP_Motors/AP_MotorsHeli_Single.h index 66bfd8f6dc..3838a0770a 100644 --- a/libraries/AP_Motors/AP_MotorsHeli_Single.h +++ b/libraries/AP_Motors/AP_MotorsHeli_Single.h @@ -61,9 +61,6 @@ public: // get_desired_rotor_speed - gets target rotor speed as a number from 0 ~ 1 float get_desired_rotor_speed() const override { return _main_rotor.get_desired_speed(); } - // rotor_speed_above_critical - return true if rotor speed is above that critical for flight - 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 override { return _main_rotor.get_governor_output(); }