Skip to content

Split 5 of 7: capture adapters, camera producer hub and agent DataService - #1796

Draft
martien-wdy wants to merge 3 commits into
split/4-sensors-entitlementfrom
split/5-capture
Draft

Split 5 of 7: capture adapters, camera producer hub and agent DataService#1796
martien-wdy wants to merge 3 commits into
split/4-sensors-entitlementfrom
split/5-capture

Conversation

@martien-wdy

Copy link
Copy Markdown
Contributor

Problem

See chunk 1 for why pull request #1751 is being split. This is chunk 5 of 7.

Cause

The episode store from chunk 2 and the sensor sockets from chunk 4 have no producer. Nothing captures from a camera, a microphone or a Robot Operating System 2 (ROS 2) bag, and nothing serves the agent side DataService the protocol definitions in chunk 3 declared.

Solution

Adds the capture side of the data platform:

  • Audio, camera and ROS 2 capture adapters, which write bracketed, uncertainty carrying samples into active episodes.
  • A multiplexing camera producer hub inside the video service, so episode capture and every app sensor subscriber share one hold on the device instead of contending for it. The video service now satisfies the sensorProvider interface chunk 4 introduced.
  • The agent side DataService implementation.
  • The wendy-agent wiring these need: the data manager and its quota bounds, the data service and its audio, ROS 2 and video dependencies, the two app socket managers, and the sensor provider registration. The video service is now constructed before the socket managers, because it owns the camera producer the sensor sockets subscribe apps to and every per app sensor socket must be built with that provider already registered.

Episode store bounds are configurable through WENDY_DATA_MAX_BYTES and WENDY_DATA_RESERVE_BYTES. A value that is present but unusable is logged rather than silently ignored, so a device configured with a bad quota learns that its configuration did not take.

Deliberately left to later chunks

Getting sealed episodes off the device. The transfer worker and the telemetry endpoint override are chunk 6, and the main.go changes for them are held back to that chunk. The read side command line tools and the example app are chunk 7.

Depends on

Chunk 4 (split/4-sensors-entitlement), which this pull request is based on.

Verification

  • CC=/usr/bin/clang go build ./... succeeds.
  • CC=/usr/bin/clang go test ./go/internal/agent/services/... ./go/cmd/... passes.
  • gofmt -l go/ is empty and go vet is clean for the touched packages.
  • Diff size: 4991 lines.

Adds the audio, camera and Robot Operating System 2 (ROS 2) capture
adapters, turns the video service into a multiplexing camera producer the
sensor sockets subscribe to, and implements the agent-side DataService.
Wires all of it into the agent.

Getting sealed episodes off the device is deliberately left to chunk 6.

Part 5 of 7 in the split of the Wendy Data Platform change.
return err
}
if err := writeWAVHeader(f, audioSampleRate, audioChannels, 0); err != nil {
f.Close()
}
mappings, err := os.OpenFile(filepath.Join(dir, "clock_samples.jsonl"), os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0o640)
if err != nil {
index.Close()
}
hub, subID, frames, achievedW, achievedH, achievedFPS, err := a.subscribeHub(ctx, src.key, req)
if err != nil {
index.Close()
hub, subID, frames, achievedW, achievedH, achievedFPS, err := a.subscribeHub(ctx, src.key, req)
if err != nil {
index.Close()
mappings.Close()
case result := <-c.recordDone:
cancel()
<-c.samplerDone
clockFile.Close()
cancel()
result := <-c.recordDone
<-c.samplerDone
clockFile.Close()
@Joannis
Joannis marked this pull request as draft August 27, 2026 18:57
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.

1 participant