Closed Akhil2194 closed 3 years ago
At the moment I do not consider lag. One easy way to fix the computation delay is to use the knowledge about the applied input at the moment, to simulate where the system will roughly be in one time step. This new state can then be used as the "current" state measurement. This basically solves the issue that the MPC takes about 10ms to compute a solution but normally we assume that we apply the input immediately. If your robot has other delays, due to state estimation, you can try similar tricks to deal with these delays. Generally, delays should be as small as possible otherwise the performance will suffer a lot.
which part of the code considers the lag or time gap between the vehicle model and the code ?