mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
ManualSmoothVel - Set jerk to 1.0 during position hold to help the optimizer to converge towards 0 vel and acc
This commit is contained in:
parent
06f683bdda
commit
1fefa76e5d
@ -141,6 +141,19 @@ void FlightTaskManualPositionSmoothVel::_updateSetpoints()
|
||||
_position_lock_z_active = false;
|
||||
}
|
||||
|
||||
// During position lock, lower jerk to help the optimizer
|
||||
// to converge to 0 acceleration and velocity
|
||||
if (_position_lock_xy_active) {
|
||||
jerk[0] = 1.f;
|
||||
jerk[1] = 1.f;
|
||||
|
||||
} else {
|
||||
jerk[0] = _jerk_max.get();
|
||||
jerk[1] = _jerk_max.get();
|
||||
}
|
||||
|
||||
jerk[2] = _position_lock_z_active ? 1.f : _jerk_max.get();
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
_smoothing[i].setMaxJerk(jerk[i]);
|
||||
_smoothing[i].updateDurations(_deltatime, _velocity_setpoint(i));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user