Giter VIP home page Giter VIP logo

luminave-thorium's Introduction

luminave-thorium

Create a connection between luminave and the Thorium Simulator using GraphQL.

Build Status

Table of Contents


Setup

  • Clone this repository
  • Install the dev dependencies by executing npm install inside the luminave-thorium folder

Config

If you want to change the host & port of luminave-thorium, you have to create a .env file inside the luminave-thorium folder.

Example .env

# Host of the luminave-server
HOST_LUMINAVE_SERVER=localhost

# Port of the luminave-server
PORT_LUMINAVE_SERVER=4000

# Host of Thorium
# Leave it undefined if you want to have it auto detected with bonjour
#HOST_THORIUM=undefined
# Port of Thorium
# leave it undefined if you want to have it auto detected with bonjour
#PORT_THORIUM=undefined

# ID of the Thorium client that is used by the Thorium Server to
# identify this client as the one that can control the lighting
# Note: As of now this will only work if the letters 'ECS' are part of the clientId
# Note: Only change if you know what you are doing
#THORIUM_CLIENTID='ECS'

# ID that will be used in luminave to identify the animation that will be used to 
# dynamically update it's keyframes
# Note: Only change if you know what you are doing
#LUMINAVE_ANIMATIONID=luminave-thorium-dynamic-animation-1337

Use with luminave & Thorium

  • Start with npm start
  • Start Thorium server with npm start
  • Create a flight in Thorium at http://localhost:3000
  • Add the luminave-thorium as a client with the name ECS-luminave-thorium to the created flight

That's it, luminave-thorium is now ready to receive data from Thorium to send it over to luminave-server.

General Workflow

  • The app tries to find the Thorium Server running in the local network
  • When it finds it it tries to setup a connection to it and registers itself as a client called "ECS"
  • When this was successful, it subscribes to new messages on the simulator and the lighting changes (thorium-lighting)
  • Those updates are send via a mutation to the luminave-server

GraphQL


Troubleshooting

No data received from Thorium

  • Check if the client IP changed, if that happened you have to restart Thorium & luminave-thorium so it registers itself with the new IP of your computer

One action in Thorium is triggering more than 1 changes in luminave e.g. the same scene multiple times

  • Restart thorium-client and refresh Thorium in the browser

API Documentation

Can be found on API documentation.


Data provided by Thorium

Detailed explanation on how this data could be interpreted.

query Simulators($simulatorId: String) {
  simulators(id: $simulatorId) {
    id
    lighting {
      intensity # [0 - 1] How bright the lights should be
      action # One of 'normal', 'fade', 'shake', 'strobe', 'oscillate'
      actionStrength # [0 - 1] How intense the action is. How quickly it shakes, or how fast it strobes or oscillates
      transitionDuration # How long a 'fade' action should last in milliseconds
      color # A suggested color for the lights
    }
  }
}

luminave-thorium's People

Contributors

alexanderson1993 avatar semantic-release-bot avatar timpietrusky avatar

Watchers

 avatar

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.