mirror of
https://github.com/DeeJanuz/frametop.git
synced 2026-10-06 04:04:09 +02:00
- Programs: ft-camd (the camera broker), ft-hands (the tracker), and ft-handreplay and ft-ringplay for recordings, built by hands/build.sh into hands/build/ with one Makefile. The first build fetches ncnn at frame-hands' pinned tag and builds it with the same options. - ft-camd gets its privileges from file capabilities (CAP_SYS_PTRACE, CAP_PERFMON, CAP_DAC_READ_SEARCH) that hands/run.sh install sets with sudo, and drops them once set up. It still works under sudo. It runs on the host, linked statically, as frametop-camd.service. ft-hands runs in the dev container as frametop-hands.service. Both start and stop with SteamVR. - Files move to /run/user/UID/frametop/ (cam-ring, hands, gestures), not $XDG_RUNTIME_DIR, which a terminal in the Frametop desktop has its own of. SIGUSR1 recordings go to ~/.local/share/frametop/hands. - The calibration is read through /run/host in the container. - Settings: HANDS_SWAP_SIDES and HANDS_CPUS in frametop.conf. - install.sh offers hand tracking as an optional last step. - The container gets jsoncpp-devel, glibc-static, and NumPy and OpenCV for the Python tools. - tools/ring.py reads the ring, and models/NOTICE credits the Apache-2.0 models. Checked: ft-handreplay gives identical summaries and byte-identical depth dumps to frame-hands' fh-replay on both 2026-09-29 recordings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
40 lines
2.0 KiB
C++
40 lines
2.0 KiB
C++
// Tracking-camera calibration from the headset's factory files (see tools/calib.py
|
|
// for the conventions): Kannala-Brandt fisheye intrinsics, and each camera's pose in the
|
|
// head frame (OpenVR's: +x right, +y up, -z forward), metres.
|
|
#pragma once
|
|
|
|
#include "geom.h"
|
|
|
|
#include <map>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
struct Camera {
|
|
std::string name;
|
|
int width = 0, height = 0;
|
|
double fx = 1, fy = 1, cx = 0, cy = 0, k[4] = {};
|
|
double R[3][3] = {}; // camera axes (columns) in the head frame
|
|
V3 origin{}; // camera centre in the head frame
|
|
|
|
V2 project_cam(V3 p) const; // camera frame -> pixels
|
|
V3 unproject(V2 uv) const; // pixels -> unit ray, camera frame
|
|
V3 ray(V2 uv) const; // pixels -> unit ray, head frame
|
|
V2 project(V3 head, double *depth) const; // head frame -> pixels; depth along the optical axis
|
|
double off_axis(V2 uv) const; // degrees between the pixel's ray and the axis
|
|
};
|
|
|
|
// Loads /persist/xrservice.json and /persist/device_config.json. Keyed by calibration
|
|
// name: slam_left, slam_right, upper_left, upper_right.
|
|
bool load_calibration(std::map<std::string, Camera> &out, std::string &err);
|
|
|
|
// The Arcturus color cameras (tools/calib.py load_color has the conventions), for
|
|
// ft-camd --with-color's images: luma at 1/scale size, recorded as color_video<N>. They're
|
|
// keyed by those recorded names: left_node is passthrough_left, right_node
|
|
// passthrough_right. crop_subtract: image x = sensor x - the calibration's cropRegion.x.
|
|
// tools/check_color.py tells which node is which and which crop reading fits.
|
|
bool load_color_calibration(std::map<std::string, Camera> &out, const std::string &left_node,
|
|
const std::string &right_node, bool crop_subtract, int scale, std::string &err);
|
|
|
|
// The point closest to several rays (weighted), and its rms distance to them.
|
|
V3 triangulate(const V3 *origins, const V3 *dirs, const double *weights, int n, double *rms);
|