An open API service indexing awesome lists of open source software.

https://github.com/osteele/optitrack-ws-server

Serve OptiTrack data from a CSV file to a WebSocket connection
https://github.com/osteele/optitrack-ws-server

motion-capture optitrack websocket-connection

Last synced: about 2 months ago
JSON representation

Serve OptiTrack data from a CSV file to a WebSocket connection

Awesome Lists containing this project

README

        

# 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
.

## Install

1. Verify that will python3 and pipenv are installed:

```sh
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](https://brew.sh)
2. Run the terminal commands:

```sh
brew install python pipenv
```

On other operating systems, follow the instructions
[here](https://pipenv.kennethreitz.org/en/latest/) to install pipenv.

3. Clone this repository
4. Inside the cloned directory, run this command:

```sh
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

* [OptiTrack CSV](https://v21.wiki.optitrack.com/index.php?title=Data_Export:_CSV)
* [websockets](https://websockets.readthedocs.io/en/stable/)