Skip to content

Commit 0c66af7

Browse files
committed
feat: add mode and zone exports
1 parent f05a6bc commit 0c66af7

4 files changed

Lines changed: 34 additions & 5 deletions

File tree

__init__.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from robocon.game import (
2+
TEAM,
3+
TARGET_TYPE,
4+
MARKER,
5+
TARGET_MARKER,
6+
MARKER_TYPE,
7+
BASE_MARKER,
8+
ARENA_MARKER)
9+
10+
from enum import Enum
11+
class MODE(Enum):
12+
COMP = "comp"
13+
DEV = "dev"
14+
15+
zone = TEAM.RED
16+
mode = MODE.COMP
17+
18+
__all__ = (
19+
"TEAM",
20+
"TARGET_TYPE",
21+
"MARKER",
22+
"TARGET_MARKER",
23+
"MARKER_TYPE",
24+
"BASE_MARKER",
25+
"ARENA_MARKER",
26+
)

robocon/brain/reset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
https://stackoverflow.com/a/45799209/5006710
1111
"""
1212
from smbus2 import SMBus
13-
import .cytron as c
14-
import .greengiant as gg
13+
import robocon.brain.cytron as c
14+
import robocon.brain.greengiant as gg
1515

1616

1717
def reset():

robocon/game/startup_poems.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class POEM_ON_STARTUP:
1818
]
1919

2020
@staticmethod
21-
def on_startup(logger, random):
21+
def on_startup():
2222
"""
2323
This is called on startup. Put something funny and relevant to this
2424
years competition using the logger. Also random is currently passed
@@ -31,4 +31,4 @@ def on_startup(logger, random):
3131
jokeToPrint = POEM_ON_STARTUP.jokes[jokeNo]
3232
except:
3333
jokeToPrint = POEM_ON_STARTUP.jokes[0]
34-
#logger.info(jokeToPrint)
34+
#print(jokeToPrint)

robocon/vision/camera.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class to their respecitve classes
1313
import threading
1414
import random
1515
import typing
16+
import robocon
1617

1718
from datetime import datetime
1819
from robocon.game import TEAM, POEM_ON_STARTUP
@@ -49,6 +50,8 @@ def __init__(self, camera=None, log_level=logging.INFO):
4950
self._initialised = False
5051
self._warnings = []
5152

53+
self._zone = robocon.zone
54+
5255
self._image_pipe = HopperPipe(HopperPipeType.IN, "robot", "camera")
5356
self._image_pipe.open()
5457

@@ -62,7 +65,7 @@ def __init__(self, camera=None, log_level=logging.INFO):
6265
raise ValueError("camera must inherit from vision.Camera")
6366
self.res = self.camera.res
6467

65-
self._vision = vision.Vision(self.zone, camera=self.camera, image_pipe=self._image_pipe)
68+
self._vision = vision.Vision(self._zone, camera=self.camera, image_pipe=self._image_pipe)
6669

6770
type(self)._initialised = True
6871

0 commit comments

Comments
 (0)