Skip to content

Serve OptiTrack data from a CSV file to a WebSocket connection

Notifications You must be signed in to change notification settings

osteele/optitrack-ws-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OptiTrack Gateway

A web server that serves offline OptiTrack data, that has been exported as CSV, via a websocket connection.

It is meant to be used in conjunction with the web client in https://github.com/osteele/p5pose-optitrack.

Install

  1. Verify that will python3 and pipenv are installed:

     python3 --version
     pipenv --version

    The first command should print Python 3.7.4 or greater.

    The second command should print something like pipenv, version 2018.11.26. It doesn't matter exactly what it prints, it just shouldn't error.

  2. If python3 and pipenv are not installed, install them. On macOS:

    1. Install homebrew

    2. Run the terminal commands:

      brew install python pipenv

    On other operating systems, follow the instructions here to install pipenv.

  3. Clone this repository

  4. Inside the cloned directory, run this command:

    pipenv install

Create CSV Files

You will need an OptiTrack *.csv file.

Use the following command to convert this file to JSON:

pipenv run create-csv FILE_OR_DIR...

If FILE_OR_DIRNAME is a CSV file, it creats a *.json file in the ./build directory.

If FILE_OR_DIRNAME is a directory, all *.csv files directly inside that directory (but not files inside directories in that directory) are converted.

pipenv run print-bones FILE_OR_DIR...

Prints the bone names.

Run the Server

pipenv run server [JSON_PATH]

This serves data from JSON_PATH on WebSocket port 8765. It can be accessed from a client running on the same machine, at ws://localhost:8765.

References

About

Serve OptiTrack data from a CSV file to a WebSocket connection

Topics

Resources

Stars

Watchers

Forks