RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.26k stars 1.26k forks source link

Preserve meshcat viewport across browser reloads #19183

Open jwnimmer-tri opened 1 year ago

jwnimmer-tri commented 1 year ago

Currently, any time we reload the browser page, the camera view goes back to its default. In the common case of restarting a simulation process (and therefore meshcat server) over and over again, it means we get the yellow "reconnecting..." box pop up for a moment, then once the simulator is up and running again the page reloads and the camera goes back to its default. This is annoying if the user had panned or zoomed to somewhere more appropriate and wants to keep the same perspective as they retry.

I think we could propagate the camera pose across the reload, via the query string. At minimum, the yellow-box reload logic should do this. As a bonus, possibly even a Ctrl-R reload (forced page reload) maybe should also do it.

jwnimmer-tri commented 7 months ago

One passing thought -- instead of remembering the camera across the yellow-box reload, we could actually not reload the page when we reconnect. Instead, we could very carefully reset the parts of scene that should be reset, and leave alone the parts that shouldn't (like the camera).

I've been pondering that a little bit on its own, because it might end up helping with mesh texture caching when the simulator (and thus, ws server) is restarted.