Skip to content

How to update the dat.gui panel programmatically #128

@diegoferigo

Description

@diegoferigo

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:

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:

  1. 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?
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions