1
0
Fork 0

Initialize autopilot output to start at current manual control position

to [hopefully] make autopilot activation less "dramatic."
This commit is contained in:
curt 2004-02-12 22:35:29 +00:00
parent 7f6b36d0d2
commit 71c83c4de7

View file

@ -212,6 +212,15 @@ void FGPIDController::update( double dt ) {
}
if (enable_prop != NULL && enable_prop->getStringValue() == enable_value) {
if ( !enabled ) {
// first time being enabled, seed u_n with current
// property tree value
u_n = output_list[0]->getDoubleValue();
// and clip
if ( u_n < u_min ) { u_n = u_min; }
if ( u_n > u_max ) { u_n = u_max; }
u_n_1 = u_n;
}
enabled = true;
} else {
enabled = false;