alexliniger/MPCC

Steering constraint to avoid crash

AIDRI opened this issue · 4 comments

AIDRI commented

Hello,
I am actually checking the project, but i was thinking about steering constraint. Sometimes, I can see that the car make turn with a high steering angle (20°) and a high speed. I think it s impossible that a car can do that, so I have a little question :
Can we manage the maximum steering angle using your method ?

The small cars can have quite high side slip angles, in the case of the full scale car this should be avoided.
To answer your question, yes the steering can be constrained to whatever range you like. In the C++ code it is in the bounds.json file and in the matlab version it should also be a config file.
However, it is maybe better to penalize this behavior with the beta cost which is implemented in C++, this is exactly one of the reasons we added this cost.

AIDRI commented

ok, thanks for your answer.
I am actually trying to make a script to run a car in the simulator, but the car have a mass of 2 tones, that s why I d like to have steering constraint.
Btw, I checked the Matlab script, but i only see vars to change the cost of change of steering. If you have time, can you help me finding the var to do that ?

MPC_vars.Tu = diag(1./[1,0.35,6]);

MPC_vars.invTu = diag([1,0.35,6]);

you can change it in these two lines, 0.35 is the current steering limit. you need to change it in both lines.

However, i am not sure how good it works for a full sized car, in the C++ code i had to change quite a lot to make it work properly.

AIDRI commented

Ok, i wasn't looking at the good script.
Thanks for your answer (3 min reaction time haha), and good luck for the next improvements you would like to make 👍