Comments (19)
Ahh, I thought using the C interface will be a faster way to implement as Python does not comes into the picture. Although I dont have experience with Simulink Coder but I feel using the C interface by calling it in a s-function can work, unless I am really missing out on something which I am not aware of.
This approach is definitely possible and will allow you in principle to use Simulink Coder to deploy on embedded platforms like dSPACE or Beckhoff. In the not-so-long run, we will support automatic generation of the S-Function from Python/MATLAB.
from hpipm.
Hi, there is a matlab interfaced (which is currently based on the python interface) to interactively use the solver from matlab.
There is not a simulink interface yet, but maybe @zanellia may give you some suggestion to get started with that.
from hpipm.
Thanks @giaf.
Hi @zanellia, it will be great if you can provide me some suggestions regarding using hpipm in Simulink.
from hpipm.
Hey @PranjaLBiswas27, thanks for your interest in HPIPM! A Simulink interface could be indeed a useful bit to be added to the codebase. Can you give us a bit more details about what are your needs? I haven't put any concrete thought into how to build such an interface, but I guess in principle you could call the MATLAB interface from Simulink?
from hpipm.
Hi @zanellia,
Thanks for getting back to me. To be honest I am really trying to figure out what my needs are and thus the solver I require. As of now my requirement is to implement MPCC, for which @alexliniger from ETH has referenced this repository. So I was wondering if HPIPM works similarly to quadprog or mpcqp in MATLAB, at least in terms of using it within a MATLAB code and not how it solves the QP. Also my initial idea was to use it within a s-function or MATLAB function itself if possible. What do you think?
Kind Regards
Pranjal Biswas
from hpipm.
@PranjaLBiswas27 if performance/embeddability (QP solutions will be very fast, but you might loose some performance with the interaction between Simulink-MATLAB and the HPIPM shared library) are not the main focus, calling the MATLAB interface from Simulink might be the quickest/easiest solution. I can assist you with this. Otherwise we need to set up something a bit more structured.
from hpipm.
Just to be more specific, do you need to run on anything like dSPACE or Beckhoff systems?
from hpipm.
@zanellia, thanks. Yes, I do think I will require to generate C-code of Simulink model using the code builder that is provided with MATLAB to be able to implement in real time in a HIL setup. This might require me to work with d-space but I am not sure as of now.
Also, for simulation purposes the performance is not a consideration but it is important while running real-time though. What exactly do you mean by a more structured approach, like making a Simulink block all-together?
from hpipm.
The MATLAB interface runs MATLAB and Python code that, most likely, you don't want to deploy on the embedded unit. In order to go embedded we would need to compile everything (both HPIPM and the calls to the C API) in a shared library and an S-Function that you can also crosscompile.
from hpipm.
Sorry if I am a bit naive, but HIL does not necessarily mean emebedded?
Also, is it possible to use hpipm within a s-function and generate C code using the code builder? Will it lead to any issues considering hpipm runs python code?
from hpipm.
If you want to use Simulink Coder, I would be surprised if you could generate C code from a MATLAB function that calls the Python interpreter. I can spend some time to look into this in the next days, a Simulink/MATLAB/Python to embedded interface is anyway something useful. @giaf Do you think something like what we did in acados with templated C code would be a solution?
from hpipm.
@zanellia, is there a C version also of hpipm? In that case maybe it will then be possible to use the Simulink coder?
from hpipm.
Yes, of course :) If you are willing to use the C interface you can have a look at the C examples: https://github.com/giaf/hpipm/tree/master/examples/c. Ideally this code could be generated directly from from MATLAB/Simulink/Python. That's the slightly longer term solution I would think about.
from hpipm.
Ahh, I thought using the C interface will be a faster way to implement as Python does not comes into the picture. Although I dont have experience with Simulink Coder but I feel using the C interface by calling it in a s-function can work, unless I am really missing out on something which I am not aware of.
Other than that anyway my main concern is being able to use hpipm irrespective of C or python interpreter in Simulink. What will you suggest to do considering the following points:
- I am a novice :)
- Would like to go for the approach (C or Python) which ever is relatively simpler.
- Be able to generate C-code of my Simulink model while being able to use hpipm.
from hpipm.
Thanks for the clarification. Also, looking forward to the automatic generation of the s-function, it will be really handy. Is there any expected date for it?
from hpipm.
@zanellia any new with a s-function prototype?
from hpipm.
@PranjaLBiswas27, @giaf sorry for the loose response. I am working on it on this branch: https://github.com/zanellia/hpipm/tree/simulink_interface/interfaces/simulink - it's work in progress.
from hpipm.
@zanellia do you already have the Simulink interface working?
from hpipm.
@zanellia is currently on holiday, but back on the Simulink interface in one week from now :) Soon ready!
from hpipm.
Related Issues (20)
- hpipm_dense_qp_solver fails with only box constraints HOT 2
- all matrices in C interface are in form of column major? HOT 1
- help setting hidxe HOT 2
- Be sure to specify the initial value of the local variable. HOT 1
- Cannot make hpipm in container, errors with BLASFEO HOT 1
- Compiler mex errors HOT 3
- Failure to solve QP with equality at the boundary HOT 2
- I want to use C language interface to solve dense QP problem HOT 2
- Issue when the constant term in the dynamics equation is involved HOT 4
- Equality Constraints not working with dense qp HOT 1
- Make Error for C examples HOT 1
- Single precision HOT 4
- Min step help HOT 1
- Optimization reaches minimal step length HOT 4
- Partial condensing solution HOT 8
- Compiling hpipm on Arm HOT 1
- solve error? HOT 1
- Warm start = 1 has expected effects HOT 1
- does solver have non-deterministic issue? HOT 1
- Building in nvidia tegra xavier (nvgpu)/integrated, armv8, ubuntu 18.04 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hpipm.