Add function to determine if we can score#96
Merged
auscompgeek merged 1 commit intomainfrom Feb 8, 2026
Merged
Conversation
Greptile Overview
|
| Filename | Overview |
|---|---|
| utilities/game.py | Adds is_hub_active() function to determine hub availability based on match state, alliance, game data, and time-based shifts |
| controllers/shooter.py | Adds @feedback method is_hub_active() that exposes hub status from game utilities to the shooter state machine |
Sequence Diagram
sequenceDiagram
participant Shooter as Shooter Controller
participant Game as utilities.game
participant DS as DriverStation
Shooter->>Game: is_hub_active()
Game->>DS: getAlliance()
DS-->>Game: alliance or None
alt alliance is None
Game-->>Shooter: False
else autonomous enabled
Game->>DS: isAutonomousEnabled()
DS-->>Game: True
Game-->>Shooter: True
else not teleop
Game->>DS: isTeleopEnabled()
DS-->>Game: False
Game-->>Shooter: False
else teleop enabled
Game->>DS: getMatchTime()
DS-->>Game: match_time
Game->>DS: getGameSpecificMessage()
DS-->>Game: game_data ("R", "B", or invalid)
Note over Game: Determine red_inactive_first<br/>from game_data
Note over Game: Calculate shift1_active<br/>based on alliance and<br/>red_inactive_first
Note over Game: Evaluate time ranges:<br/>- >130s: active (transition)<br/>- 105-130s: shift1<br/>- 80-105s: !shift1<br/>- 55-80s: shift1<br/>- 30-55s: !shift1<br/>- ≤30s: active (endgame)
Game-->>Shooter: True/False
end
DannyPomeranian
approved these changes
Feb 8, 2026
Contributor
DannyPomeranian
left a comment
There was a problem hiding this comment.
LGTM, clanker man is not good, but monke sees working code and monke approves working code
Member
Author
silly LLM doesn't know about this year's game, teleop this year is 2 minutes and 20 seconds |
f5e6907 to
2212936
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://frc-docs--3246.org.readthedocs.build/en/3246/docs/yearly-overview/2026-game-data.html
To test this, run the robot in practice mode, or in the simulator set the match time (to the correct length of the teleop period!)