Add Go2 local Wi-Fi doctor#2378
Conversation
Greptile SummaryThis PR adds a
Confidence Score: 5/5This is a read-only diagnostic tool — no motion commands are issued — and the new code is well-isolated in its own module with no side effects on existing robot control paths. All checks are read-only (HTTP GET, TCP connect, psutil/lsof query, pubsub subscribe-then-unsubscribe). Error paths are consistently guarded. The psutil-to-lsof fallback is correct. The runtime evidence adjustment is narrowly scoped. The one edge case (IPv6 link-local zone IDs misclassified as LAN-reachable) affects only unusual network configurations and produces an incorrect informational message rather than wrong behavior. No files require special attention beyond the minor IPv6 edge case in doctor.py. Important Files Changed
Sequence DiagramsequenceDiagram
participant CLI as go2tool doctor (CLI)
participant CR as collect_report
participant RB as check_robot
participant LAN as LAN discover
participant SIG as signal /con_notify
participant IF as local_interfaces
participant RUN as check_run
participant PORT as check_ports
participant PSUTIL as psutil.net_connections
participant LSOF as _lsof_tcp_listeners
participant IMG as check_image
participant SUB as subscribe_pubsub_uri
CLI->>CR: collect_report(robot_ip, ...)
CR->>RB: check_robot(robot_ip, ...)
RB->>LAN: discover(timeout)
LAN-->>RB: [Go2Device, ...]
RB->>SIG: GET /con_notify
SIG-->>RB: ok / error
RB-->>CR: RobotCheck
CR->>IF: local_interfaces(robot_ip)
IF-->>CR: [LocalInterface, ...]
CR->>RUN: check_run()
RUN-->>CR: RunCheck
CR->>PORT: check_ports(endpoints, probe_hosts)
PORT->>PSUTIL: net_connections(tcp)
PSUTIL-->>PORT: connections
alt missing required ports
PORT->>LSOF: _lsof_tcp_listeners()
LSOF-->>PORT: "{port: [hosts]}"
end
PORT-->>CR: [PortCheck, ...]
CR->>IMG: check_image(enabled, topics, timeout)
IMG->>SUB: subscribe_pubsub_uri(topic, callback)
SUB-->>IMG: (transport, unsubscribe) + async frame
IMG-->>CR: ImageCheck
CR->>CR: _adjust_robot_check_with_runtime_evidence
CR-->>CLI: Go2DoctorReport
CLI->>CLI: format_report / json.dumps
Reviews (2): Last reviewed commit: "Address Go2 doctor review comments" | Re-trigger Greptile |
|
Follow-up stack for turning this doctor into startup automation:
I kept these as draft stacked PRs in the fork because I do not have permission to push upstream stack base branches to |
Summary:
dimos go2tool doctorfor read-only Go2 local Wi-Fi teleop diagnostics.color_imagereceipt.Tests:
/Users/kezaer/Git/dimos/.venv/bin/python -m pytest dimos/robot/unitree/go2/cli/test_doctor.py -q/Users/kezaer/Git/dimos/.venv/bin/ruff check dimos/robot/unitree/go2/cli/go2tool.py dimos/robot/unitree/go2/cli/doctor.py dimos/robot/unitree/go2/cli/test_doctor.pydimos go2tool doctor --robot-ip <go2_ip> --no-discover --connect-timeout 0.8 --check-image --image-timeout 1.0against a runningteleop-phone-go2stack.No robot motion commands were sent while validating this change.