mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 14:08:52 +08:00
AltitudeSmoothVel - Update to use new implementation of VelocitySmoothing
Remove jerk reduction (not needed in the new implementation)
This commit is contained in:
+9
-14
@@ -106,6 +106,15 @@ void FlightTaskManualAltitudeSmoothVel::_checkEkfResetCounters()
|
||||
|
||||
void FlightTaskManualAltitudeSmoothVel::_updateSetpoints()
|
||||
{
|
||||
float pos_sp_smooth;
|
||||
|
||||
_smoothing.updateTraj(_deltatime);
|
||||
|
||||
_jerk_setpoint(2) = _smoothing.getCurrentJerk();
|
||||
_acceleration_setpoint(2) = _smoothing.getCurrentAcceleration();
|
||||
_vel_sp_smooth = _smoothing.getCurrentVelocity();
|
||||
pos_sp_smooth = _smoothing.getCurrentPosition();
|
||||
|
||||
/* Get yaw setpont, un-smoothed position setpoints.*/
|
||||
FlightTaskManualAltitude::_updateSetpoints();
|
||||
|
||||
@@ -142,10 +151,6 @@ void FlightTaskManualAltitudeSmoothVel::_updateSetpoints()
|
||||
_position_lock_z_active = false;
|
||||
}
|
||||
|
||||
// During position lock, lower jerk to help the optimizer
|
||||
// to converge to 0 acceleration and velocity
|
||||
jerk = _position_lock_z_active ? 1.f : _param_mpc_jerk_max.get();
|
||||
|
||||
_smoothing.setMaxJerk(jerk);
|
||||
_smoothing.updateDurations(_velocity_setpoint(2));
|
||||
|
||||
@@ -153,16 +158,6 @@ void FlightTaskManualAltitudeSmoothVel::_updateSetpoints()
|
||||
_smoothing.setCurrentPosition(_position(2));
|
||||
}
|
||||
|
||||
float pos_sp_smooth;
|
||||
|
||||
// TODO: move before updateDurations
|
||||
_smoothing.updateTraj(_deltatime);
|
||||
|
||||
_jerk_setpoint(2) = _smoothing.getCurrentJerk();
|
||||
_acceleration_setpoint(2) = _smoothing.getCurrentAcceleration();
|
||||
_vel_sp_smooth = _smoothing.getCurrentVelocity();
|
||||
pos_sp_smooth = _smoothing.getCurrentPosition();
|
||||
|
||||
_velocity_setpoint(2) = _vel_sp_smooth; // Feedforward
|
||||
|
||||
if (fabsf(_vel_sp_smooth) < 0.1f &&
|
||||
|
||||
Reference in New Issue
Block a user