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.
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.
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"
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
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
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.
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)
- 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).
1 MORSE_ROOT
may be different if you installed MORSE in a custom location. ↩