mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 14:40:12 +08:00
Handle invalid yaw rate setpoints
This commit is contained in:
committed by
Lorenz Meier
parent
06e3d38bbd
commit
6b4ccaa53e
@@ -97,7 +97,9 @@ matrix::Vector3f AttitudeControl::update(const Quatf &q) const
|
|||||||
// and multiply it by the yaw setpoint rate (yawspeed_setpoint).
|
// 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
|
// 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.
|
// such that it can be added to the rates setpoint.
|
||||||
|
if (is_finite(_yawspeed_setpoint)) {
|
||||||
rate_setpoint += q.inversed().dcm_z() * _yawspeed_setpoint;
|
rate_setpoint += q.inversed().dcm_z() * _yawspeed_setpoint;
|
||||||
|
}
|
||||||
|
|
||||||
// limit rates
|
// limit rates
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user