mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-23 00:04:02 -04:00
AC_AttitudeControl: various suggested cleanup items
Co-authored-by: Peter Hall <33176108+IamPete1@users.noreply.github.com>
This commit is contained in:
parent
29897f99af
commit
c5585f84af
@ -569,7 +569,8 @@ float AC_AttitudeControl_Heli::get_throttle_boosted(float throttle_in)
|
|||||||
float boost_factor = 1.0f / constrain_float(cos_tilt_target, 0.1f, 1.0f);
|
float boost_factor = 1.0f / constrain_float(cos_tilt_target, 0.1f, 1.0f);
|
||||||
|
|
||||||
// angle boost and inverted factor applied about the zero thrust collective
|
// angle boost and inverted factor applied about the zero thrust collective
|
||||||
float throttle_out = (throttle_in - ((AP_MotorsHeli&)_motors).get_coll_mid()) * inverted_factor * boost_factor + ((AP_MotorsHeli&)_motors).get_coll_mid();
|
const float coll_mid = ((AP_MotorsHeli&)_motors).get_coll_mid();
|
||||||
|
float throttle_out = ((throttle_in - coll_mid) * inverted_factor * boost_factor) + coll_mid;
|
||||||
_angle_boost = constrain_float(throttle_out - throttle_in, -1.0f, 1.0f);
|
_angle_boost = constrain_float(throttle_out - throttle_in, -1.0f, 1.0f);
|
||||||
return throttle_out;
|
return throttle_out;
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ private:
|
|||||||
float _passthrough_yaw;
|
float _passthrough_yaw;
|
||||||
|
|
||||||
// get_roll_trim - angle in centi-degrees to be added to roll angle. Used by helicopter to counter tail rotor thrust in hover
|
// get_roll_trim - angle in centi-degrees to be added to roll angle. Used by helicopter to counter tail rotor thrust in hover
|
||||||
float get_roll_trim_rad() override { return constrain_float(radians(get_roll_trim_cd() * 0.01f), -radians(10.0f),radians(10.0f));}
|
float get_roll_trim_rad() override { return radians(get_roll_trim_cd() * 0.01); }
|
||||||
|
|
||||||
// internal variables
|
// internal variables
|
||||||
float _hover_roll_trim_scalar = 0; // scalar used to suppress Hover Roll Trim
|
float _hover_roll_trim_scalar = 0; // scalar used to suppress Hover Roll Trim
|
||||||
|
Loading…
Reference in New Issue
Block a user