I am doing a python simulation very similar to the racecar example. My setup works nicely with PARTIAL_CONDENSING_HPIPM. When I try to run it with FULL_CONDENSING_QPOASES I immediately get “QP solver returned error status 37” in closed loop iteration 1. I feel like I forgot to set something. Any ideas what the issue might be?
FULL_CONDENSING_HPIPM and PARTIAL_CONDENSING_HPIPM look very similar. If the error code 37 means infeasible initially, should I try to set up some slack variables on my hard constraints? I am surprised that it works with HPIPM and not with qpOASES though. How do you quantify ill-conditioned? The highest cost is about 1000 more than the lowest cost in my cost function.
Sorry for the loose response. In general it’s hard to tell. If you send your code over we can have a look. Sometimes HPIPM can solve QPs that qpOASES fails to solve and viceversa - the solvers use very different methods.
Here is the code. Just run main.py. I am implementing Model Predictive Contouring Control (MPCC). I know for a fact, from a different implementation using a different solver framework, that the cost and algorithm as such works.
I have made some different observations, which are rather worrying regarding the correctness of my implementation in acados:
The external cost function doesn’t do anything, if I multiply it with 0 I get the exact same result
even though the cost function doesn’t do anything, the car still drives laps (probably in the nature of MPCC)
Can you please check out what I am doing wrong regarding the parametrized cost function I am using? I am pretty sure the crux in qpOases not working lies in my wrong implementation of the external cost function.The cost function is parametrized by the cost weights and by track linearization parameters, necessary for MPCC.
There was a minor modification I made to your code, which is due to a change in the interface, please check this out:
I think the behavior the main has now is still not as you wish, but at least the influence of the external cost is visible now.
Maybe you have to adjust the scaling of your cost function, since acados uses a continuous time formulation.
That is fantastic. I hate to bother you again, though. I have a c++ implementation of the same problem, where the .c files are generated from the same acados_settings.py and bycicle_model.py that you already saw. The c++ implementation was doing the same as the python implementation before you fixed it. Now that the python implementation is fixed I get the following error, when writing parameters:
Here is the code snippet, where the error is thrown:
I am not sure what the issue is in your C++ implementation.
Did you regenerate the C Code with the version I pointed to?
I guess your c++ implementation uses the rendered acados_solver*.c file.
For setting the parameters of the external functions you could call the equivalent of this function in the generated file, instead of doing for every external function separately.
This is where the external cost function was missing.
If that doesnt work, please tell me where exactly it is failing, i.e. for which external function & index.
It looks like the error I was getting is gone, using the suggested function. There are other errors now, which do not seem to be related to acados. I’ll keep you updated once I know more. Thanks a lot for your help.