From 4073ca94c7bd20dafdbd90cc5f0938b07bba14ca Mon Sep 17 00:00:00 2001 From: Cutshion Date: Mon, 23 Nov 2026 14:08:10 +0900 Subject: [PATCH] Go charge to Home marker Co-Authored-By: Claude Opus 5.5 --- robot/agv.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/robot/agv.py b/robot/agv.py index fdb70b1..40d2826 100644 --- a/robot/agv.py +++ b/robot/agv.py @@ -113,11 +113,14 @@ def _move(command): def dock_marker(): - """Name of the main charging-dock marker on the current map ("home"): of the type-11 markers the one with the - lowest dock number (num); None when there is none. Further docks keep their own names (dock2, ...).""" + """Name of the main charging-dock marker on the current map ("home", what Go charge drives to): the type-11 + marker named Home (any case) when there is one, else the one with the lowest dock number (num), so a new map's + first charger marker is Go charge at once; None when there is none. Further docks keep their own names (dock2, + charge, ...) and are never Go charge while a Home exists (owner, 2026-11-23).""" docks = [(m.get("num", 1), name) for name, m in (request("/api/markers/query_list").get("results") or {}).items() if m.get("key") == 11] - return min(docks)[1] if docks else None + named = [name for _, name in docks if name.lower() == "home"] + return named[0] if named else (min(docks)[1] if docks else None) def marker_xy(name):