Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Codebase Map

The quickest way to find where a change belongs is to follow one frame of data through the system: from a camera packet to a robot command. The map below is organised along that path, not along the crate dependency graph.

flowchart TD
    VIS[SSL Vision / Game Controller<br/>dies-ssl-client]
    SIM[Simulator + auto-ref<br/>dies-simulator]
    BS[Robot feedback<br/>dies-basestation-client]

    TR[World tracking<br/>dies-world]
    EX[Executor frame tick<br/>dies-executor]
    STRAT[Strategy process<br/>StrategyHost - IPC - Strategy::update]

    subgraph ctrl[TeamController, per robot]
        SK[Skills] --> COMP[Rule compliance] --> PLAN[Path planning + ORCA] --> PC[PlayerController]
    end

    OUT[Robot commands<br/>basestation / simulator]
    UI[Web UI<br/>dies-webui + webui/]
    LOG[Binary log<br/>dies-logger]

    VIS --> TR
    SIM --> TR
    BS --> TR
    TR -- WorldData --> EX
    EX -- WorldSnapshot --> STRAT
    STRAT -- SkillCommands --> SK
    EX -- WorldUpdate --> UI
    UI -. ControlMsg .-> EX
    EX --> LOG
    PC -- PlayerCmd --> OUT

One frame, step by step

Everything is driven by a vision frame. In sim the loop steps the simulator and feeds its output through exactly the same entry points as real packets.

#StageWhereWhat happens
1Receivedies-ssl-client, dies-basestation-client, dies-simulatorVision/referee packets arrive over UDP (or TCP); robot feedback (breakbeam, voltages, …) over the serial basestation. The simulator produces the same messages (detection, gc_message, feedback).
2DispatchExecutor (run_rt_live, run_rt_sim, step_simulation, run_headless)The main loop in dies-executor selects on all inputs and calls update_from_vision_msg / update_from_gc_msg / update_from_bs_msg.
3TrackWorldTrackerKalman-filtered players and ball (filters), game state from referee commands, and possession. WorldTracker::get() yields a WorldData in absolute coordinates.
4Frame tickExecutor::update_team_controllerThe heart of the system. Runs the steps below in order, once per vision frame.
4aPublishsameBroadcasts a WorldUpdate to the web UI (absolute coordinates).
4bTo team frameWorldData::get_team_data, sides.rsConverts to a team-relative frame (+x always toward the opponent goal). Everything downstream of this point is team-relative.
4cStrategyStrategyHost → transform.rs → IPC → runner → Strategy::updateBuilds a WorldSnapshot, sends it to each team's strategy process, and collects SkillCommands, roles and debug output. Strategies use TeamContext / PlayerHandle to issue commands.
4dSkillsTeamController → SkillExecutor, JointSkillExecutorEach SkillCommand becomes a running executable skill (GoToPos, HandleBall, Receive, …) that emits a PlayerControlInput per tick. Two-robot passes go through the pass coordinator.
4eRulescomply in team_controller.rsEnforces game-state rules on every robot's input (stop distances, defense-area keep-outs, ball placement). Yellow-carded robots are benched earlier, by plan_sidelining, before the strategy runs.
4fMotionavoidance planner, ORCA, PlayerController, path follower, yaw controlPlans a path around obstacles, follows it, deflects through ORCA, applies acceleration/velocity limits and dribbler/kicker logic. Produces a PlayerCmd and transforms it back to absolute coordinates.
4gLogdies-logger workerRecords the frame (world, debug values, raw feedback) to the columnar log.
5SendExecutor::player_commands → BasestationHandle::send_no_wait / Simulation::push_cmdCommands go out over radio, or into the simulator for its next step.

Side channels

Where do I change…?

I want to…Start here
Change team behaviour: who goes where, when to shoot or passstrategies/concerto: planner.rs (where the ball should go), driver.rs (turns a plan into skills), formation.rs (everyone else), keeper.rs, penalty.rs, constants in config.rs
Change how a robot does one thing (pick up the ball, aim, kick, receive)dies-executor/src/skills/executable/, e.g. handle_ball/
Add a new skillVariant in SkillCommand → builder in PlayerHandle / skill_builders.rs → implementation in skills/executable/ → wire it up in create_skill_from_command (skill_executor.rs)
Change passing between two robotspass_coordinator.rs, joint_skill_executor.rs, passing.rs
Expose new world information to strategiesWorldData → create_world_snapshot → WorldSnapshot → World accessor
Fix noisy or laggy robot/ball estimatesdies-world/src/player.rs, ball.rs, filter/, tuning in TrackerSettings
Change who is considered to have the balldies-world/src/possession.rs (types in dies-core/src/possession.rs)
Change how referee commands map to game statesdies-world/src/game_state.rs, GameState
Change rule enforcement (stop distance, defense area, yellow cards)comply and plan_sidelining in team_controller.rs
Change obstacle avoidance or path planningcontrol/avoidance/ (planner.rs, orca.rs, obstacle.rs), config in avoidance_config.rs
Change trajectory tracking, acceleration limits, dribbler rampplayer_controller.rs, path_follower.rs, yaw_control.rs, motion_bounds.rs
Change what is sent to the robots / the radio protocolPlayerCmd, basestation_client.rs
Change simulator physics or auto-refereedies-simulator/src/lib.rs
Test a skill in isolationstrategies/scenarios (one binary per scenario)
Add a web UI panel or viewwebui/src/components/panels/, webui/src/views/, data hooks in api.tsx
Add a UI → executor commandUiCommand → executor_task.rs → ControlMsg → Executor::handle_control_msg (lib.rs)
Add a REST endpointserver.rs + routes.rs
Add a runtime-tunable knobtunables! in the skill; generic settings in executor_settings.rs
Change what gets loggedschema.rs, builders.rs, worker.rs; reader in tools/dieslog.py
Add a CLI flag or subcommandcli.rs, commands/
Change in-match announcementsannouncer.rs

Ground rules

  • Coordinates. Strategies and controllers work in team-relative coordinates (+x toward the opponent goal). The tracker, simulator, UI and log use absolute vision coordinates. Conversion happens only at the boundaries listed above. Never expose absolute coordinates to a strategy.
  • Time. Anything in the per-frame path (skills, controllers, FSMs) uses world time (ctx.world.dt, t_received), never Instant. The headless sim runs faster than realtime, so a wall-clock timer fires at the wrong moment and breaks determinism.
  • Dependencies. dies-core holds shared types and nothing else. Feature crates depend on it, and dies-cli glues them together. Strategy crates only see dies-strategy-api.