diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2013-11-04 13:14:25 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2013-11-04 13:14:25 +0100 |
commit | 014e856c1f789b6c27d886bb55617aa7d235f4f6 (patch) | |
tree | c2fa25b025fce8ed886739cd487922426e50d9ec /src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp | |
parent | 9349509302e75814ac9ffc5292d18a0f9373f99e (diff) | |
download | px4-firmware-014e856c1f789b6c27d886bb55617aa7d235f4f6.tar.gz px4-firmware-014e856c1f789b6c27d886bb55617aa7d235f4f6.tar.bz2 px4-firmware-014e856c1f789b6c27d886bb55617aa7d235f4f6.zip |
fw: make att controller more robust against invalid (nan) setpoints
Diffstat (limited to 'src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp')
-rw-r--r-- | src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp b/src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp index 013bc191a..04293efd6 100644 --- a/src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp +++ b/src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp @@ -90,6 +90,11 @@ float ECL_YawController::control_attitude(float roll, float pitch, // counter++; + if(!isfinite(_rate_setpoint)){ + warnx("yaw rate sepoint not finite"); + _rate_setpoint = 0.0f; + } + return _rate_setpoint; } |