Skip to content
/ morseweb Public

A web client for the Modular OpenRobots Simulation Engine (MORSE)

Notifications You must be signed in to change notification settings

yarox/morseweb

Repository files navigation

morseweb

morseweb is a WebGL client for MORSE. It's a front-end graphical interface to the simulator and provides visualization of the simulation from a web browser. This means cross-platform support (including mobile devices) and minimal client-side dependencies.

Dependencies

  • MORSE 1.4
  • Redis
  • Xvfb and LLVMpipe (for launching MORSE in headless mode)

Instalation

morseweb is installed on the server-side. Once the server is set up and running, clients can watch the simulation by accessing the server's URL on a web browser.

Clone the repo wherever you want and install the requirements.

$ pip install -r requirements.txt

If you are using virtualenv or conda you will have to make pymorse available to your environment.

$ ln -s /path/to/python/dist-packages/pymorse /path /to/your/environment/lib/python3.5/site-packages

Finally, follow these instructions if you want to run MORSE in headless mode.

Launching the Simulation

Import the examplesim simulation into MORSE

$ morse import examplesim

and set the environment variables1 where MORSE will be looking for components:

$ export MORSE_ROOT="/usr"
$ export MORSE_RESOURCE_PATH="/path/number/one:/path/number/two"

Regular Mode

Open two terminals. In the first one run:

$ redis-server &
$ multinode_server &
$ morse run --name nodeA examplesim

And in the second one:

$ python runserver.py

Headless Mode

Open two terminals. In the first one run:

$ redis-server &
$ Xvfb -screen 0 100x100x24 :1 &
$ multinode_server &
$ export LD_LIBRARY_PATH=/path/to/mesa-11.0.7/build/linux-x86_64/gallium/targets/libgl-xlib
$ export DISPLAY=:1
$ morse run --name nodeA examplesim

And in the second one:

$ python runserver.py

Watching the Simulation

Open a browser and point it to where your server is running, e.g. example-server.com:8080. You should see the empty environment with an ATVR robot and two SmallTable objects.

Image of an example simulation

Loading Passive Objects

If you want to load passive objects into a scene you should set the name of the object exactly as the name of the model you're loading:

table = PassiveObject("props/objects", "SmallTable")
table.name = "SmallTable"
table.translate(2, 2, 0)
table.rotate(z=0.7)

Caveats

  • morseweb depends on multi-node mode of MORSE to track the state of the simulation.
  • Only one material per mesh is allowed in the models (see discussion here). But this should be fixed in future releases (see this and this).

Resources


1 MORSE_ROOT may be different if you installed MORSE in a custom location.

About

A web client for the Modular OpenRobots Simulation Engine (MORSE)

Resources

Stars

Watchers

Forks

Packages

No packages published