Files
kinect/fallback/linux-openni2/README.md
T
2026-11-25 05:09:31 -05:00

35 lines
1.9 KiB
Markdown

# fallback/linux-openni2/ — OpenNI2 virtual device fallback (todo 15)
An OpenNI2 device-driver module (OniDriverApi) exposing the `core/synth` streams as an
OpenNI2 device ("SynthKinect"), so OpenNI apps work without the usbip path; doubles as
the Linux general-emulator surface. Consumes `core/synth`/`core/mapping` directly
(never duplicates them); never bundles NiTE2 - skeleton tracking stays out of scope
here (see `.omo/evidence/task-15-webcam-kinect-emulator.log`).
## Layout
- `vendor/openni2/Driver/{OniDriverAPI.h,OniDriverTypes.h}` - fetched via raw HTTPS
from `github.com/structureio/OpenNI2` (Apache-2.0); the custom-driver ABI headers
are not in the OpenNI2 `-dev` package.
- `src/openni2_synth_driver.cpp` - the driver: a depth stream
(`ONI_PIXEL_FORMAT_DEPTH_1_MM`, 320x240@30fps) and a color stream
(`ONI_PIXEL_FORMAT_RGB888`), both sourced from `core/synth::DepthRasterizer` /
`nui::synth::passthrough_color` over a fixed human-silhouette fixture.
- `tools/openni2_depth_consumer.cpp` - an independent headless consumer using the
public `openni::Device`/`VideoStream`/`VideoFrameRef` C++ API to prove a real
OpenNI2 stack accepts the synthetic depth.
## Build + verify
```
cmake -S fallback/linux-openni2 -B fallback/linux-openni2/build
cmake --build fallback/linux-openni2/build
LD_LIBRARY_PATH=$HOME/.local/openni2-root/usr/lib/x86_64-linux-gnu \
fallback/linux-openni2/build/openni2_depth_consumer
```
The build step also deploys `libSynthKinect.so.0` into the provisioned
`$HOME/.local/openni2-root` install's own default driver directory - this
particular `libOpenNI2.so` build only scans `<lib dir>/OpenNI2/Drivers` for
files matching `*.so.0` (no `OPENNI2_DRIVERS_PATH` env var, and its
`/etc/openni2/OpenNI.ini` lookup uses an absolute system path that does not
exist without a package install). See the evidence log for the full
investigation and a captured run with real depth numbers.