mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 18:47:21 +08:00
MulticopterPositionControl: fix amending existing idle setpoint from before takeoff
once the rampup starts. The rampup requires a valid vertical velocity setpoint. The corner case is: - We are before takeoff and amending the setpoint to be 0,0,100 acceleration in order to idle - The rampup starts BUT the setpoint is not yet overwritten by the trajectory setpoint topic - The idle setpoint gets amended to not contain a feed-forward vertical acceleration because the rampup is velocity based - The result is a brief invalid 0,0,NAN acceleration setpoint - That invalid setpoint gets overridden by a failsafe that holds zero velocity - Zero velocity leads to applying ~hover thrust briefly
This commit is contained in:
@@ -480,7 +480,7 @@ void MulticopterPositionControl::Run()
|
||||
}
|
||||
|
||||
// make sure takeoff ramp is not amended by acceleration feed-forward
|
||||
if (_takeoff.getTakeoffState() == TakeoffState::rampup) {
|
||||
if (_takeoff.getTakeoffState() == TakeoffState::rampup && PX4_ISFINITE(_setpoint.velocity[2])) {
|
||||
_setpoint.acceleration[2] = NAN;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user