Skip to content
Snippets Groups Projects
Commit 6b265946 authored by Mark Whitehorn's avatar Mark Whitehorn
Browse files

apply roll/pitch acro_rate_max in MC attitude controller

parent d4ae721b
No related branches found
No related tags found
No related merge requests found
......@@ -639,6 +639,11 @@ MulticopterAttitudeControl::control_attitude(float dt)
/* calculate angular rates setpoint */
_rates_sp = _params.att_p.emult(e_R);
/* limit roll and pitch rates */
for (int i = 0; i < 2; i++) {
_rates_sp(i) = math::constrain(_rates_sp(i), -_params.acro_rate_max(i), _params.acro_rate_max(i));
}
/* limit yaw rate */
_rates_sp(2) = math::constrain(_rates_sp(2), -_params.yaw_rate_max, _params.yaw_rate_max);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment