File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
src/modules/fw_rate_control Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -283,9 +283,11 @@ void FixedwingRateControl::Run()
283
283
return ;
284
284
}
285
285
286
+ const float airspeed = get_airspeed_and_update_scaling ();
287
+ _trim.setAirspeed (airspeed);
288
+
286
289
if (_vcontrol_mode.flag_control_rates_enabled ) {
287
290
288
- const float airspeed = get_airspeed_and_update_scaling ();
289
291
290
292
/* reset integrals where needed */
291
293
if (_rates_sp.reset_integral ) {
@@ -335,9 +337,6 @@ void FixedwingRateControl::Run()
335
337
}
336
338
}
337
339
338
- _trim.setAirspeed (airspeed);
339
- _trim_slew.update (_trim.getTrim (), dt);
340
-
341
340
_rates_sp_sub.update (&_rates_sp);
342
341
343
342
Vector3f body_rates_setpoint = Vector3f (_rates_sp.roll , _rates_sp.pitch , _rates_sp.yaw );
@@ -397,7 +396,6 @@ void FixedwingRateControl::Run()
397
396
} else {
398
397
// full manual
399
398
_rate_control.resetIntegral ();
400
- _trim.reset ();
401
399
}
402
400
403
401
// Add feed-forward from roll control output to yaw control output
@@ -427,6 +425,7 @@ void FixedwingRateControl::Run()
427
425
}
428
426
429
427
_trim.updateAutoTrim (Vector3f (_vehicle_torque_setpoint.xyz ), dt);
428
+ _trim_slew.update (_trim.getTrim (), dt);
430
429
}
431
430
432
431
updateActuatorControlsStatus (dt);
You can’t perform that action at this time.
0 commit comments