Git Product home page Git Product logo

morseweb's Introduction

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. โ†ฉ

morseweb's People

Contributors

pierrickkoch avatar yarox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

morseweb's Issues

Display messages from the simulation

Add a way to show messages from the running simulation scripts into the web interface. May be useful to display simulation progress, for example.

Remove ExtraServices dependency

1 fakerobot.extra.get_camera_position, to get the camera position.
2 fakerobot.extra.get_environment, to get the name of the environment the simulation is running on.
3 fakerobot.extra.get_start_time, to get the time the simulation started.

1 is provided in 1.3 as supervision_services.get_camarafp_position.
2 will be provided in 1.4 in supervision_services.details through the field environment.
3 will be provided in 1.4 in the multinode message through the entry __time. It is a list containing simulation_time, simulation_dt, and real_time.

Here is the pull request addressing these changes in MORSE.

Can't locate JSON model of custom environment

When loading a custom environment, e.g.: Environment("mysim/envs/arena.blend"), morseweb can't locate its exported model inside morseweb/web/models. It seems it's trying to find a model called mysim/envs/arena.blend.json instead of just arena.json.

multinode_server import error

Hi!
I just started using MORSE today, so excuse me for my total noobness. I followed the tutorial on MORSE website to get it to run in headless mode, and it seems to work, but when I try to run the multinode_server before starting the web interface I get this error:

Traceback (most recent call last):
  File "/usr/local/bin/multinode_server", line 30, in <module>
    from pymorse.stream import StreamJSON, PollThread
ImportError: cannot import name 'PollThread'

Any idea how to fix it?
Thanks!

Autoreload simulation

Make it possible to load a new simulation (update the environment and the models present on it) without having to restart the websocket service.

Auto export objects from simulation

Automatically export the objects present in the simulation when loading the websocket server. We could check if the latest version of the models are already exported and, if not, execute the blender export tool.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.