GotoControl: Save flash

This commit is contained in:
Matthias Grob
2023-11-28 16:19:41 +01:00
parent 7b4712cb29
commit 8bb20db7da
8 changed files with 66 additions and 62 deletions
@@ -804,14 +804,13 @@ void FlightTaskAuto::_updateTrajConstraints()
// Update the constraints of the trajectories
_position_smoothing.setMaxAccelerationXY(_param_mpc_acc_hor.get()); // TODO : Should be computed using heading
_position_smoothing.setMaxVelocityXY(_param_mpc_xy_vel_max.get());
float max_jerk = _param_mpc_jerk_auto.get();
_position_smoothing.setMaxJerk({max_jerk, max_jerk, max_jerk}); // TODO : Should be computed using heading
_position_smoothing.setMaxJerk(_param_mpc_jerk_auto.get()); // TODO : Should be computed using heading
if (_is_emergency_braking_active) {
// When initializing with large velocity, allow 1g of
// acceleration in 1s on all axes for fast braking
_position_smoothing.setMaxAcceleration({9.81f, 9.81f, 9.81f});
_position_smoothing.setMaxJerk({9.81f, 9.81f, 9.81f});
_position_smoothing.setMaxJerk(9.81f);
// If the current velocity is beyond the usual constraints, tell
// the controller to exceptionally increase its saturations to avoid