Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spectool usage questions #27

Open
msabbah06 opened this issue Feb 5, 2025 · 0 comments
Open

Spectool usage questions #27

msabbah06 opened this issue Feb 5, 2025 · 0 comments

Comments

@msabbah06
Copy link

Hello,

Thank you very much for your work ! I have been hinted by @AjSat to use spectool and fatrop to solve my problem and it seems very promising !

What I want to do is to perform MHE for human kinematics estimation. The big challenge is that I want to integrate this into a realtime pipeline and the MHE part should not exceed 5 ms to be ideal.
I formulated my problem in the following code : https://gitlab.laas.fr/msabbah/rt-cosmik/-/blob/main/utils/ik_utils.py?ref_type=heads#L599
For now, with codegen and a naive warm start of the solver, I benchmarked the resolution around 10 ms (best case scenario) to 50-60 ms (it can happen quite often depending on the measures I want to track). Thus, to fit my requirements I need to still improve the speed of resolution a bit. I already tried to tune the solver parameters (like the tolerance was set to 1e-3, and I also tried to change the number of max_iter in order to cap the resolution time, but the solver throw an error in this case). But I am willing to learn even more about this.

Therefore, I have several questions about the use of spectool :

  1. I use jit to codegen my problem. However the compilation can take up to 30 minutes (since a lot of files are generated). For now I did not find any way to use what has been previously compiled to accelerate future resolutions of my problem. Therefore I wanted to know, if I can do codegen once and for all for my problem and then call whatever has been generated in spectool to bypass a new compilation ?
  2. I have been told that evaluations of functions can be parallelized but I yet don't know how to do this. I think it can help to solve my problem even more quicker.
  3. I set a naive warmstart with all the states and controls over my horizon to be at the value of the first state and control of the window. I think this can be improved by setting a different warmstart at each timestep but I did not know how to do this and it ended up with errors when I tried.

In any cases, I am really keen to know if I miswrote my problem or if they are way more efficient to formulate what I want to do. My usecase is not very complex on its own I believe, but it takes a little bit of mastery to achieve the timings that I want.

Best regards,

Maxime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant