Repository navigation
feat: add recording and replay mode with safe telemetry - #14
Merged
ryanwhois merged 1 commit intoMay 14, 2026
Conversation
ryanwhois
merged commit May 14, 2026
49382db
into
release/v1.5.0-geometry-components-telemetry
2 of 4 checks passed
There was a problem hiding this comment.
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.