feat(go2): native CompressedImage across all go2 blueprints (#2831 option 5)#2879
Draft
spomichter wants to merge 1 commit into
Draft
feat(go2): native CompressedImage across all go2 blueprints (#2831 option 5)#2879spomichter wants to merge 1 commit into
spomichter wants to merge 1 commit into
Conversation
…tion 5) GO2Connection publishes Out[CompressedImage]: encode once at the publish edge (config.image_quality, default 75), already-compressed dataset frames pass through — old replay datasets keep working unconverted. Consumers decode only where pixels are needed; CompressedImage.decode() is memoized (decode cache never pickles). VLM agents and quest teleop send the jpeg wire bytes directly — their per-frame re-encode is gone. Shared-with-other-robots modules get Compressed* port-retype subclasses (SpatialMemory, NavigationSkillContainer, Detection3DModule, MarkerDetectionStreamModule, HostedTwistTeleopModule); go2-only modules flip in place. CameraVideoTrack decodes at recv so webrtc video pays decode only for frames actually sent. Bench harness: --sink decode|bytes flavors, per-nic wire sampling, viewer bridge disabled (was hijacking any open viewer on the box). CompressedImage joins zenoh latest-wins QoS types.
❌ 1 Tests Failed:
View the full list of 1 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
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.
Problem
#2831 settled on option 5: connections output
CompressedImagedirectly, producers pick the encoding, consumers decode only when they need pixels. This PR does that migration for every go2 blueprint. Stacked on #2814 (theCompressedImagetype).What changes
Producer —
GO2Connection.color_image: Out[CompressedImage]. jpeg encode happens once at the publish edge (config.image_quality, default 75). frames that are already CompressedImage pass through untouched — which is also why old replay datasets keep working with zero conversion: replay feeds raw Image frames through the same edge and they get encoded like live frames.Go2FleetConnectioninherits the change.Consumers — decode at point of use, and
CompressedImage.decode()is memoized (one decode per frame max, cache never pickles):PerceiveLoopSkill,PersonFollowSkillContainer,TemporalMemory,Go2Memory,Go2Mid360Recorder,VLMAgent,VlmStreamTester,Go2TeleopModuleCompressedSpatialMemory,CompressedNavigationSkillContainer,CompressedDetection3DModule,CompressedMarkerDetectionStreamModule,HostedTwistTeleopModule(retyped in place — hosted-go2 only)# type: ignore[assignment](deliberate LSP violation — that IS the wiring mechanism). 5 of them, each commented.Zero-decode paths (the structural wins over the codec wrapper):
VLMAgentsends the jpeg wire bytes straight to the model (CompressedImage.agent_encode()) — the old per-query re-encode is gone_push_jpegforwards wire bytes to the headset — per-frame re-encode goneCameraVideoTrack(hosted teleop webrtc) decodes atrecv(), so only frames actually sent to the operator pay a decoderr.EncodedImage, no pixel decodeMisc:
sensor_msgs.CompressedImageadded to zenoh latest-wins QoS; bench harness gets--sink decode|bytesand per-nic wire sampling; bench blueprint drops the viewer bridge (it was hijacking any open viewer on the box).Native e2e benchmark (same protocol as #2831: go2_short replay ~14Hz 720p, 60s x 2 reps)
against the #2831 baselines (same box, same dataset):
native matches the codec pin on delivery and cpu and beats raw everywhere, with no wrapper in any blueprint — the encode lives in the connection where option 5 wants it. real dataset frames compress to 71KB at q75 (39x), better than the synthetic 720p estimate.
pending: network sweep (rate-limit + loss profiles via tc netem) — needs sudo on the bench box; raw/codec network baselines run from
3f2fc05adwhere the harness still has--mode raw|codec.Breaking Changes
GO2Connection.color_imageis nowOut[CompressedImage]— anything outside this repo wiring("color_image", Image)against a go2 graph must retype or decode.Compressed*subclasses.How to Test
dimos --replay run unitree-go2shows the camera in rerun via EncodedImage (no pixel decode in the viewer path).Contributor License Agreement