49 checkSetpoints(last_setpoint);
51 _smoothing.reset(last_setpoint.
acceleration[2], last_setpoint.
vz, last_setpoint.
z);
60 _smoothing.reset(0.
f, 0.
f, _position(2));
66 if (!PX4_ISFINITE(setpoints.
z)) { setpoints.
z = _position(2); }
69 if (!PX4_ISFINITE(setpoints.
vz)) { setpoints.
vz = _velocity(2); }
77 _smoothing.setCurrentPosition(_position(2));
82 _smoothing.setCurrentVelocity(_velocity(2));
89 _updateTrajConstraints();
91 _smoothing.setVelSpFeedback(_velocity_setpoint_feedback(2));
92 _smoothing.setCurrentPositionEstimate(_position(2));
97 _smoothing.update(_deltatime, _velocity_setpoint(2));
103 void FlightTaskManualAltitudeSmoothVel::_updateTrajConstraints()
105 _smoothing.setMaxJerk(_param_mpc_jerk_max.get());
107 _smoothing.setMaxAccelUp(_param_mpc_acc_up_max.get());
108 _smoothing.setMaxVelUp(_constraints.speed_up);
110 _smoothing.setMaxAccelDown(_param_mpc_acc_down_max.get());
111 _smoothing.setMaxVelDown(_constraints.speed_down);
117 _jerk_setpoint(2) = _smoothing.getCurrentJerk();
118 _acceleration_setpoint(2) = _smoothing.getCurrentAcceleration();
119 _velocity_setpoint(2) = _smoothing.getCurrentVelocity();
120 _position_setpoint(2) = _smoothing.getCurrentPosition();
void reActivate() override
Call this to reset an active Flight Task.
void _ekfResetHandlerPositionZ() override
Reset position or velocity setpoints in case of EKF reset event.
bool activate(vehicle_local_position_setpoint_s last_setpoint) override
Call once on the event where you switch to the task.
Vector< float, 6 > f(float t, const Matrix< float, 6, 1 > &, const Matrix< float, 3, 1 > &)
virtual void _updateSetpoints() override
updates all setpoints
virtual void _updateSetpoints()
updates all setpoints
bool activate(vehicle_local_position_setpoint_s last_setpoint) override
Call once on the event where you switch to the task.
void _ekfResetHandlerVelocityZ() override