google-deepmind / mujoco

Multi-Joint dynamics with Contact. A general purpose physics simulator.
https://mujoco.org
Apache License 2.0
8.26k stars 825 forks source link

Improving the flexibility of the python passive simulator callbacks. #2038

Open gaalb opened 2 months ago

gaalb commented 2 months ago

The feature, motivation and pitch

Hello, mujoco team!

I'm reworking a project that I inherited from a previous coworker, regarding simulation of quadcopters and their controllers. This project was born before the passive viewer was implemented, however, in my iteration, I would like to use it, as it makes development way easier. I have several keypress callbacks I'd like to implement (such as connecting to our local motion capture system upon keypress, or modifying control parameters), but the vast majority of keybinds are already taken (rendering flag toggles, group toggles, etc.). I can still write callbacks to these keybinds, however, it makes very little sense to do so, since if I did, both my new actions, and the default behaviour would occur at the same time. To this end I'd like to propose two new features:

gaalb commented 1 month ago

This seems to be similar to #766, except it's broader than the most common use case mentioned by @saran-t in that issue. Providing some way to query additional information about the glfw context would partly solve this, as it would allow the use of shift-control-alt modifiers to use in addition to the default keybinds. The cleaner solution would be to be able to edit the default keybinds in addition to this.