Sub: add method to get throttle channel control_in, while applying

deadzone to center like angle type channels
This commit is contained in:
Jacob Walser 2016-10-13 17:52:04 -04:00 committed by Andrew Tridgell
parent 7e7e53f517
commit 0b0cda02cc
2 changed files with 6 additions and 0 deletions

View File

@ -128,6 +128,11 @@ void Sub::set_throttle_takeoff()
pos_control.init_takeoff(); pos_control.init_takeoff();
} }
int16_t Sub::get_throttle_control_dz()
{
return (channel_throttle->pwm_to_angle() + 1000)/2;
}
// get_pilot_desired_throttle - transform pilot's throttle input to make cruise throttle mid stick // get_pilot_desired_throttle - transform pilot's throttle input to make cruise throttle mid stick
// used only for manual throttle modes // used only for manual throttle modes
// returns throttle output 0 to 1000 // returns throttle output 0 to 1000

View File

@ -1056,6 +1056,7 @@ private:
void auto_terrain_recover_run(void); void auto_terrain_recover_run(void);
void translate_wpnav_rp(float &lateral_out, float &forward_out); void translate_wpnav_rp(float &lateral_out, float &forward_out);
int16_t get_throttle_control_dz();
bool surface_init(bool ignore_flags); bool surface_init(bool ignore_flags);
void surface_run(); void surface_run();