Giter Site home page Giter Site logo

axis-streamer's Introduction

Axis Streamer

A Node.js based Axis Neuron mocap reader that listens for streams of data coming from the Axis Neuron application. Data is streamed over UDP as BVH-binary version 1.1.0.0 so that it can be read and interpreted by the axis-streamer application.

Data is streamed from Axis Neuron over UDP port 7002. When data arrives and is parsed, the following options are available:

  1. OSC broadcast: forward absolute joint positions as OSC messages over UDP to OSC receivers
  2. WebSocket: send absolute joint positions to a web-app listening on default port 5080

Alternatively, data can be read and played back from one or more .bvh files.

Installation

Install Command Line Tools

  • open a Terminal
  • install Node.js and the yarn package manager if you haven't done so yet, an installer is available from the Node.js website. Alternatively use brew or nvm.
  • check if Node.js and yarn are properly installed by typing node --version and yarn --version in the terminal
  • install npx with yarn global add npx

Setting up

Before you start, the folder structure for Axis-Streamer should look like this assuming your project's root folder is called movement-project

movement-project
├── external
|   ├── app
|   ├── storage
|   |   ├── bvh
|   |   └── settings
  1. use the Terminal to cd into the directory where you want your project to live eg. cd ~/Documents and create a folder which you want to use as your working directory eg. movement-project with mkdir movement-project then change directory with cd movement-project
  2. inside working directory movement-project a folder structure as outlined above is required.
  3. then clone the axis-streamer repository from https://github.com/sojamo/axis-streamer.git with git clone https://github.com/sojamo/axis-streamer.git into the working directory.
  4. cd into the repository's root folder cd axis-streamer
  5. install project dependencies with running yarn
  6. call yarn run help for a list of options, or call yarn run with --mode stream for streaming data from Axis Neuron (see details below) or use yarn run with --mode load to load and playback a .bvh file (files should be located inside folder external → storage → bvh), call yarn run with --mode streamload to load and stream data simultaneously.
  7. open http://localhost:5080 in your browser, you should see a black 3D space with a checkered-board plane and one or more body representations.

After you have completed the above steps, your folder structure should look like this

movement-project
├── axis-streamer
├── external
|   ├── app
|   ├── storage
|   |   ├── bvh
|   |   └── settings

Update project

  • cd into your working directory eg. movement-project and git pull to update to the latest version

Settings

Axis-Streamer uses a json file to customize settings, these settings files go into movement-project → external → storage → settings. See the wiki at wiki/Settings for a detailed breakdown.

Streaming Data

the following assumes that you are using a Terminal and you are cd'ed into your working directory.

Real-time

To stream data from Axis Neuron cd into your working directory and use yarn run with --mode stream

  • open Axis Neuron
  • open a .raw mocap file or connect your sensor suit
  • after the file is loaded, use the play-buttons inside the Control editing pane to start the playback, you can increase the playback speed on the right and set the playback to loop (see loop-icon)
  • under Preferences → Output format set Frequency reducing to a value below 1 and make sure Rotation is set to YXZ and Displacement is ticked.
  • under Preferences → Broadcasting choose UDP and scroll down to section BVH. Here tick enable, set Format to Binary, the Client Port should be 7002
  • confirm with OK
  • data should now stream to the application and animate the skeleton in the browser at http://localhost:5080

From file

To stream data from file(s) use yarn run with --mode load. You need to place a .bvh file named eg. test.bvh (you can copy test.bvh located inside folder assets for a start) into folder external → storage → bvh after which you need to update the filePath to the(se) file(s) in your Settings file (breakdown of settings).

movement-project
├── axis-streamer
├── external
|   ├── app
|   ├── storage
|   |   ├── bvh   ⟵
|   |   └── settings

Stream and File

To accept both, streams and files, use yarn run with --mode streamload

Ports

  • 7002 Axis Neuron (UDP)
  • 5000 OSC (UDP)
  • 5080 when axis-streamer is running, open a browser window and point at http://localhost:5080 (HTTP and WebSocket)

Examples

There are 3 examples inside the examples folder for

  • OpenFrameworks over UDP and OSC
  • Processing over UDP and OSC
  • p5js over WebSocket

Status

  • This project is currently under development
  • The purpose of this project is to take data streamed from Axis Neuron or from a .bvh file, translate angular position data to absolute position coordinates and streame these out over WebSocket and OSC
  • Able to send and receive multiple streams

axis-streamer's People

Contributors

sojamo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ohuu

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.