mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 18:47:21 +08:00
FlightModeManager: fix integral reset on ground
This information could also be used for yaw and integral resets of the lower level controllers.
This commit is contained in:
committed by
Daniel Agar
parent
7de288877a
commit
fafbb687d8
@@ -454,7 +454,7 @@ void FlightModeManager::generateTrajectorySetpoint(const float dt,
|
||||
// set yaw-sp to current yaw
|
||||
setpoint.yawspeed = 0.f;
|
||||
// prevent any integrator windup
|
||||
// _control.resetIntegral(); TODO
|
||||
constraints.reset_integral = true;
|
||||
}
|
||||
|
||||
_trajectory_setpoint_pub.publish(setpoint);
|
||||
|
||||
@@ -254,6 +254,10 @@ void MulticopterPositionControl::Run()
|
||||
_control.setConstraints(constraints);
|
||||
_control.setThrustLimits(constraints.minimum_thrust, _param_mpc_thr_max.get());
|
||||
|
||||
if (constraints.reset_integral) {
|
||||
_control.resetIntegral();
|
||||
}
|
||||
|
||||
// Run position control
|
||||
if (_control.update(dt)) {
|
||||
_failsafe_land_hysteresis.set_state_and_update(false, time_stamp_now);
|
||||
|
||||
Reference in New Issue
Block a user