Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit591fc5b

Browse files
authored
Merge pull request#60 from systemetric/json-reader-start-info
Json reader start info
2 parents9ff95bf +d71834b commit591fc5b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

‎robot/game_config/markers.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __repr__(self) -> str:
5555
defbounding_box_color(self)->tuple:
5656
ifself.type==MARKER_TYPE.ARENA:# If it is a wall
5757
returntuple(reversed((225,249,125)))# Turquoise
58-
elifself.type==MARKER_TYPE.ARENA_OBJECT:# Other arena object (e.g. pillar)
58+
elifself.type==MARKER_TYPE.TREE:# Other arena object (e.g. pillar)
5959
returntuple(reversed((255,131,125)))# Purple
6060
elifself.owning_team==TEAM.ARENA:# If it is a supply
6161
m=selfifisinstance(self,TARGET_MARKER)elseNone

‎robot/wrapper.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def __init__(self,
8383
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
8484

8585
self._log_pipe=PipeName((PipeType.INPUT,"log","robot"),"/home/pi/pipes")
86+
self._json_reader=JsonReader(self._hopper_client,self._start_pipe)
8687

8788
# Close stdout and stderr
8889
os.close(1)
@@ -283,9 +284,7 @@ def _get_start_info(self):
283284
"""Get the start infomation from the named pipe"""
284285

285286
# This call blocks until the start info is read
286-
d=self._hopper_client.read(self._start_pipe).decode("utf-8")
287-
288-
settings=json.loads(d)
287+
settings=self._json_reader.read()
289288

290289
assert"zone"insettings,"zone must be in startup info"
291290
ifsettings["zone"]notinrange(4):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp