Skip to content

flip get_formation output#115

Merged
energy-in-joles merged 1 commit intomainfrom
flip_formation
Apr 8, 2026
Merged

flip get_formation output#115
energy-in-joles merged 1 commit intomainfrom
flip_formation

Conversation

@energy-in-joles
Copy link
Copy Markdown
Member

@energy-in-joles energy-in-joles commented Apr 8, 2026

flip get_formation to return right, left instead of left, right for standardisation and the order of function parameters: n_right then n_left.

Copilot AI review requested due to automatic review settings April 8, 2026 11:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR standardizes formation generation by changing get_formations to return formations in (right, left) order (instead of (left, right)), and updates relevant call sites/tests to match.

Changes:

  • Flips get_formations return tuple order to (right, left).
  • Updates StrategyRunner/RSIM env initialization and strategy example usage to consume the new ordering.
  • Updates GRSim/RSIM tests to align expected formations with the new ordering.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
utama_core/config/formations.py Changes get_formations return order (and also reorders parameters).
utama_core/run/strategy_runner.py Updates sim loading to unpack (right_start, left_start) and pass correct counts.
utama_core/rsoccer_simulator/src/ssl/envs/standard_ssl.py Updates fallback formation assignment to match (right, left) return ordering.
utama_core/strategy/examples/startup_strategy.py Updates example strategy to unpack (right_formation, left_formation).
utama_core/tests/strategy_runner/test_rsim_formations.py Updates RSIM formation test to match new ordering.
utama_core/tests/strategy_runner/test_grsim_sim_setup.py Updates GRSim sim-setup test to match new ordering.
Comments suppressed due to low confidence (1)

utama_core/strategy/examples/startup_strategy.py:22

  • This call uses positional arguments for n_right/n_left (both ints) right after the function’s parameter order was changed, which makes it easy to accidentally swap sides when the counts differ. Prefer passing n_right= and n_left= as keyword arguments here to make the side assignment explicit and robust to future signature changes.
    right_formation, left_formation = get_formations(
        STANDARD_FIELD_DIMS.full_field_bounds,
        MAX_ROBOTS,
        MAX_ROBOTS,
        formation_type=FormationType.START_ONE,
    )

@energy-in-joles energy-in-joles merged commit 292220a into main Apr 8, 2026
6 checks passed
@energy-in-joles energy-in-joles deleted the flip_formation branch April 8, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants