-
Notifications
You must be signed in to change notification settings - Fork 866
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
simulate.cc as a Python module #190
Comments
Hi @aftersomemath, Yes indeed! This is a great idea and something that we intend to do, but we're not sure we'll be able to get to it very soon. Would you be interested in trying it out yourself? If you want to see a simple implementation, check out this example by @erwincoumans. This is based on Erwin's prototype pybind11 bindings for MuJoCo, so should carry over quite easily to our new bindings. The main issue with doing exactly what Erwin did is that it involves code duplication, which we would like to avoid. If you decide to take a stab, I recommend that you start by mimicking Erwin's approach, code duplication and all, and then we can think together about refactoring. Cheers |
Thanks for the pointer! I will take look into porting those bindings over. They do not seem too different. To be clear, my goal is to make a Python driven interactive viewer (click and drag should still work while the simulation is running). It seems this would require two threads to guarantee the UI remains responsive as is done in If that works, then it will be easy to turn the interaction off (passive mode), but then there is thread that doesn't need to be there. With enough refactoring a passive renderer could run on the same thread as the Python process, I don't know if I will have the time to dig into that. To solve the code duplication problem, the majority of ciao |
Yup, Erwin's We have the same thoughts about breaking out bits of simulate into a library. If refactoring seems like too big a job right now, I reckon that if instead of a PR to this repo, you simply made your viewer available in your own branch, that might be still be useful as a reference to us and to others, as we consider what the best refactor might look like. |
The release of pybind11 bindings in Mujoco 2.1.2 is very exciting! Would it be reasonable/possible to wrap simulate.cc with pybind11 so that the simulate GUI itself is a Python module?
This would make it very easy for users to work in python and still easily interact with the simulation and change parameters on the fly.
The text was updated successfully, but these errors were encountered: