Line data Source code
1 : #include "mode.h" 2 : #include "Plane.h" 3 : 4 614242 : void ModeManual::update() 5 : { 6 614242 : SRV_Channels::set_output_scaled(SRV_Channel::k_aileron, plane.roll_in_expo(false)); 7 614242 : SRV_Channels::set_output_scaled(SRV_Channel::k_elevator, plane.pitch_in_expo(false)); 8 614242 : output_rudder_and_steering(plane.rudder_in_expo(false)); 9 : 10 614242 : const float throttle = plane.get_throttle_input(true); 11 614242 : SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, throttle); 12 : 13 614242 : plane.nav_roll_cd = ahrs.roll_sensor; 14 614242 : plane.nav_pitch_cd = ahrs.pitch_sensor; 15 614242 : } 16 : 17 614242 : void ModeManual::run() 18 : { 19 614242 : reset_controllers(); 20 614242 : } 21 : 22 : // true if throttle min/max limits should be applied 23 613998 : bool ModeManual::use_throttle_limits() const 24 : { 25 : #if HAL_QUADPLANE_ENABLED 26 613998 : if (quadplane.available() && quadplane.option_is_set(QuadPlane::Option::IDLE_GOV_MANUAL)) { 27 31841 : return true; 28 : } 29 : #endif 30 582157 : return false; 31 : }