Add Move controller stream overlay profile
This commit is contained in:
parent
e9f871cc6d
commit
429f51fbd8
7 changed files with 524 additions and 0 deletions
108
config/mimir-runtime.move-stream.local.json
Normal file
108
config/mimir-runtime.move-stream.local.json
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
{
|
||||
"bufferSeconds": 5.0,
|
||||
"audioSync": {
|
||||
"mode": "passive",
|
||||
"referenceSourceId": "asio-ch2",
|
||||
"calibrationGain": 0.0,
|
||||
"watermarkGain": 0.0,
|
||||
"complexContourChannelModelPath": "../calibration/bioacoustic/complex-contour-channel-model.json",
|
||||
"enableComplexContourRuntime": true
|
||||
},
|
||||
"streams": [
|
||||
{
|
||||
"sourceId": "focusrite-asio",
|
||||
"displayName": "Starfire Scarlett ASIO",
|
||||
"kind": "Audio",
|
||||
"origin": "LocalDevice",
|
||||
"enabled": true,
|
||||
"adapter": "asio",
|
||||
"command": "../native/asio_capture/build/Release/mimir_asio_capture.dll",
|
||||
"sampleRate": 192000,
|
||||
"acceptSourceIds": [
|
||||
"asio-ch0",
|
||||
"asio-ch1",
|
||||
"asio-ch2",
|
||||
"asio-ch3"
|
||||
],
|
||||
"sourceLabels": {
|
||||
"asio-ch0": "Shotgun hero mic",
|
||||
"asio-ch1": "Cardioid hero mic",
|
||||
"asio-ch2": "Raven program loopback L",
|
||||
"asio-ch3": "Raven program loopback R"
|
||||
}
|
||||
},
|
||||
{
|
||||
"sourceId": "kiyo-pro-rgb",
|
||||
"displayName": "Kiyo Pro program view",
|
||||
"kind": "Video",
|
||||
"origin": "LocalDevice",
|
||||
"enabled": true,
|
||||
"adapter": "ks-camera",
|
||||
"command": "../native/camera_capture/build/Release/mimir_camera_capture.dll",
|
||||
"pathNeedle": "vid_1532&pid_0e05&mi_00",
|
||||
"width": 640,
|
||||
"height": 480,
|
||||
"inputFormat": "YUY2",
|
||||
"pixelFormat": "YUY2",
|
||||
"minimumFramesPerSecond": 25.0,
|
||||
"queueDepth": 8
|
||||
},
|
||||
{
|
||||
"sourceId": "ps3-eye-0",
|
||||
"displayName": "PS3 Eye 0 Move tracker",
|
||||
"kind": "Video",
|
||||
"origin": "LocalDevice",
|
||||
"enabled": true,
|
||||
"adapter": "ps3eye",
|
||||
"command": "../native/camera_capture/build/Release/mimir_ps3eye_capture.dll",
|
||||
"cameraIndex": 0,
|
||||
"width": 320,
|
||||
"height": 240,
|
||||
"framesPerSecond": 187
|
||||
},
|
||||
{
|
||||
"sourceId": "ps3-eye-1",
|
||||
"displayName": "PS3 Eye 1 Move tracker",
|
||||
"kind": "Video",
|
||||
"origin": "LocalDevice",
|
||||
"enabled": true,
|
||||
"adapter": "ps3eye",
|
||||
"command": "../native/camera_capture/build/Release/mimir_ps3eye_capture.dll",
|
||||
"cameraIndex": 1,
|
||||
"width": 320,
|
||||
"height": 240,
|
||||
"framesPerSecond": 187
|
||||
},
|
||||
{
|
||||
"sourceId": "raven-display",
|
||||
"displayName": "Raven screen capture",
|
||||
"clockDomainId": "raven-sync",
|
||||
"kind": "Video",
|
||||
"origin": "Network",
|
||||
"enabled": true,
|
||||
"adapter": "ffmpeg-rawvideo",
|
||||
"command": "ffmpeg",
|
||||
"width": 1920,
|
||||
"height": 1080,
|
||||
"pixelFormat": "Bgra8",
|
||||
"arguments": [
|
||||
"-hide_banner",
|
||||
"-nostdin",
|
||||
"-loglevel",
|
||||
"warning",
|
||||
"-fflags",
|
||||
"nobuffer",
|
||||
"-flags",
|
||||
"low_delay",
|
||||
"-i",
|
||||
"srt://0.0.0.0:5200?mode=listener&latency=120000&timeout=5000000",
|
||||
"-an",
|
||||
"-f",
|
||||
"rawvideo",
|
||||
"-pix_fmt",
|
||||
"bgra",
|
||||
"-"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -468,6 +468,17 @@ a named invariant that the native runtime cannot protect yet.
|
|||
about 4 ms; `ffplay`/DirectShow audio startup is still too soft for final
|
||||
physical latency authority, so native timestamped Scarlett playback/capture
|
||||
remains the production timing cut.
|
||||
`MimirMoveControllerTracker` is the first Mimir-native overlay owner for the
|
||||
streamable product shape: it tracks bright PS Move sphere observations from
|
||||
PS3 Eye luma frames, keeps a bounded history per `controllerId`, preserves
|
||||
the commanded/expected RGB identity for multiple controllers, and lowers the
|
||||
histories through the existing Feature evidence path. Synthetic smoke
|
||||
`--move-controller-overlay-smoke` proves two independent controller histories
|
||||
become one valid FieldEvidence claim/candidate without claiming 6DoF pose.
|
||||
`config/mimir-runtime.move-stream.local.json` names the first show profile:
|
||||
Kiyo Pro program view, both PS3 Eyes as Move trackers, Scarlett ASIO channels
|
||||
labeled as shotgun/cardioid/Raven loopback, and Raven screen capture on SRT
|
||||
port 5200.
|
||||
Next useful cut is direct report decoding plus optical sphere observations
|
||||
from PS3 Eyes/Kiyos entering the same calibration-evidence path as LED
|
||||
spline constraints.
|
||||
|
|
|
|||
83
docs/move-controller-stream.md
Normal file
83
docs/move-controller-stream.md
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
# Move Controller Stream
|
||||
|
||||
## Objective
|
||||
|
||||
Ship the first Mimir program surface around one concrete show shape:
|
||||
Kiyo Pro is the RGB program view, PS3 Eyes track multiple PS Move spheres,
|
||||
Raven screen capture enters as a synchronized video source, and Scarlett ASIO
|
||||
provides the two hero mics plus Raven program-loopback timing evidence.
|
||||
|
||||
## Authority Map
|
||||
|
||||
- Owner: `Mimir.Runtime` owns sample ingest, rolling buffers, and typed visual
|
||||
evidence. Fensalir owns overlay presentation and final program pixels.
|
||||
- Inputs: Kiyo Pro YUY2 video, both PS3 Eye Bayer8 feeds, Scarlett ASIO
|
||||
channels `asio-ch0..asio-ch3`, and Raven SRT screen capture on port `5200`.
|
||||
- Outputs: `kiyo-pro-rgb` is the base program view; PS Move controller histories
|
||||
lower as Feature evidence through `MimirMoveControllerTracker`; `raven-display`
|
||||
stays in the `raven-sync` clock domain; ASIO labels identify shotgun,
|
||||
cardioid, and Raven loopback lanes.
|
||||
- Derived state: Move 2D histories are observations, not 6DoF pose. Raven
|
||||
display timing is derived from Scarlett audio evidence, not SRT arrival time.
|
||||
- Forbidden writers: PS3 Eye blob tracks do not own camera calibration; Raven
|
||||
network timestamps do not own global sync; Kiyo Pro does not own high-rate
|
||||
motion truth.
|
||||
- Cut line: this profile is the first streamable overlay product, not the full
|
||||
online calibration solve.
|
||||
|
||||
## Runtime Profile
|
||||
|
||||
Use:
|
||||
|
||||
```powershell
|
||||
$env:MIMIR_RUNTIME_CONFIG = "E:\Projects\Mimir\config\mimir-runtime.move-stream.local.json"
|
||||
dotnet run --project .\src\Mimir.App\Mimir.App.csproj
|
||||
```
|
||||
|
||||
The profile declares:
|
||||
|
||||
- `kiyo-pro-rgb`: Kiyo Pro program view, 640x480 YUY2 at the current reliable
|
||||
25 fps class.
|
||||
- `ps3-eye-0`, `ps3-eye-1`: high-rate Move sphere visual witnesses.
|
||||
- `focusrite-asio`: one ASIO producer that emits:
|
||||
`asio-ch0` shotgun hero mic, `asio-ch1` cardioid hero mic,
|
||||
`asio-ch2` Raven program loopback L, and `asio-ch3` Raven program loopback R.
|
||||
- `raven-display`: Raven screen capture over SRT port `5200`.
|
||||
|
||||
Run the synthetic overlay smoke:
|
||||
|
||||
```powershell
|
||||
dotnet run --project .\src\Mimir.BufferSmoke\Mimir.BufferSmoke.csproj -- --move-controller-overlay-smoke
|
||||
```
|
||||
|
||||
Run the live ingest smoke once Raven is sending:
|
||||
|
||||
```powershell
|
||||
$env:MIMIR_RUNTIME_CONFIG = "E:\Projects\Mimir\config\mimir-runtime.move-stream.local.json"
|
||||
dotnet run --project .\src\Mimir.BufferSmoke\Mimir.BufferSmoke.csproj -- --seconds 5 --require-samples --sync-reference asio-ch2
|
||||
```
|
||||
|
||||
## Raven Sender
|
||||
|
||||
On Raven, start screen capture from the logged-in desktop session:
|
||||
|
||||
```powershell
|
||||
E:\Projects\Mimir\scripts\start-raven-screen-capture-sender.ps1 -TargetHost 192.168.1.66 -Port 5200
|
||||
```
|
||||
|
||||
Route Raven program audio into the Scarlett path that appears on
|
||||
`asio-ch2/asio-ch3`. That audio is the timing witness that earns the
|
||||
`raven-sync` correction for `raven-display`.
|
||||
|
||||
## Multiple Move Controllers
|
||||
|
||||
Do not collapse Move observations into a generic bright blob. Each controller
|
||||
has its own `controllerId` and expected RGB/time code. The PS3 Eyes can track
|
||||
the sphere as a high-rate brightness witness; Kiyo Pro can later confirm color
|
||||
identity; the commanded flash schedule ties the observed marker to the
|
||||
controller identity.
|
||||
|
||||
`MimirMoveControllerTracker` keeps a bounded history per controller and lowers
|
||||
those histories into the existing Feature evidence path. This is deliberately
|
||||
2D observation history. 6DoF pose waits for calibrated frustums and the global
|
||||
residual owner.
|
||||
|
|
@ -170,6 +170,11 @@ if (args.Any(arg => string.Equals(arg, "--ps3eye-tracking-smoke", StringComparis
|
|||
return RunPs3EyeTrackingSmoke();
|
||||
}
|
||||
|
||||
if (args.Any(arg => string.Equals(arg, "--move-controller-overlay-smoke", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return RunMoveControllerOverlaySmoke();
|
||||
}
|
||||
|
||||
if (args.Any(arg => string.Equals(arg, "--ps3eye-tracking-live", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return RunPs3EyeTrackingLive(args);
|
||||
|
|
@ -1165,6 +1170,65 @@ static int RunPs3EyeTrackingSmoke()
|
|||
: 1;
|
||||
}
|
||||
|
||||
static int RunMoveControllerOverlaySmoke()
|
||||
{
|
||||
const int width = 320;
|
||||
const int height = 240;
|
||||
var tracker = new MimirMoveControllerTracker(new MimirMoveControllerTrackerOptions(
|
||||
MaxHistoryPointsPerController: 12,
|
||||
MinimumLuma: 0.45,
|
||||
MinimumBlobPixels: 4.0));
|
||||
MimirMoveControllerTrackFrame latest = default!;
|
||||
var controllers = new[]
|
||||
{
|
||||
("move-00-06-f5-23-e2-d1", new MimirMoveControllerColor(255, 0, 64)),
|
||||
("move-00-06-f5-24-aa-10", new MimirMoveControllerColor(0, 160, 255)),
|
||||
};
|
||||
for (var frameIndex = 0; frameIndex < 10; frameIndex++)
|
||||
{
|
||||
foreach (var (controllerId, color) in controllers)
|
||||
{
|
||||
var luma = new byte[width * height];
|
||||
var x = controllerId.EndsWith("10", StringComparison.Ordinal)
|
||||
? 250 - frameIndex * 5
|
||||
: 40 + frameIndex * 7;
|
||||
var y = controllerId.EndsWith("10", StringComparison.Ordinal)
|
||||
? 70 + frameIndex * 4
|
||||
: 150 - frameIndex * 3;
|
||||
StampBlob(luma, width, height, x, y, radius: 5, peak: 245);
|
||||
latest = tracker.Update(
|
||||
"ps3-eye-0",
|
||||
controllerId,
|
||||
color,
|
||||
width,
|
||||
height,
|
||||
luma,
|
||||
1_000_000_000L + (frameIndex * controllers.Length) * 5_350_000L);
|
||||
}
|
||||
}
|
||||
|
||||
var candidate = tracker.ToFeatureTrackCandidate(latest);
|
||||
var evidence = new MimirFensalirFieldLowering().BuildFeatureTrackCandidateFrame([candidate]);
|
||||
var validation = AquariumFieldEvidenceValidator.Validate(evidence);
|
||||
var controllerCount = latest.Points.Select(static point => point.ControllerId).Distinct(StringComparer.Ordinal).Count();
|
||||
Console.WriteLine(
|
||||
$"move-controller-overlay-smoke controllers={controllerCount} history={latest.Points.Count} confidence={latest.Confidence:0.000} claims={evidence.Claims.Count} candidates={evidence.Candidates.Count} errors={validation.HasErrors}");
|
||||
foreach (var group in latest.Points.GroupBy(static point => point.ControllerId, StringComparer.Ordinal))
|
||||
{
|
||||
var newest = group.OrderBy(static point => point.AgeFrames).Last();
|
||||
Console.WriteLine(
|
||||
$"move-controller-track controller={group.Key} color={newest.ExpectedColor.Hex} points={group.Count()} latest=({newest.ImageX:0.0},{newest.ImageY:0.0}) velocity=({newest.VelocityXPerSecond:0.0},{newest.VelocityYPerSecond:0.0}) confidence={newest.Confidence:0.000}");
|
||||
}
|
||||
|
||||
return controllerCount == 2 &&
|
||||
latest.Points.Count >= 20 &&
|
||||
evidence.Claims.Count == 1 &&
|
||||
evidence.Candidates.Count == 1 &&
|
||||
!validation.HasErrors
|
||||
? 0
|
||||
: 1;
|
||||
}
|
||||
|
||||
static int RunPs3EyeTrackingLive(string[] args)
|
||||
{
|
||||
var library = ParseStringOption(args, "--native-library", Path.GetFullPath("native/camera_capture/build/Release/mimir_ps3eye_capture.dll"));
|
||||
|
|
|
|||
246
src/Mimir.Runtime/Synchronization/MimirMoveControllerTracker.cs
Normal file
246
src/Mimir.Runtime/Synchronization/MimirMoveControllerTracker.cs
Normal file
|
|
@ -0,0 +1,246 @@
|
|||
namespace Mimir.Runtime.Synchronization;
|
||||
|
||||
public sealed record MimirMoveControllerTrackerOptions(
|
||||
int MaxHistoryPointsPerController = 96,
|
||||
double MinimumLuma = 0.55,
|
||||
double MinimumBlobPixels = 6.0,
|
||||
double SearchRadiusPixels = 64.0);
|
||||
|
||||
public readonly record struct MimirMoveControllerColor(byte R, byte G, byte B)
|
||||
{
|
||||
public string Hex => $"#{R:X2}{G:X2}{B:X2}";
|
||||
}
|
||||
|
||||
public readonly record struct MimirMoveControllerTrackPoint(
|
||||
string ControllerId,
|
||||
MimirMoveControllerColor ExpectedColor,
|
||||
double ImageX,
|
||||
double ImageY,
|
||||
double ClipX,
|
||||
double ClipY,
|
||||
double RadiusPixels,
|
||||
double VelocityXPerSecond,
|
||||
double VelocityYPerSecond,
|
||||
int AgeFrames,
|
||||
long ObservedTimeNs,
|
||||
double Confidence);
|
||||
|
||||
public sealed record MimirMoveControllerTrackFrame(
|
||||
string SourceId,
|
||||
int Width,
|
||||
int Height,
|
||||
long ObservedTimeNs,
|
||||
IReadOnlyList<MimirMoveControllerTrackPoint> Points,
|
||||
double Confidence);
|
||||
|
||||
public sealed class MimirMoveControllerTracker(MimirMoveControllerTrackerOptions? options = null)
|
||||
{
|
||||
private readonly MimirMoveControllerTrackerOptions options = options ?? new();
|
||||
private readonly Dictionary<string, MoveControllerState> states = new(StringComparer.Ordinal);
|
||||
|
||||
public MimirMoveControllerTrackFrame Update(
|
||||
string sourceId,
|
||||
string controllerId,
|
||||
MimirMoveControllerColor expectedColor,
|
||||
int width,
|
||||
int height,
|
||||
ReadOnlySpan<byte> luma,
|
||||
long observedTimeNs)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(controllerId))
|
||||
{
|
||||
throw new ArgumentException("Controller id is required.", nameof(controllerId));
|
||||
}
|
||||
|
||||
if (width <= 2 || height <= 2 || luma.Length < width * height)
|
||||
{
|
||||
return Frame(sourceId, width, height, observedTimeNs);
|
||||
}
|
||||
|
||||
if (TryDetectSphere(width, height, luma, out var detection))
|
||||
{
|
||||
var state = states.TryGetValue(controllerId, out var existing)
|
||||
? existing
|
||||
: states[controllerId] = new MoveControllerState(controllerId);
|
||||
state.ExpectedColor = expectedColor;
|
||||
state.Add(detection, width, height, observedTimeNs, options.MaxHistoryPointsPerController);
|
||||
}
|
||||
|
||||
return Frame(sourceId, width, height, observedTimeNs);
|
||||
}
|
||||
|
||||
public MimirFeatureTrackFieldCandidate ToFeatureTrackCandidate(
|
||||
MimirMoveControllerTrackFrame frame,
|
||||
string calibrationId = "move-controller-overlay",
|
||||
string producerKey = "mimir-move-controller-tracker")
|
||||
{
|
||||
var observations = frame.Points
|
||||
.GroupBy(static point => point.ControllerId, StringComparer.Ordinal)
|
||||
.Select(group =>
|
||||
{
|
||||
var tracks = group
|
||||
.OrderBy(static point => point.AgeFrames)
|
||||
.Select(point => new MimirFeatureTrackPoint(
|
||||
StableTrackId(point.ControllerId),
|
||||
point.ImageX,
|
||||
point.ImageY,
|
||||
point.ClipX,
|
||||
point.ClipY,
|
||||
point.VelocityXPerSecond,
|
||||
point.VelocityYPerSecond,
|
||||
point.AgeFrames,
|
||||
point.Confidence))
|
||||
.ToArray();
|
||||
var meanAge = tracks.Length == 0 ? 0.0 : tracks.Average(static track => track.AgeFrames);
|
||||
var meanSpeed = tracks.Length == 0
|
||||
? 0.0
|
||||
: tracks.Average(static track => Math.Sqrt(
|
||||
track.VelocityXPerSecond * track.VelocityXPerSecond +
|
||||
track.VelocityYPerSecond * track.VelocityYPerSecond));
|
||||
var confidence = group.Average(static point => point.Confidence);
|
||||
return new MimirFeatureTrackCameraObservation(
|
||||
$"{frame.SourceId}:move:{group.Key}:{frame.ObservedTimeNs}",
|
||||
frame.SourceId,
|
||||
frame.Width,
|
||||
frame.Height,
|
||||
frame.ObservedTimeNs,
|
||||
tracks,
|
||||
tracks.Length,
|
||||
meanAge,
|
||||
meanSpeed,
|
||||
confidence);
|
||||
})
|
||||
.ToArray();
|
||||
var stableCount = observations.Sum(static observation => observation.Tracks.Count(track => track.AgeFrames >= 3));
|
||||
var meanFrameAge = observations.Length == 0 ? 0.0 : observations.Average(static observation => observation.MeanTrackAgeFrames);
|
||||
var meanFrameSpeed = observations.Length == 0 ? 0.0 : observations.Average(static observation => observation.MeanSpeedPixelsPerSecond);
|
||||
return new MimirFeatureTrackFieldCandidate(
|
||||
$"move-controller-history:{frame.SourceId}:{frame.ObservedTimeNs}",
|
||||
calibrationId,
|
||||
producerKey,
|
||||
observations,
|
||||
stableCount,
|
||||
meanFrameAge,
|
||||
meanFrameSpeed,
|
||||
frame.Confidence,
|
||||
frame.ObservedTimeNs);
|
||||
}
|
||||
|
||||
private MimirMoveControllerTrackFrame Frame(string sourceId, int width, int height, long observedTimeNs)
|
||||
{
|
||||
var points = states.Values
|
||||
.SelectMany(static state => state.History)
|
||||
.OrderBy(static point => point.ControllerId, StringComparer.Ordinal)
|
||||
.ThenBy(static point => point.AgeFrames)
|
||||
.ToArray();
|
||||
var confidence = points.Length == 0 ? 0.0 : points.GroupBy(static point => point.ControllerId).Average(static group => group.Last().Confidence);
|
||||
return new MimirMoveControllerTrackFrame(sourceId, width, height, observedTimeNs, points, confidence);
|
||||
}
|
||||
|
||||
private bool TryDetectSphere(int width, int height, ReadOnlySpan<byte> luma, out MoveSphereDetection detection)
|
||||
{
|
||||
var threshold = (byte)Math.Clamp(options.MinimumLuma * 255.0, 0.0, 255.0);
|
||||
var weightedX = 0.0;
|
||||
var weightedY = 0.0;
|
||||
var weightSum = 0.0;
|
||||
var brightPixels = 0;
|
||||
byte peak = 0;
|
||||
for (var y = 0; y < height; y++)
|
||||
{
|
||||
var row = y * width;
|
||||
for (var x = 0; x < width; x++)
|
||||
{
|
||||
var value = luma[row + x];
|
||||
if (value < threshold)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var weight = value - threshold + 1.0;
|
||||
weightedX += x * weight;
|
||||
weightedY += y * weight;
|
||||
weightSum += weight;
|
||||
brightPixels++;
|
||||
peak = Math.Max(peak, value);
|
||||
}
|
||||
}
|
||||
|
||||
if (brightPixels < options.MinimumBlobPixels || weightSum <= 0.0)
|
||||
{
|
||||
detection = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
var xCenter = weightedX / weightSum;
|
||||
var yCenter = weightedY / weightSum;
|
||||
var radius = Math.Sqrt(brightPixels / Math.PI);
|
||||
var confidence = Math.Clamp((peak / 255.0) * Math.Min(1.0, brightPixels / Math.Max(1.0, options.MinimumBlobPixels * 4.0)), 0.0, 1.0);
|
||||
detection = new MoveSphereDetection(xCenter, yCenter, radius, confidence);
|
||||
return true;
|
||||
}
|
||||
|
||||
private static double PixelToClipX(double imageX, int width) =>
|
||||
Math.Clamp(imageX / Math.Max(1.0, width) * 2.0 - 1.0, -1.0, 1.0);
|
||||
|
||||
private static double PixelToClipY(double imageY, int height) =>
|
||||
Math.Clamp(1.0 - imageY / Math.Max(1.0, height) * 2.0, -1.0, 1.0);
|
||||
|
||||
private static int StableTrackId(string controllerId)
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
var hash = 17;
|
||||
foreach (var ch in controllerId)
|
||||
{
|
||||
hash = hash * 31 + ch;
|
||||
}
|
||||
|
||||
return Math.Abs(hash == int.MinValue ? 0 : hash);
|
||||
}
|
||||
}
|
||||
|
||||
private readonly record struct MoveSphereDetection(double X, double Y, double RadiusPixels, double Confidence);
|
||||
|
||||
private sealed class MoveControllerState(string controllerId)
|
||||
{
|
||||
private readonly List<MimirMoveControllerTrackPoint> history = [];
|
||||
private long previousTimeNs;
|
||||
private double previousX;
|
||||
private double previousY;
|
||||
private int ageFrames;
|
||||
|
||||
public MimirMoveControllerColor ExpectedColor { get; set; }
|
||||
|
||||
public IReadOnlyList<MimirMoveControllerTrackPoint> History => history;
|
||||
|
||||
public void Add(MoveSphereDetection detection, int width, int height, long observedTimeNs, int maxHistory)
|
||||
{
|
||||
var dtSeconds = previousTimeNs <= 0 || observedTimeNs <= previousTimeNs
|
||||
? 1.0 / 187.0
|
||||
: Math.Max(1.0e-6, (observedTimeNs - previousTimeNs) / 1_000_000_000.0);
|
||||
var velocityX = previousTimeNs <= 0 ? 0.0 : (detection.X - previousX) / dtSeconds;
|
||||
var velocityY = previousTimeNs <= 0 ? 0.0 : (detection.Y - previousY) / dtSeconds;
|
||||
previousTimeNs = observedTimeNs;
|
||||
previousX = detection.X;
|
||||
previousY = detection.Y;
|
||||
ageFrames++;
|
||||
history.Add(new MimirMoveControllerTrackPoint(
|
||||
controllerId,
|
||||
ExpectedColor,
|
||||
detection.X,
|
||||
detection.Y,
|
||||
PixelToClipX(detection.X, width),
|
||||
PixelToClipY(detection.Y, height),
|
||||
detection.RadiusPixels,
|
||||
velocityX,
|
||||
velocityY,
|
||||
ageFrames,
|
||||
observedTimeNs,
|
||||
detection.Confidence));
|
||||
if (history.Count > maxHistory)
|
||||
{
|
||||
history.RemoveRange(0, history.Count - maxHistory);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -274,3 +274,4 @@
|
|||
{"ts": "2026-05-31T18:43:07+01:00", "type": "implementation", "status": "ok", "note": "PS Move music pulse range-hit behavior now treats a Perlines-style adaptive delta-range strike as full brightness: idle remains near black, but when the whitened FFT delta reaches the top of its adaptive range the LED onset is forced to max."}
|
||||
{"ts": "2026-05-31T18:47:32+01:00", "type": "implementation", "status": "ok", "note": "PS Move onset amplitude now ranks current whitened-delta broadband flux against a recent rolling history and emits brightness as percentile^exponent; exponent 2 maps median notable frames to 25% and top recent-window rises to full brightness."}
|
||||
{"ts": "2026-05-31T19:11:18+01:00", "type": "implementation", "status": "ok", "note": "PS Move latency probe now uses PS3 Eye visual witnesses and Scarlett cardioid audio by default, emits an order-3 de Bruijn event schedule with symbol-coded chirp bands, LED colors, and variable gaps, arms the Nightwing LED script before playback, writes event-schedule.json, and marks receipts invalid when audio/video event recovery is insufficient. Live encoded run recovered all eight PS3 Eye visual events with residuals within about 4 ms; ffplay/DirectShow audio start remains too soft for final physical latency authority."}
|
||||
{"ts": "2026-05-31T19:21:23+01:00", "type": "implementation", "status": "ok", "note": "Added MimirMoveControllerTracker for the first stream overlay product: PS3 Eye luma observations produce bounded per-controller PS Move sphere histories keyed by controllerId and commanded RGB identity, then lower through existing Feature evidence. Added config/mimir-runtime.move-stream.local.json for Kiyo Pro program view, both PS3 Eyes, Scarlett shotgun/cardioid/Raven loopback channels, and Raven SRT display. --move-controller-overlay-smoke passes with two controller histories and one valid FieldEvidence claim/candidate."}
|
||||
|
|
|
|||
|
|
@ -192,6 +192,17 @@ invariants:
|
|||
schedule residuals within about 4 ms; `ffplay`/DirectShow audio startup is
|
||||
still too soft for final physical latency authority, so native timestamped
|
||||
Scarlett playback/capture remains the production timing cut.
|
||||
`MimirMoveControllerTracker` is the first Mimir-native overlay owner for
|
||||
multiple PS Move controllers: it tracks bright sphere observations from
|
||||
PS3 Eye luma frames, keeps a bounded history per `controllerId`, preserves
|
||||
the commanded expected RGB identity for each controller, and lowers those
|
||||
histories into Feature evidence without claiming solved 6DoF pose.
|
||||
`Mimir.BufferSmoke --move-controller-overlay-smoke` proves two distinct
|
||||
controller histories produce one valid FieldEvidence claim/candidate.
|
||||
`config/mimir-runtime.move-stream.local.json` is the first show profile:
|
||||
Kiyo Pro program view, both PS3 Eyes as Move trackers, Scarlett ASIO
|
||||
labeled as shotgun/cardioid/Raven loopback, and Raven display over SRT
|
||||
port 5200.
|
||||
- PS3 Eyes now have a first sparse tracking surface instead of only cadence
|
||||
proof. `MimirSparseFeatureTracker` detects Bayer/luma corner features,
|
||||
links them into sensor-local tracks with clipspace position, velocity, age,
|
||||
|
|
|
|||
Loading…
Reference in a new issue