alexliniger / MPCC

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

Linearization adjustment #33

Closed pulsipher closed 4 years ago

pulsipher commented 4 years ago

Could you please explain the purpose of the adjustment present in https://github.com/alexliniger/MPCC/blob/master/Matlab/DiscretizedLinearizedModel.m#L54-L62. Thanks

alexliniger commented 4 years ago

The issue is that the model has a singularity at v_x = 0, which is clear when you look at the slip angle definition. This results in the errors even if the car is driving very slow. For the miniature race car application, this is not a bit issue since the cars are nearly never driving slow. To still avoid issues when starting, I added this statement. The if loop does two things:

This is a hack and if driving slow is important I suggest using a kinematic car model. Or the mixed kinematic-dynamic model proposed in the AMZ Driverless paper.

Best, Alex

pulsipher commented 4 years ago

Thank you, that clears things up.