mocopi web visualizer

server / website

Rust / JavaScript / Sensor


本製品はOSCに対応しているため、Web ブラウザとの通信も比較的容易に行える。



そこで UDPをベースにし文字列やバイナリの通信が可能なWebRTC data channelsを利用しブラウザとやりとりするサーバーを実装した。

Rust言語で開発したこのサーバーはmocopiからデータを受け取り、そのdataをdeserializeする。その後、WebRTC data channelsを用いてそのデータをWebブラウザに送信する。


I developed a system to visualize data on the web from Sony's compact motion capture device, “mocopi.” This product is compatible with the OSC protocol, which makes it relatively straightforward to communicate with web browsers. However, the OSC protocol that web browsers can handle is based on WebSocket, which relies on the TCP protocol instead of UDP.

To achieve a visualization closer to real-time in this project,  I determined that it's preferable to use the connectionless UDP protocol to the connection-oriented TCP. To achieve this, I implemented a server that mediates between mocopi and web browsers using WebRTC data channels, which can transmit both strings and binary data based on UDP.

This server, written in the Rust language, receives data from mocopi and deserializes it. It then forwards the data to the web browser using WebRTC data channels.

On the web browser side, I implemented a feature to visualize the data received from the server.