Skip to content

Commit

Permalink
Handle invalid yaw rate setpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaeyoung-Lim authored and LorenzMeier committed Mar 13, 2021
1 parent 06e3d38 commit 6b4ccaa
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ matrix::Vector3f AttitudeControl::update(const Quatf &q) const
// and multiply it by the yaw setpoint rate (yawspeed_setpoint).
// This yields a vector representing the commanded rotatation around the world z-axis expressed in the body frame
// such that it can be added to the rates setpoint.
rate_setpoint += q.inversed().dcm_z() * _yawspeed_setpoint;
if (is_finite(_yawspeed_setpoint)) {
rate_setpoint += q.inversed().dcm_z() * _yawspeed_setpoint;
}

// limit rates
for (int i = 0; i < 3; i++) {
Expand Down

0 comments on commit 6b4ccaa

Please sign in to comment.