Skip to content

Network Integration PR - #66

Open
guyfleeman wants to merge 11 commits into
v2.0-alphafrom
dev/network-integration
Open

guyfleeman wants to merge 11 commits into
v2.0-alphafrom
dev/network-integration

Conversation

@guyfleeman

@guyfleeman guyfleeman commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

This will combine network updates with any changes to the Go middleware and svelte frontend all in one PR/integration branch.

Capability gaps: -runCameras vs network config

Baseline: every config change applies live; the VP is never restarted for a config change. The one exception is the bootstrap vision address/port (G15). Crash and reboot restarts still happen.

Robot heights move to the host: the host already consumes the referee feed and owns config, so it resolves team → height and pushes the two heights to each VP. The VP no longer listens to GC. Without a host, the VP falls back to its default height, the same as today when GC is silent.

From code reading of PR #61 head 87d53bb, proto fdd7988, and the current Go host; nothing has been built or run yet.

Protocol gaps (ssl_vp_config.proto)

# Gap Detail
P1 Geometry line-detection params missing field_line_threshold, min_line_segment_length, max_line_segment_offset, max_line_segment_angle
P2 thresholds.blobs missing PR hardcodes MAX_BLOBS (see C8)
P3 thresholds.resampling_factor missing File reload still works, local VPs only
P4 tracking.* missing min_tracking_radius, max_bot_acceleration; PR hardcodes both (see C8)
P5 debug.* missing debug_images, debug_stream_interval_ms; file reload works for local VPs only
P6 Push bot heights, not a heights database Replace the robot_heights map with yellow_bot_height and blue_bot_height; the VP derives maxBotHeight as the larger of the two
P7 Drop SSL_VPConfigNetwork gc_ip/gc_port are no longer used by the VP (P6), and vision_ip is bootstrap-only (G15)
P8 No ack, revision, or error Host can only diff the next 1 Hz announce; can't see a rejection (see C11)
P9 No command-vs-announce distinction SSL_Source has no host/GUI value. The VP's looped-back own announce and any second host overwrite receivedConfig; last writer wins (C10 is a stopgap)
P10 No replace semantics for repeated fields MergeFrom appends to line_corners. Field mask here, or per-field replace in C++
P11 No capabilities in announce Compiled-in drivers, available devices. Go only sees local /dev/video*
P12 No health in announce fps, camera-open state, last error. A failed remote VP just looks "gone"
P13 No recalibrate command Optional if C4 re-solves automatically

C++ gaps (VP)

# Gap Detail
C1 camera_id only partly live Detection ID and socket update; the calibration cache (keyed by geometry version + size) isn't invalidated
C2 Apply pushed bot heights Use the pushed yellow/blue heights, falling back to defaultBotHeight when unset. Delete GCSocket and bot_heights_file; blob_benchmark and geometry_benchmark need a fixed height instead of gcSocket->maxBotHeight
C3 geometry.* not applied //TODO; cameraAmount, cameraHeight, lineCorners, refinement, and line params are read once from YAML in the Resources ctor
C4 No in-process recalibration Must re-solve on a line_corners, field, or camera_id change. Today this happens by restarting the VP
C5 wait_for_geometry not applied //TODO
C6 OpenCL kernels fixed at startup raw2quad, resampling, quad2rgba, quad2nv12 are compiled with camera->format(). A live driver switch to a different pixel format runs the wrong kernels
C7 Multiple VPs per host can't be told apart instance is plain gethostname(). The proto anticipates hostname:suffix, but there's no way to set the suffix
C8 blobs/tracking regression Hardcoded #defines; no longer configurable even from the file. Restore once P2/P4 land; matchArray must be reallocated when blobs changes
C9 Received config re-applied every frame Held forever and merged each frame, so any color.*.live in it stomps color adaptation. Should be consumed once
C10 Own announce not filtered Ignore source == VISION_PROCESSOR on receive
C11 Unapplied config still announced An unavailable driver logs WARN but is still merged into config.camera, so the announce claims a driver that isn't running
C12 Exposure units Proto says ms; the value goes raw to each driver's native unit (OPENCV ≠ ms). Normalize at the driver boundary
C13 Startup still needs a seed file init_config and Resources both LoadFile. Fine for now

Go gaps (host)

# Gap Detail
G1 No config push The host only receives SSL_VPConfig (discovery); it needs to send per-instance config on the vision group
G2 Blocker for #66: silent no-op edits PR #61 removed file reload of thresholds/color/tracking, but schema.go still marks them ApplyLive, so edits to cam<id>.yml are ignored and nothing restarts. Fixed by G1
G3 Remove restart-on-config-diff Drop the RestartKeys path from the supervisor, except G15's bootstrap keys; it otherwise keeps only process lifecycle. A key that can't go live yet is a P or C blocker, not a restart
G4 Re-push on (re)discovery The VP doesn't persist received config. Keep writing cam<id>.yml as a seed so a crash doesn't loop: crash → file config → re-push → crash
G5 Instance ↔ camera mapping Today it's config_path. discovery.Registry is keyed by name, so it collapses same-host VPs. Depends on C7
G6 Derive stream_ip Proto takes a full IP, not prefix + end + camera_id
G7 stream.raw_feed → stream.type Schema change, with a semantics change: the old non-raw mode cycled 4 views; the new one shows a single fixed view
G8 Exposure µs → ms Replaces the per-driver file conversion in exposure.go. Pairs with C12
G9 Host owns bot heights Host owns the heights database (robot-heights.yml), resolves yellow/blue from the referee, and pushes heights to every VP on a team change and on (re)discovery. network.gc_ip/gc_port become host-only settings, never written to the VP seed. Pairs with P6/C2
G10 Conflict / no-camera over network Push DUMMY to the losing instance instead of holding the process
G11 Never send color.*.live Only reference. Pairs with C9
G12 Recalibrate without stopping the process The Recalibrate callback relies on the VP being stopped so it can't resend its old calibration. Coordinate with C4
G13 Schema mirrors the proto Apply collapses to live, host, or bootstrap. Keys outside the proto stay file-only until P1–P5 land
G14 Drop the camera.path alias Device only. Remove it from schema.go, the Path fallback in camera.go, and the frontend references. Existing vision.yml files using path need a migration: rename to device on load, or refuse with an alert
G15 Vision address/port are file-only Mark network.vision_ip/vision_port (league default 224.5.23.2:10006) as bootstrap in schema.go. Never push them; keep writing them to the cam<id>.yml seed. Changing them is the one accepted case that needs a VP restart, for now

// rendered config.yml contents (Document.Rendered) and that ssl-vision-processor
// reads only at startup: everything but live and host-only settings. Unknown
// keys count, since nothing says ssl-vision-processor reloads them.
// config.yml contents and that ssl-vision-processor reads only at startup:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would not intend to keep config.yml (for the single configuration option, the vision port, it would have to provide) (More just an information about my future intentions)

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