[wls] return when a solution is found instead to reach max iter (#3617)
Issues due date / Add labels to issues (push) Has been cancelled
Doxygen / build (push) Has been cancelled

This bug is intruduced by #3320. Without the return, wls only ends after
reaching max_iter. In simulation, only 1 iteration is needed to reach a
solution in flight, while max iter is set to 10.

https://github.com/paparazzi/paparazzi/pull/3320/changes#diff-fd1514a7b2a74afb97095b63a4d2d7986c427e9d939db0a36eb68620d9e351c1R273
This commit is contained in:
Gautier Hattenberger
2026-03-17 10:00:43 +01:00
committed by GitHub
parent bc6cac516f
commit 68ea2b661e
+1 -2
View File
@@ -264,13 +264,12 @@ void wls_alloc(struct WLS_t* WLS_p, float **B, float *u_guess, float *W_init, in
}
}
if (break_flag) {
#if WLS_VERBOSE
print_final_values(WLS_p, B);
#endif
// if solution is found, return number of iterations
WLS_p->iter = iter;
return;
}
} else {
// scaling back actuator command (0-1)