From 45e9b61bfa01b2775d0b854fbdb872f6edf331fe Mon Sep 17 00:00:00 2001 From: Ferruccio Vicari Date: Tue, 29 Aug 2023 17:49:30 +0200 Subject: [PATCH] AP_Motors: Support for Assisted Autorotation retrieve collective hover setting get governor rpm setpoint --- libraries/AP_Motors/AP_MotorsHeli.h | 11 +++++++++++ libraries/AP_Motors/AP_MotorsHeli_RSC.h | 1 + 2 files changed, 12 insertions(+) diff --git a/libraries/AP_Motors/AP_MotorsHeli.h b/libraries/AP_Motors/AP_MotorsHeli.h index 7cf311a84ca50d..082e9b293965d8 100644 --- a/libraries/AP_Motors/AP_MotorsHeli.h +++ b/libraries/AP_Motors/AP_MotorsHeli.h @@ -84,6 +84,9 @@ class AP_MotorsHeli : public AP_Motors { // get_rsc_setpoint - gets contents of _rsc_setpoint parameter (0~1) float get_rsc_setpoint() const { return _main_rotor._rsc_setpoint.get() * 0.01f; } + //return governor rpm setpoint + float get_rpm_setpoint() const {return _main_rotor.get_governor_setpoint();} + // arot_man_enabled - gets contents of manual_autorotation_enabled parameter bool arot_man_enabled() const { return (_main_rotor._rsc_arot_man_enable.get() == 1) ? true : false; } @@ -145,6 +148,13 @@ class AP_MotorsHeli : public AP_Motors { //return zero lift collective position float get_coll_mid() const { return _collective_zero_thrust_pct; } + //return collective hover + float get_coll_hover() const { return _collective_hover; } + + float get_coll_max_pitch() const { return _collective_max_deg;} + + float get_coll_min_pitch() const { return _collective_min_deg;} + // enum for heli optional features enum class HeliOption { USE_LEAKY_I = (1<<0), // 1 @@ -275,6 +285,7 @@ class AP_MotorsHeli : public AP_Motors { // internal variables float _collective_zero_thrust_pct; // collective zero thrutst parameter value converted to 0 ~ 1 range float _collective_land_min_pct; // collective land min parameter value converted to 0 ~ 1 range + float _collective_hover_rad; uint8_t _servo_test_cycle_counter = 0; // number of test cycles left to run after bootup motor_frame_type _frame_type; diff --git a/libraries/AP_Motors/AP_MotorsHeli_RSC.h b/libraries/AP_Motors/AP_MotorsHeli_RSC.h index 5d06b37b43a2ea..3edeb2a75f635a 100644 --- a/libraries/AP_Motors/AP_MotorsHeli_RSC.h +++ b/libraries/AP_Motors/AP_MotorsHeli_RSC.h @@ -87,6 +87,7 @@ class AP_MotorsHeli_RSC { // functions for autothrottle, throttle curve, governor, idle speed, output to servo void set_governor_output(float governor_output) {_governor_output = governor_output; } float get_governor_output() const { return _governor_output; } + float get_governor_setpoint() const { return _governor_rpm; } void governor_reset(); float get_control_output() const { return _control_output; } void set_idle_output(float idle_output) { _idle_output.set(idle_output); }