Skip to content

SimonKennethRobo/Vuer.cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vuer C++ Backend

C++ native backend for Vuer — replaces the Python server with Boost.Beast while reusing the unmodified WebXR frontend as a git submodule.

Clone

git clone --recurse-submodules [email protected]:SimonKennethRobo/Vuer.cpp.git
cd Vuer.cpp
git -C vuer fetch --tags
git -C vuer checkout v0.1.6

Build

cmake -S . -B build -DVUER_CPP_BUILD_ROS2=OFF
cmake --build build -j$(nproc)

Dependencies (Ubuntu 24.04):

sudo apt install build-essential cmake libboost-all-dev libopencv-dev \
  libssl-dev libzmq3-dev cppzmq-dev nlohmann-json3-dev

Run

Generate TLS certs for HTTPS/WSS (self-signed, includes LAN IPs):

chmod +x scripts/generate_lan_cert.sh
./scripts/generate_lan_cert.sh certs vuer-dev
# serve demo frames (no external source)
./build/vuer_cpp_server 8443

# HTTPS with ZMQ pose output
./build/vuer_cpp_server 8443 certs/vuer-dev.cert.pem certs/vuer-dev.key.pem --zmq-ipc /tmp/vuer_pose.sock

# subscribe to external ZMQ camera feed and render in VR
./build/vuer_cpp_server 8443 --zmq-ipc /tmp/vuer_pose.sock --zmq-video
  • Open https://<ip>:8443?ws=wss://<ip>:8443 on VR's browser.

ZMQ interface

--zmq-ipc enables IPC communication on a Unix domain socket:

Topic Direction Format Description
controller/left output JSON Left controller pose + state
controller/right output JSON Right controller pose + state
hand/left output JSON Left hand tracking
hand/right output JSON Right hand tracking
video input (--zmq-video) [meta JSON][JPEG] External camera feed

Pose subscriber:

python scripts/zmq_pose_subscriber.py

Video publisher example (camera → VR):

python scripts/zmq_video_publisher.py --ipc /tmp/vuer_pose.sock

ROS 2 image bridge

source /opt/ros/jazzy/setup.zsh
cmake -S . -B build -DVUER_CPP_BUILD_ROS2=ON
cmake --build build -j$(nproc)
./build/vuer_ros_image_bridge --ros-args -p port:=8099 -p image_topic:=/camera/image_raw

Programmatic API

#include "vuer_cpp/server.hpp"

vuer::ServerOptions options;
options.on_client_event = [](const nlohmann::json& event) {
    // event: {etype, ts, key, value: {left, right, leftState, rightState}}
    if (event.value("etype", "") == "CONTROLLER_MOVE") {
        // handle pose data
    }
};
vuer::Server server(options);
server.run_async();
// server.upsert_image_background_jpeg(frame, ...);

Acknowledgment

Vuer (v0.1.6) by Ge Yang, MIT License.

About

C++ native backend for [Vuer](https://github.com/vuer-ai/vuer) — replaces the Python server with Boost.Beast while reusing the unmodified WebXR frontend as a git submodule.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors