feat(hackathon): add unitree-go2-hackathon blueprint#2301
Conversation
Greptile SummaryThis PR introduces a self-contained hackathon blueprint for the Unitree Go2, adding five new modules under
Confidence Score: 3/5Functional for demos but two present defects need fixing before reliable operation: smart_follow_object never delivers its result to the MCP client, and the follow/approach threads can die silently on any image gap. The wrong tool-name registration in
Important Files Changed
Sequence DiagramsequenceDiagram
participant MCP as MCP Client
participant SF as SmartFollowSkillContainer
participant PL as PerceptionLoopModule
participant VS as VisualServoing2D
participant ROS as cmd_vel (Out)
MCP->>SF: smart_follow_object("chair")
SF->>PL: get_shared_buffer() [SceneBuffer 2s TTL]
PL-->>SF: "{track_id: 5, name: "chair", bbox: [...]}"
SF->>SF: start_tool("smart_follow_person") ⚠️ wrong name
SF->>SF: spawn _follow_loop thread
loop Every 1/15s
SF->>PL: "current_detections(class_filter="chair")"
PL-->>SF: "[{track_id, bbox, name, confidence}]"
SF->>VS: compute_twist(target.bbox, image.width)
VS-->>SF: Twist
SF->>ROS: publish(Twist)
end
SF->>MCP: tool_update("smart_follow_person", "Following stopped.") ⚠️ wrong name
SF->>MCP: stop_tool("smart_follow_person") ⚠️ MCP never resolves smart_follow_object
|
| "bbox": p.bbox, | ||
| "track_id": tid, | ||
| "threat": self._threats.get(tid), | ||
| }) |
There was a problem hiding this comment.
Blocking sleep in main control loop ignores stop signal
time.sleep(3.2) blocks _dog_loop for the full sniff animation duration without checking _should_stop. If stop_dog_mode() is called during a sniff, _thread.join(timeout=DEFAULT_THREAD_JOIN_TIMEOUT) in the stop path will block for at least 3.2 s before the thread can check _should_stop.is_set(). Replacing this with a short-poll (self._should_stop.wait(timeout=3.2)) lets the loop exit immediately on stop.
| # Frame annotation — every loop iteration (was throttled to every | ||
| # 3rd, which capped the dashboard camera at ~5fps; YOLO is the real | ||
| # gate so writing every frame just keeps up with the loop). | ||
| if True: |
There was a problem hiding this comment.
if True: is dead code left over from a previous throttle-removal refactor. It adds no branching and confuses readers about intent.
| # Frame annotation — every loop iteration (was throttled to every | |
| # 3rd, which capped the dashboard camera at ~5fps; YOLO is the real | |
| # gate so writing every frame just keeps up with the loop). | |
| if True: | |
| # Frame annotation — every loop iteration (YOLO is the rate gate). |
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!
| import random | ||
| import subprocess | ||
| import time |
There was a problem hiding this comment.
subprocess is imported but never used in this module — sound playback was moved to sounddevice/soundfile. Leaving it in triggers linting warnings and misleads readers.
| import random | |
| import subprocess | |
| import time | |
| import random | |
| import time |
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!
| query: What to look for, e.g. "red chair", "dog", "person with backpack" | ||
| explore: If True (default), start autonomous exploration while searching. | ||
| then_approach: If True, automatically approach and get close after finding. | ||
| timeout_s: Give up after this many seconds (default 120s). |
There was a problem hiding this comment.
The docstring states
timeout_s defaults to 120 s, but the parameter default is 0.0 and the code treats <= 0 as unbounded. As written, smart_find runs forever by default, which contradicts the doc.
| timeout_s: Give up after this many seconds (default 120s). | |
| timeout_s: Give up after this many seconds (0 = no timeout, runs until found or stopped). |
|
Greptile encountered an error while reviewing this PR. Please reach out to support@greptile.com for assistance. |
|
@greptile review |
Summary
unitree-go2-hackathonblueprint — a self-contained agentic stack for the Unitree Go2dimos/robot/unitree/go2/blueprints/hackathon/Test plan
python -c "from dimos.robot.unitree.go2.blueprints.hackathon.blueprint import unitree_go2_hackathon"imports cleanly-b unitree-go2-hackathon— PerceptionLoop starts, MCP server exposessmart_follow_person,smart_follow_object,smart_find,start_dog_modedaneel_smart_follow_object("chair")locks on to a visible chair without spinningdaneel_start_dog_mode()barks at approaching people🤖 Generated with Claude Code