From 20f04e7e76fe8bbb8bddd3a5addaf689db3fa424 Mon Sep 17 00:00:00 2001 From: isaac0804 Date: Tue, 27 Oct 2026 22:44:40 +0000 Subject: [PATCH 01/54] feat(examples): real_score_goal.py --calibrate measures one robot alone real_attacker_defender.py --calibrate expects two robots, and the field check halts on the one never seen; with a single robot the scripted moves now run here. Co-Authored-By: Claude Opus 5.5 --- examples/real_score_goal.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/examples/real_score_goal.py b/examples/real_score_goal.py index 249a62ed..ccf717c4 100644 --- a/examples/real_score_goal.py +++ b/examples/real_score_goal.py @@ -4,6 +4,7 @@ Run: pixi run python examples/real_score_goal.py # real robot pixi run python examples/real_score_goal.py --mode rsim + pixi run python examples/real_score_goal.py --calibrate # measure the robot: fixed moves # the dashboard is at http://localhost:8080: press Force Start to play, Halt to freeze The field and the camera's view are `FIELD` and `CAMERA_HALF` in `real_attacker_defender.py`, @@ -12,6 +13,12 @@ to the open corner and shoots. It starts in HALT, and the field check gates Force Start as in `real_attacker_defender.py`. Put the ball back and Force Start again for the next shot; Halt and Run in the Live tab's Strategy panel restarts the tactic. + +`--calibrate` measures the robot alone, as `real_attacker_defender.py --calibrate` does with two +(that one halts on the second robot it never sees): it plays fixed moves +(`tactics/scripted_moves.py`) instead of shooting. Put it near the middle of the camera's view +facing +x, with 0.8 m clear ahead and 0.6 m to its left, and a ball at rest in view; Force Start. +Then: pixi run python tools/robot_calibration.py replays/field/_calibrate.log """ import sys @@ -40,6 +47,7 @@ from utama_core.entities.referee.referee_command import RefereeCommand from utama_core.run import StrategyRunner from utama_core.tactics.lead_and_support import LeadAndSupportTactic +from utama_core.tactics.scripted_moves import ScriptedMovesTactic # --------------------------------------------------------------------------- # Test-day configuration @@ -101,7 +109,12 @@ def build_runner(mode: str, tactics=None, name: str = "score_goal") -> StrategyR def main() -> None: parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument("--mode", choices=("real", "rsim", "grsim"), default="real") - build_runner(parser.parse_args().mode).run() + parser.add_argument("--calibrate", action="store_true", help="measure the robot: fixed moves") + args = parser.parse_args() + if args.calibrate: + build_runner(args.mode, {"calibrate": ScriptedMovesTactic}, name="calibrate").run() + else: + build_runner(args.mode).run() if __name__ == "__main__": From 1f3d97251c8db8084c62a34e290050bdc9ce9ef0 Mon Sep 17 00:00:00 2001 From: isaac0804 Date: Tue, 27 Oct 2026 22:45:33 +0000 Subject: [PATCH 02/54] feat: pixi run calibrate measures one real robot Runs real_score_goal.py --calibrate; real_robot_setup.md gains the step and tools.md the task. Co-Authored-By: Claude Opus 5.5 --- docs/real_robot_setup.md | 16 +++++++++++++++- docs/tools.md | 1 + examples/real_score_goal.py | 2 +- pixi.toml | 1 + 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/real_robot_setup.md b/docs/real_robot_setup.md index 179d7d14..b21d4de4 100644 --- a/docs/real_robot_setup.md +++ b/docs/real_robot_setup.md @@ -133,7 +133,21 @@ the strategy saw, written when the run closes. Use the Live tab's Note box (Ente the log) to say what a stretch is: "ball placed by hand", "start dribble test", "ignore". Most of a test day is setting up, and notes make the useful minutes easy to find later. -## When something fails +### 5. Measuring a robot + +With the robot set in `examples/real_score_goal.py` (its colour, vision and radio ID): + +``` +pixi run calibrate +pixi run python tools/robot_calibration.py replays/field/