alexliniger / MPCC

Model Predictive Contouring Controller (MPCC) for Autonomous Racing
Apache License 2.0
1.34k stars 371 forks source link

where is the latency between the vehicle and the code considered or can be considered? #57

Closed Akhil2194 closed 3 years ago

Akhil2194 commented 3 years ago

which part of the code considers the lag or time gap between the vehicle model and the code ?

alexliniger commented 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.