C-code generation #115
Replies: 4 comments 2 replies
-
Yes impressive stuff, but I never tried the library myself, super interesting! You seems to be more used to code-genration, with SymbolicControlSystems.jl, MTK.jl, etc. You could experiment on a new branch, if you have the time! But, yeah, it would be a killer feature 😎 |
Beta Was this translation helpful? Give feedback.
-
also FYI: The next feature I will work on custom nonlinear inequality constraints. I will start this weekend and maybe a little bit this week. But afterwards the development will stall for ~1 month, since I will be visiting Japan, for my honeymoon 🇯🇵 ! I may be able to answer if any new issues are reported but I won't have access to my computer. Fun fact: in all my last big trips, I've weirdly always received the answer of my current paper in revision. (like, at the beginning of my trip, with an editorial request like "you have 3 weeks to respond". Wow. thanks lol). I'm not superstitious at all but let's see if it corroborates once more 😅 |
Beta Was this translation helpful? Give feedback.
-
I tried TinyMPC a bit more but it appears to be kind-of a scam, their examples never hit any constraints and if you do hit constraints, the solver becomes so slow it's absolutely useless. Much more interesting though is that here's a very experimental interface to acados from julia |
Beta Was this translation helpful? Give feedback.
-
Are you sure that it's not a mistake on your side with TinyMPC ? I'm would be really surprised that this package with a lot of github stars + top results on google + peer reviewed paper would be a kind of a scam. But yes it would be extremely misleading if it's fast only without constraints. The Good news! Acados seems really like high quality software, I'm not surprised. |
Beta Was this translation helpful? Give feedback.
-
I just tried https://github.com/TinyMPC/tinympc-julia/tree/main to generate C-code for a linear MPC problem from Julia. Their example notebook is a bit wonky, but the generation worked really well and the resulting code was very fast.
Taking a definition of a linear MPC problem from this package and generating code using such a tool would not be very hard. It could be a nice way to get C-codegen support with very little effort, making it possible to run on quite small micro controllers etc.
I open this as a discussion rather than an issue for now to make clear that this is not a feature request :) I'd be more than happy to put something like this together myself at some point.
There are also several other C libraries for MPC, such as ACADOS and Grampc, but they do not support codegen from Julia at the moment. I had a look at the Grampc interface and they require definition of quite many functions that would be relatively easy to do using symbolics for simple enough problems. This would be relatively straightforward, but a much larger effort nonetheless.
Beta Was this translation helpful? Give feedback.
All reactions