Skip to content
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

[python/viewer] Fallback to generic direct connection through ipykernel for Meshcat. #479

Merged
merged 2 commits into from
Jan 21, 2022

Conversation

duburcqa
Copy link
Owner

@duburcqa duburcqa commented Jan 20, 2022

Several limitations:

  • Getting the server origin is difficult. window.location.origin is not reliable, for instance it will fail if the notebook server is hidden behind a reverse proxy, or it is embedded in a app such as VSCode. Using a tunnel and go through the usual meshcat zmq socket is an alternative solution, but it requires setting up a server or paying a service for it. Another option would be to develop a proper widget to get access to the kernel websocket through it, but it is not solution the compatibility issue with cloud notebooks providers such as deepnote, kaggle or colab.
  • It is suffering from throughput limitation that are monitored by ipython kernel. The solution would be to gather the messages whenever it is possible, for instance when updating the position for frames.
  • Managing the websocket in the iFrame is problematic since when the window unload it gets closed and the delay is too short to notify the kernel in order to keep track of the number of communication opened.

To sum up, finding a way to get access to the kernel websocket instead of opening a communication manually inside the frame seems to be necessary, but there is no way to do so by design... So being generic looks like a dead end. But the current implementation is good enough to more or less work on several platforms such as mybinder and kaggle (with a little tweak of the url origin).

@duburcqa duburcqa force-pushed the meshcat_remote branch 2 times, most recently from 20502ae to c6d0980 Compare January 20, 2022 17:38
@duburcqa duburcqa enabled auto-merge (squash) January 20, 2022 17:39
@duburcqa
Copy link
Owner Author

It also fixes has_gui in interactive mode.

@duburcqa duburcqa force-pushed the meshcat_remote branch 2 times, most recently from 4752f51 to c2d9f30 Compare January 21, 2022 09:08
@duburcqa duburcqa added enhancement New feature or request python labels Jan 21, 2022
@duburcqa duburcqa merged commit f025f19 into dev Jan 21, 2022
@duburcqa duburcqa deleted the meshcat_remote branch February 23, 2022 19:01
@duburcqa duburcqa mentioned this pull request Mar 1, 2022
duburcqa added a commit that referenced this pull request Mar 2, 2022
* [core] Always regenerate original flexible model at reset to allow manual overwrite of rigid original model. (#475)
* [core] Fix segfault when adding unspecified constraint. (#476)
* [core] Fix 'buildReducedModel' for pinocchio < 2.6.0. (#477)
* [core] Fix segfault when initializing engine with null robot. (#477)
* [python/viewer] Fallback to generic direct connection through ipykernel for Meshcat (VSCode, Jupyterlab). (#479)
* [python/viewer] More robust comm filtering for executing meshcat related requests out of order. (#479)
* [python/viewer] Fix connection to existing meshcat process. (#479)
* [python/viewer] Speed up frame capture and reduce CPU load in offscreen mode for panda3d backend. (#481)
* [python/viewer] Drop support of 'gepetto-gui' backend. (#482)
* [python/viewer] Fix random segfault at exit for synchronous panda3d backend. (#484)
* [gym/common] Enable to provide custom robot to 'WalkerJiminyEnv'. (#477)
* [gym/rllib] Refactor PPO implementation to support 'ray>=1.10.0'. (#474) (#485)
* [gym/rllib] PPO supports dict and box spaces for observation/action. (#474)
* [gym/rllib] PPO L2 reg only on train params. (#485)
* [misc] Use Ctest for managing C++ unit tests. (#475)

Co-authored-by: Alexis Duburcq <alexis.duburcq@wandercraft.eu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant