Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -194,5 +194,5 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

AutoReferee/
ssl-game-controller/
AutoReferee/
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,29 @@

## Setup Guidelines

### Setup Utama

1. cd to root folder `/Utama` and type `pip install -e .` to install all dependencies.
2. Note that this also installs all modules with `__init__.py` (so you need to run it again when you add an `__init__.py`)

If you are still struggling with local import errors (ie importing our local modules), you can add `export PYTHONPATH=/path/to/folder/Utama` to your `~/.bashrc`. To do this, run `sudo nano ~/.bashrc` and then add the export line at the bottom of the document. Finally, close and save.

###### Warning: the above workaround is quite hackish and may result in source conflicts if you are working on other projects in the same Linux machine. Be advised.
> Warning: the above workaround is quite hackish and may result in source conflicts if you are working on other projects in the same Linux machine. Be advised.

### Setup Autoreferee

1. Make sure `grSim` is setup properly and can be called through terminal.
2. `git clone` from [AutoReferee repo](https://github.com/TIGERs-Mannheim/AutoReferee) in a folder named `/AutoReferee` in root directory.
3. Change `DIV_A` in `/AutoReferee/config/moduli/moduli.xml` to `DIV_B`.

```xml
<globalConfiguration>
<environment>ROBOCUP</environment>
<geometry>DIV_B</geometry>
</globalConfiguration>
```

4. Get the latest [compiled game controller](https://github.com/RoboCup-SSL/ssl-game-controller/releases/) and rename it to `ssl_game_controller`. Save it in `/ssl-game-controller` directory.

### Field Guide

Expand Down
55 changes: 55 additions & 0 deletions entities/data/referee.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
from collections import namedtuple
from typing import NamedTuple, Optional, Tuple
from enum import Enum

from entities.game.team_info import TeamInfo
from entities.referee.referee_command import RefereeCommand
from entities.referee.stage import Stage


class RefereeData(NamedTuple):
"""Namedtuple for referee data."""

source_identifier: Optional[str]
time_sent: float
time_received: float
referee_command: RefereeCommand
referee_command_timestamp: float
stage: Stage
stage_time_left: float
blue_team: TeamInfo
yellow_team: TeamInfo
designated_position: Optional[Tuple[float]] = None

# Information about the direction of play.
# True, if the blue team will have it's goal on the positive x-axis of the ssl-vision coordinate system.
# Obviously, the yellow team will play on the opposite half.
blue_team_on_positive_half: Optional[bool] = None

# The command that will be issued after the current stoppage and ball placement to continue the game.
next_command: Optional[RefereeCommand] = None

# The time in microseconds that is remaining until the current action times out
# The time will not be reset. It can get negative.
# An autoRef would raise an appropriate event, if the time gets negative.
# Possible actions where this time is relevant:
# * free kicks
# * kickoff, penalty kick, force start
# * ball placement
current_action_time_remaining: Optional[int] = None

def __eq__(self, other):
if not isinstance(other, RefereeData):
return NotImplemented
return (
self.stage == other.stage
and self.referee_command == other.referee_command
and self.referee_command_timestamp == other.referee_command_timestamp
and self.yellow_team == other.yellow_team
and self.blue_team == other.blue_team
and self.designated_position == other.designated_position
and self.blue_team_on_positive_half == other.blue_team_on_positive_half
and self.next_command == other.next_command
and self.current_action_time_remaining
== other.current_action_time_remaining
)
Loading
Loading