mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-08-01 20:27:57 +08:00
MulticopterPositionControl: prevent velocity integrator filling up from stale acceleration setpoints
When position control is disabled, clear the setpoint properly to prevent stale values. This fixes a bug where switching to position mode in the same control loop as a hover thrust estimate update could fill up the velocity integrator.
This commit is contained in:
committed by
Matthias Grob
parent
0375f1a6f0
commit
7c318a3296
@@ -408,6 +408,7 @@ void MulticopterPositionControl::Run()
|
||||
} else if (previous_position_control_enabled && !_vehicle_control_mode.flag_multicopter_position_control_enabled) {
|
||||
// clear existing setpoint when controller is no longer active
|
||||
_setpoint = PositionControl::empty_trajectory_setpoint;
|
||||
_control.setInputSetpoint(_setpoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user