-
Notifications
You must be signed in to change notification settings - Fork 11
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 system with visual. #11
Comments
Hi @andrewcz, thank you for your words and for reaching out! I am not sure what you mean exactly by "real-time stream". Are you asking if there is a way to enforce a certain frequency upon the existing solver? If that is it, then no, at the moment the only way you have to limit the maximum computation time is by setting a maximum number of iterations. However, I think you should still be able to run the solver on a separate thread and check its state at the frequency you are interested in. As to the second question, you may easily access the results of your optimizations as shown in // Solve your optimal control problem and store the result in 'variables_'.
// ...
// Export the results to CSV.
std::ofstream out("out.csv");
if (!out.is_open()) {
return 1;
}
for (const auto k : enumerate(N)) { // Assuming 'x' is three-dimensional.
out << k << ","
<< variables_.Get(x, k).x() << ","
<< variables_.Get(x, k).y() << ","
<< variables_.Get(x, k).z() << std::endl;
}
out.close(); I hope this helps, feel free to ask if you need further clarification or assistance! |
@fdevinc ! Thank you so much! very generous! Im thinking a rolling buffer (currently looking at a ring buffer data structure). To start I could generate a dummy stream have it go through a window type buffer data system and then have the output be plotted by - I was thinking of using the example where you look at a function - Curious to get your thoughts on the above. Best, |
You are welcome! While I might need a bit more context to offer the most precise assistance, your ideas sound quite feasible to me. You may just give them a shot and see how it goes! If you encounter any roadblocks or need further assistance along the way, feel free to reach out. Good luck with your project! |
Thank you @fdevinc ! I'm going to give it a try this weekend and the real time plot that uses the following code - // utility structure for realtime plot I'm just wondering how would you suggest a time calculation - should i put a flag that states when calculation is finished plot data? |
Hi @fdevinc , really interesting library and great project.
Just have a couple of slightly open ended questions.
want to use the library for a university project, looking at control systems on real time streams.
The text was updated successfully, but these errors were encountered: