Skip to content

Towards an All-in-One Webots/Jupyter Demo Container #3

@psychemedia

Description

@psychemedia

To allow the container to run as a standalone demo container, without first cloning the repo, I think the following files need copying in to the container:

  • index.html, setup_viewer.js and style.css.

The webots server also needs starting from the already added index.ipynb.

For some reason, if I view an uploaded index.html file from JupyterLab, the local js file is blocked from loading, although the remote JS files load fine. Adding the JS direct to the end of the index.html page and things work fine.

(As an aside, I guess it should be possible to wrap the webots HTML as a simple ipywidget using jp_proxy_widget? But I'm not sure what benefit if any that would provide? The ability to easily embod the streaming viewer into notebook output cell perhaps? But what advantage would the widget have over just embedding via an iframe?)

Re: having to start the webots server, and trying to simplify the user experience, it strikes me that jupyter-server-proxy could be used to start the server from the notebook UI or JupyterLab Launcher. I wonder if this approach could also be used to stop/start/reload the webots server to allow it to be loaded using different worlds from different Launcher icons etc?

This would then give a user experience of:

  1. launch container with a minimal viable start command, perhaps: docker run -p 8890:8888 ecervera/webots-docker:R2020a
  2. go to localhost:8890;
  3. start the webots server from a Jupyter launcher button;
  4. open index.html in JupyterLab.

I guess the next steps would then be pre-installing the py controller and providing a minimum viable example of programming a simulated robot in an example world from a notebook?

(Trying to think things through further in terms of what the containerisation means / makes possible: does webots have VS Code plugins too? If so, I guess VSCode could also be run in the container using s/thing like code-server, or linked from another container using docker-compose, to the simulator to be controlled from a containerised, browser based IDE? In Jupyterland, something like jhsingle-native-proxy might allow webots to launched via a Jupyterhub multiuser server, which would make it relatively straightforward for educators to provide authenticated access to a personal webots environment?)

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