Skip to content

Remove objectdb from go2 blueprints#981

Merged
spomichter merged 1 commit intodevfrom
remove-objectdb
Jan 12, 2026
Merged

Remove objectdb from go2 blueprints#981
spomichter merged 1 commit intodevfrom
remove-objectdb

Conversation

@leshy
Copy link
Contributor

@leshy leshy commented Jan 12, 2026

Devs have been running agentic go2, which crashes after a while due to objectdb being in a blueprint - it stores all detections permanently in mem, this is not a production ready module but an experiment, it's not viable as a direction for memory imo

@leshy leshy requested a review from a team January 12, 2026 08:17
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 12, 2026

Greptile Overview

Greptile Summary

This PR replaces ObjectDBModule with Detection3DModule in the GO2 detection blueprint to resolve memory accumulation issues that were causing crashes during agentic operation.

Key Changes

Module Replacement:

  • Replaced detectionDB_module (ObjectDBModule) with detection3d_module (Detection3DModule)
  • Updated all module class references from ObjectDBModule to Detection3DModule
  • Added import for SceneUpdate message type (previously not imported)

Behavioral Impact:

  • Before: ObjectDBModule accumulated all detections in memory indefinitely via the objects dict, merging nearby detections into persistent Object3D instances. This experimental approach caused memory growth and eventual crashes.
  • After: Detection3DModule processes detections frame-by-frame without persistent storage, preventing memory accumulation.

Transport Configuration:

  • Enabled scene_update transport that was previously commented out
  • All output ports properly configured: detections, annotations, scene_update, detected_pointcloud_0/1/2, detected_image_0/1/2

Lost Functionality:
The ObjectDBModule provided object tracking features that are removed in this change:

  • Persistent object tracking across frames (objects dict with track_id)
  • Object merging and detection count aggregation
  • Agent-accessible object database (agent_encode() method)
  • Object lookup and goto capabilities

These features were experimental and not production-ready, as noted in the PR description.

Integration Points

The unitree-go2-detection blueprint in all_blueprints.py continues to reference this detection configuration. The detection blueprint is standalone and not used by the agentic blueprints (agentic, agentic_mcp, agentic_ollama, agentic_huggingface), so there are no downstream impacts on agent functionality.

Confidence Score: 4/5

  • This PR is safe to merge with low risk - it fixes a critical production issue (memory crashes) with a clean module swap.
  • Score of 4/5 reflects a well-executed fix for a critical issue with minimal risk. The change is straightforward (swapping one detection module for another), all output ports are properly configured, and the scene_update transport that was previously disabled is now enabled. The only concern is that the G1 blueprints may need the same fix applied, but that's outside the scope of this PR.
  • No files require special attention - the single file change is clean and complete. However, consider reviewing unitree_g1_blueprints.py in a future PR as it still uses ObjectDBModule.

Important Files Changed

File Analysis

Filename Score Overview
dimos/robot/unitree_webrtc/unitree_go2_blueprints.py 4/5 Replaced ObjectDBModule with Detection3DModule to prevent memory accumulation crashes. Enabled scene_update transport that was previously commented out. All output ports properly configured.

Sequence Diagram

sequenceDiagram
    participant Robot as GO2 Robot
    participant Nav as Navigation Module
    participant Det as Detection3DModule (NEW)
    participant Trans as LCM Transports
    participant Fox as Foxglove/Visualization
    
    Note over Det: Replaces ObjectDBModule which<br/>accumulated detections in memory
    
    Robot->>Nav: color_image, pointcloud
    Nav->>Det: global_map (remapped)
    Det->>Det: Process frame detections
    Note over Det: Detections processed per-frame<br/>No memory accumulation
    Det->>Trans: detections (Detection2DArray)
    Det->>Trans: annotations (ImageAnnotations)
    Det->>Trans: scene_update (SceneUpdate)
    Note right of Trans: scene_update now ENABLED<br/>(was commented out)
    Det->>Trans: detected_pointcloud_0/1/2
    Det->>Trans: detected_image_0/1/2
    Trans->>Fox: Publish all detection outputs
    
    Note over Det,Fox: Key difference: No persistent<br/>object tracking or memory growth
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines 92 to 130
detection = (
autoconnect(
nav,
detectionDB_module(
detection3d_module(
camera_info=GO2Connection.camera_info_static,
),
)
.remappings(
[
(ObjectDBModule, "pointcloud", "global_map"),
(Detection3DModule, "pointcloud", "global_map"),
]
)
.transports(
{
# Detection 3D module outputs
("detections", ObjectDBModule): LCMTransport(
("detections", Detection3DModule): LCMTransport(
"/detector3d/detections", Detection2DArray
),
("annotations", ObjectDBModule): LCMTransport(
("annotations", Detection3DModule): LCMTransport(
"/detector3d/annotations", ImageAnnotations
),
# ("scene_update", ObjectDBModule): LCMTransport(
# "/detector3d/scene_update", SceneUpdate
# ),
("detected_pointcloud_0", ObjectDBModule): LCMTransport(
("scene_update", Detection3DModule): LCMTransport(
"/detector3d/scene_update", SceneUpdate
),
("detected_pointcloud_0", Detection3DModule): LCMTransport(
"/detector3d/pointcloud/0", PointCloud2
),
("detected_pointcloud_1", ObjectDBModule): LCMTransport(
("detected_pointcloud_1", Detection3DModule): LCMTransport(
"/detector3d/pointcloud/1", PointCloud2
),
("detected_pointcloud_2", ObjectDBModule): LCMTransport(
("detected_pointcloud_2", Detection3DModule): LCMTransport(
"/detector3d/pointcloud/2", PointCloud2
),
("detected_image_0", ObjectDBModule): LCMTransport("/detector3d/image/0", Image),
("detected_image_1", ObjectDBModule): LCMTransport("/detector3d/image/1", Image),
("detected_image_2", ObjectDBModule): LCMTransport("/detector3d/image/2", Image),
("detected_image_0", Detection3DModule): LCMTransport("/detector3d/image/0", Image),
("detected_image_1", Detection3DModule): LCMTransport("/detector3d/image/1", Image),
("detected_image_2", Detection3DModule): LCMTransport("/detector3d/image/2", Image),
}
)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

The G1 blueprints (unitree_g1_blueprints.py) still use ObjectDBModule and may experience the same memory accumulation crashes mentioned in the PR description. Consider applying the same fix to the G1 detection blueprint for consistency.

The G1 detection blueprint (lines 185-261 in unitree_g1_blueprints.py) uses both detection3d_module AND detectionDB_module together, which means it will still accumulate detections in memory indefinitely.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@spomichter spomichter merged commit 8359d78 into dev Jan 12, 2026
13 checks passed
@spomichter spomichter deleted the remove-objectdb branch January 12, 2026 10:16
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