Closed LouKordos closed 3 years ago
This is actually not an issue, the high first iteration time only occurs because the simulation is started a few seconds after the controller has been started, which means the MPC thread measures that time difference as iteration time.
The logs show that the first iteration only spends ~35ms in the solver, while the full iteration time is ~4s:
First iteration takes roughly a second, most likely due to some missing or incorrect initialization. If everything seems correct, it might be necessary to "warm up" the NLP by solving a few iterations on a simulated model in advance in order to provide a closer hotstart guess.