AC_PosControl: bug fix dt calculation
fixes issue in which now could be earlier than _last_update_xy_ms leading to a large dt value and a sudden lean on takeoff
This commit is contained in:
parent
d37c788394
commit
3638bfb614
@ -551,6 +551,7 @@ void AC_PosControl::update_xy_controller(bool use_desired_velocity)
|
||||
uint32_t now = hal.scheduler->millis();
|
||||
if ((now - _last_update_xy_ms) >= POSCONTROL_ACTIVE_TIMEOUT_MS) {
|
||||
init_xy_controller();
|
||||
now = _last_update_xy_ms;
|
||||
}
|
||||
|
||||
// check if xy leash needs to be recalculated
|
||||
|
Loading…
Reference in New Issue
Block a user