diff --git a/robot/game_config/markers.py b/robot/game_config/markers.py index 41c5884..0aa5655 100644 --- a/robot/game_config/markers.py +++ b/robot/game_config/markers.py @@ -55,7 +55,7 @@ def __repr__(self) -> str: def bounding_box_color(self) -> tuple: if self.type == MARKER_TYPE.ARENA: # If it is a wall return tuple(reversed((225, 249, 125))) # Turquoise - elif self.type == MARKER_TYPE.ARENA_OBJECT: # Other arena object (e.g. pillar) + elif self.type == MARKER_TYPE.TREE: # Other arena object (e.g. pillar) return tuple(reversed((255, 131, 125))) # Purple elif self.owning_team == TEAM.ARENA: # If it is a supply m = self if isinstance(self, TARGET_MARKER) else None diff --git a/robot/wrapper.py b/robot/wrapper.py index 065709d..c51e3d6 100644 --- a/robot/wrapper.py +++ b/robot/wrapper.py @@ -83,6 +83,7 @@ def __init__(self, self._hopper_client.open_pipe(self._start_pipe, delete=True, create=True, blocking=True) # Make sure to use blocking mode, otherwise start button code fails self._log_pipe = PipeName((PipeType.INPUT, "log", "robot"), "/home/pi/pipes") + self._json_reader = JsonReader(self._hopper_client, self._start_pipe) # Close stdout and stderr os.close(1) @@ -283,9 +284,7 @@ def _get_start_info(self): """Get the start infomation from the named pipe""" # This call blocks until the start info is read - d = self._hopper_client.read(self._start_pipe).decode("utf-8") - - settings = json.loads(d) + settings = self._json_reader.read() assert "zone" in settings, "zone must be in startup info" if settings["zone"] not in range(4):