aboutsummaryrefslogtreecommitdiff
path: root/apps/systemlib
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2012-11-05 13:15:35 -0800
committerLorenz Meier <lm@inf.ethz.ch>2012-11-05 13:15:35 -0800
commit7d76a8a57b41c82db0712dd0544e67d1ce97d89c (patch)
treed4dd439ef04d0ea9b8b89355b39acdb13c7fdbaa /apps/systemlib
parent976545861a1c7336203a1677120633f14d215a40 (diff)
parent59725ccd3a80fd32ed8ef08025daeb4372adb1f1 (diff)
downloadpx4-firmware-7d76a8a57b41c82db0712dd0544e67d1ce97d89c.tar.gz
px4-firmware-7d76a8a57b41c82db0712dd0544e67d1ce97d89c.tar.bz2
px4-firmware-7d76a8a57b41c82db0712dd0544e67d1ce97d89c.zip
Merge pull request #45 from thomasgubler/master_origin
re-adding pid limitation & mavlink waypoint handling fix
Diffstat (limited to 'apps/systemlib')
-rw-r--r--apps/systemlib/pid/pid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/systemlib/pid/pid.c b/apps/systemlib/pid/pid.c
index dd8b6adc6..0358caa25 100644
--- a/apps/systemlib/pid/pid.c
+++ b/apps/systemlib/pid/pid.c
@@ -172,9 +172,9 @@ __EXPORT float pid_calculate(PID_t *pid, float sp, float val, float val_dot, flo
// Calculate the output. Limit output magnitude to pid->limit
float output = (pid->error_previous * pid->kp) + (i * pid->ki) + (d * pid->kd);
- //if (output > pid->limit) output = pid->limit;
+ if (output > pid->limit) output = pid->limit;
- //if (output < -pid->limit) output = -pid->limit;
+ if (output < -pid->limit) output = -pid->limit;
if (isfinite(output)) {
pid->last_output = output;