Browse Source

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

deadzone to center like angle type channels
mission-4.1.18
Jacob Walser 9 years ago committed by Andrew Tridgell
parent
commit
0b0cda02cc
  1. 5
      ArduSub/Attitude.cpp
  2. 1
      ArduSub/Sub.h

5
ArduSub/Attitude.cpp

@ -128,6 +128,11 @@ void Sub::set_throttle_takeoff() @@ -128,6 +128,11 @@ void Sub::set_throttle_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
// used only for manual throttle modes
// returns throttle output 0 to 1000

1
ArduSub/Sub.h

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

Loading…
Cancel
Save