fix(dimsim): wire observe to /color_image without republishing - #3574
fix(dimsim): wire observe to /color_image without republishing#3574juhasch wants to merge 1 commit into
Conversation
DimSim already publishes camera frames on LCM; the empty video_stream left observe() returning None. Forward those frames into the Go2 cache and skip republish to avoid an echo loop. Co-authored-by: Cursor <cursoragent@cursor.com>
Greptile SummaryThis change connects DimSim The frame-forwarding behavior, normal teardown, restart behavior, cached observation, and conditional publication were exercised successfully. One lifecycle problem remains: calling T-Rex validation blockedThe focused Go2 connection test could not be collected because the Confidence Score: 4/5Not safe to merge until repeated startup no longer leaves a camera subscription active after shutdown. A focused executable harness reproduced the post-stop callback and exercised the surrounding forwarding, cleanup, cache, restart, and publication paths. The repository's focused DimSim tests also passed, while the Go2 test module could not be collected because its native audio dependency is unavailable. Files Needing Attention:
What T-Rex did
|
| self._unsubscribe_odom = self._odom_transport.subscribe(self._handle_odom) | ||
| self._unsubscribe_video = self._video_transport.subscribe(self._video_subject.on_next) |
There was a problem hiding this comment.
Repeated startup leaks the camera subscription
A second start() replaces _unsubscribe_video with the newer callback without unsubscribing the first one. stop() therefore removes only the latest subscription, and /color_image frames can still reach the video stream after teardown. Make startup idempotent or dispose existing odom and video subscriptions before assigning replacements, and cover start(); start(); stop(); emit(frame).
Artifacts
Focused executable DimSim observe-path harness source
- The authored reproducible harness drives parent-versus-PR bus forwarding, lifecycle, cache, conditional-publication, and repeated-start paths, with the takeaway that it directly exercises the reported callback leak.
Parent revision observe-path baseline output
- The parent-revision run records that no `/color_image` subscription existed and no observe-path frame was received, with the takeaway that the PR introduces the intended forwarding behavior.
Changed DimSim observe-path harness output
- The PR run proves normal forwarding, stop cleanup, restart behavior, echo prevention, direct publication, and the post-stop callback left by repeated start, with the takeaway that only repeated startup leaks a callback.
- The repository’s new DimSim focused tests executed with `2 passed`, with the takeaway that its single-start forwarding and normal-stop expectations pass.
|
PR #3601 has a better, more general fix. Thanks Paul! |
Summary
/color_image, butDimSimConnection.video_stream()was an empty subject, soobserve()always returnedNoneand the agent thought it was blind./color_image(video_on_bus) so we do not create an echo loop.Test plan
uv run pytest dimos/robot/unitree/test_dimsim_connection.py dimos/robot/unitree/go2/test_connection.pydimos --simulation dimsim --dimsim-scene=apartment run unitree-go2-agenticobservereturns a camera frame instead ofNone