FlightTaskManualAcceleration: smooth position unlock

The velocity setpoint of the position controller
does a jump when unlocking position with a non-zero position error.

This is solved by using the velocity setpoint feedback to smoothly
take over.
This commit is contained in:
Matthias Grob
2021-02-08 18:36:18 +01:00
committed by Lorenz Meier
parent c9eac29d25
commit dec353219d
3 changed files with 11 additions and 8 deletions

View File

@@ -70,7 +70,7 @@ bool FlightTaskManualAcceleration::update()
_stick_yaw.generateYawSetpoint(_yawspeed_setpoint, _yaw_setpoint,
_sticks.getPositionExpo()(3) * math::radians(_param_mpc_man_y_max.get()), _yaw, _deltatime);
_stick_acceleration_xy.generateSetpoints(_sticks.getPositionExpo().slice<2, 1>(0, 0), _yaw, _yaw_setpoint, _position,
_deltatime);
Vector2f(_velocity_setpoint_feedback), _deltatime);
_stick_acceleration_xy.getSetpoints(_position_setpoint, _velocity_setpoint, _acceleration_setpoint);
_constraints.want_takeoff = _checkTakeoff();