-
Notifications
You must be signed in to change notification settings - Fork 68
Description
Hi @rdeits, thanks for all your work with meshcat!
I'm trying to obtain using Python something similar to what was done in drake for controlling the displayed panel programmatically, i.e. adding (at least) buttons with callbacks and (possibly) sliders.
As inexperienced web developer (read, never developed any web-related application), here below I summarize what I learned from the repos:
- The communication is layered in two steps:
meshcat.Visualizer
⇐ zmq ⇒ zmq server- zmq server ⇐ WebSockets ⇒ Browser
- The displayed control panel in the Browser uses dataarts/dat.gui, defined in
index.js#L297
- Recently, PRs improved the way to interact with the control panel:
- It seems that it's possible to use the zmq server to interact with the controls RussTedrake/manipulation#145
To conclude this summary, drake eventually dropped the zmq additional step and started communicating directly with the WebSocket (RobotLocomotion/drake#13038 (comment)). I also found a similar issue you commented few years ago (meshcat-dev/meshcat#44 (comment)) in which you wrote that this is also the approach used in Julia.
This being said, from Python I'm currently missing the connection step between the meshcat.Visualizer
(or any inheriting class) and the controls:
- Let's assume I can start a custom version of
meshcat.servers.zmqserver.ZMQWebSocketBridge
and define new commands. Do you have any pointers on how to pass through the zmqserver for interfacing with the controls? - Instead, by creating together with the Visualizer an additional direct connection to the websocket, what would be the approach to access the control panel? I assume that both connections (this new one + the exising one) could co-exist, but I might be wrong.
For future reference, in rdeits/meshcat@test there are static html with experiments that can be opened as follows:
cd meshcat/test
python3 -m http.server
# Browse: http://localhost:8000/<filename>.html