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

Real-time loop tools #85

Closed
franckgaga opened this issue Jul 3, 2024 · 1 comment · Fixed by #94
Closed

Real-time loop tools #85

franckgaga opened this issue Jul 3, 2024 · 1 comment · Fixed by #94

Comments

@franckgaga
Copy link
Member

@baggepinnen
André was asking if there is any tools for (soft) real-time loops in julia. Something that could be use with this package to implement MPC on a real plant.

For sure, there is the simple polling solution with time in a while loop. Are you aware of anything fancier ? Maybe we could add simple functionalities for that ? I was thinking of using Asynchronous Programming for that, since one could say that's the high-level equivalent of an interrupt. What do you think ?

@baggepinnen
Copy link
Member

I normally use the method I outline in this video (starts at 5:00), that is, to measure the execution time of the loop and then sleep using systemsleep for the loop interval, adjusted for the execution time. This is the method I've found to have the best predictability, at least under Linux.

For fancier scheduling there are tools like https://github.com/narijauskas/ReactiveToolkit.jl

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

Successfully merging a pull request may close this issue.

2 participants