What interface of acados are you using (C/ Matlab/ Python/ Octave)?
I am using both Matlab and Python interfaces.
What do you want to achieve?
Is it possible to generate the C code of an OCP in Matlab then load the ocp solver in Python using the create_cython_solver_method
If there is a specific thing you tried that you are not sure of, add a formatted
I need to use an Acados OCP within Python. This Acados OCP is already developed / tested in Matlab. I want to load this Acados OCP so that I can use this with Python.
this is not officially supported yet.
However, it is possible without too many modifications.
I made a minimal example here:
It would be better to actually load all (or most) information from the json file and set up the AcadosOcp as well.
A contribution in this direction is very welcome.
I am not sure when I will continue to work on this.
I came up with my own solution yesterday that helped me load the OCP solver in python:
To create the required Cython bindings we need the acados_solver.pxd file.
I used the corresponding tera template and the function (acados.utils.render_template) to generate this file
I then compiled the code using the already available make file. This create the requisite python bindings that can be loaded using AcadosOcpSolver.create_cython_solver(json_file=json_path)
I am able to load the OCP solver now. While it is working in some of the test scenarios, it is failing in others. I am therefore not sure if this is indeed the correct method to do this.
I will try to do this using your pull request.
The entire code to generate the .pyd file is below:
I can confirm that both your and my methods are working equally well for me.
(The issue I mentioned in my last post was some bug in my code and not due to Acados)