I am trying to run acados on the dspace DS1202 system. I’ve managed to compile it successfully without any errors. However when I want to load and run it on the DS1202 it gives the following errors. I’ve used the basic closed_loop simulink example (pendulum on a cart) in the getting_started folder.
The error message from dspace:
Memory violation exception! Real-time application (ID 0x008796e3) crashed due to an illegal memory access at address 0x00000004. Execution stopped at address 0x48058d5c near symbol ‘test_example_mpc_dspace.ppc@main+0x1115c’.
I will ofc also contact dspace about this, since I don’t know from which side (dspace or acacdos) the problem stems from.
As far as I know DS1202 should work with acados in general? And since I’ve used the most basic example and followed the docs of acados closely, I’m a bit lost.
One more fact: When I do the same, but only with the integrator / model (also an acados-sfunction) (so without the actual mpc / acacdos-solver) it works fine and gives correct results. So there has to be a problem with the other s-function or underlying c-code, but in general, the inclusion of acados c-code works.
An update regarding my situation: I’ve been debugging and got stuck at the following line of code:
the issue seems to lie here, but I dont really understand the structure of the code well enough to find the definition of the original evaluate function to investigate further. Can you guys help me finding the function?
Update: I fixed the problem by commenting out everything related to the ACADOS_DEBUG_SQP_PRINT_QPS_TO_FILE variable. I couldnt turn it off properly in the installation, but this would be the cleaner solution.
Apparently these code lines did wild things and created NULL pointer in other variables, which was hard to find.