Skip to content

feat: add recording and replay mode with safe telemetry - #14

Merged
ryanwhois merged 1 commit into
release/v1.5.0-geometry-components-telemetryfrom
release/v1.6.0-recording-replay-telemetry
May 14, 2026
Merged

ryanwhois merged 1 commit into
release/v1.5.0-geometry-components-telemetryfrom
release/v1.6.0-recording-replay-telemetry

Conversation

@ryanwhois

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings May 14, 2026 15:40
@ryanwhois
ryanwhois merged commit 49382db into release/v1.5.0-geometry-components-telemetry May 14, 2026
2 of 4 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds offline OptiTrack recording and replay support so Grasshopper workflows can be developed and tested without a live Motive session.

Changes:

  • Adds recording models, JSON serialization, recording sessions, frame snapshotting, and a replay IOptiTrackClient.
  • Adds Grasshopper components for recording, loading, replaying, and inspecting recordings.
  • Updates docs, examples, changelog, and version metadata for v1.6.0.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/Tracker/Tracker.csproj Includes new recording/replay source files in the build.
src/Tracker/Properties/AssemblyInfo.cs Bumps assembly version to 1.6.0.
src/Tracker/OptiTrack/Recording/OptiTrackReplayClient.cs Implements replay client over recorded frames.
src/Tracker/OptiTrack/Recording/OptiTrackRecordingSession.cs Buffers frames and builds recording metadata.
src/Tracker/OptiTrack/Recording/OptiTrackRecordingSerializer.cs Adds JSON save/load helpers.
src/Tracker/OptiTrack/Recording/OptiTrackRecordingModels.cs Defines recording container and metadata models.
src/Tracker/OptiTrack/Recording/OptiTrackFrameSnapshot.cs Clones frame payloads for recording/replay isolation.
src/Tracker/Components/ReplayOptiTrackRecordingComponent.cs Adds Grasshopper replay component.
src/Tracker/Components/RecordOptiTrackStreamComponent.cs Adds Grasshopper recording component.
src/Tracker/Components/LoadOptiTrackRecordingComponent.cs Adds Grasshopper JSON loading component.
src/Tracker/Components/InspectRecordingMetadataComponent.cs Adds Grasshopper metadata inspection component.
README.md Documents offline recording/replay and v1.6.0 target.
examples/README.md Lists available examples and sample recording.
examples/data/sample-rigid-body-recording.json Adds synthetic replay sample data.
docs/troubleshooting.md Updates telemetry version reference.
docs/telemetry.md Updates version references and recording/replay telemetry rules.
docs/recording-and-replay.md Adds recording/replay user documentation.
docs/grasshopper-components.md Documents new recording/replay components.
docs/architecture.md Adds recording/replay architecture flow.
CHANGELOG.md Adds v1.6.0 changelog entry.

continue;
}

await DisconnectAsync().ConfigureAwait( false );
Comment on lines +136 to +148
if ( handlersAttached ) {
return;
}

replayClient.FrameReceived += ( sender, args ) => {
currentFrame = args.Frame;
};
replayClient.ConnectionChanged += ( sender, args ) => {
if ( !string.IsNullOrWhiteSpace( args.Message ) ) {
status.Add( args.Message );
}
};
handlersAttached = true;
Comment on lines +58 to +60
telemetry.CaptureException( exception, new TelemetryContext()
.SetTag( "operation", "load_recording_json" )
.SetTag( "error_type", exception.GetType().Name ) );
OptiTrackRecordingSerializer.SaveJson( recording, outputFile );
status = "Recording saved.";
} catch ( Exception exception ) {
telemetry.CaptureException( exception, new TelemetryContext()
- `DurationSeconds`
- `Frames` (array of `OptiTrackFrame` domain-model payloads)

See [sample-rigid-body-recording.json](/d:/Repos/Archive/optitrack-gh/examples/data/sample-rigid-body-recording.json).
}

lock ( sync ) {
currentIndex = nextIndex;
Comment on lines +12 to +14
private static readonly object sync = new object();
private static readonly OptiTrackRecordingSession session = new OptiTrackRecordingSession();
private static bool lastRecordState;
Comment on lines +14 to +19
private static readonly object sync = new object();
private static readonly OptiTrackReplayClient replayClient = new OptiTrackReplayClient();
private static OptiTrackRecording lastRecording;
private static OptiTrackFrame currentFrame;
private static readonly List<string> status = new List<string>();
private static bool handlersAttached;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants