Rearranged and simplified main loop.
This commit is contained in:
parent
c1049f4a58
commit
29849c2dd1
1 changed files with 12 additions and 10 deletions
20
src/main.py
20
src/main.py
|
@ -26,21 +26,23 @@ def run():
|
|||
print("received Planet Name")
|
||||
|
||||
while(communication.status() is not Mode.COMPLETE):
|
||||
move.getstationedges() # TODO: Register in map
|
||||
move.turnto(90) # TODO: add control mechanism to communication class
|
||||
move.traversetonextstation(False) # TODO: let same control mechanism decide if station is known, also traversetonextstation needs a return value
|
||||
|
||||
while(communication.status() is Mode.GOTOSTATION): # should be triggered if current station has no unexplored edges
|
||||
for instructions in communication.navto:
|
||||
move.follow(instructions)
|
||||
for instructions in communication.navto:
|
||||
move.turnto(instructions[1])
|
||||
move.traversetonextstation(True)
|
||||
communication.update()
|
||||
|
||||
while(communication.status() is Mode.TARGET): # should be triggered when communication gets TARGET signal from server
|
||||
for instructions in communication.navto:
|
||||
move.follow(instructions)
|
||||
communication.update() # TODO: implement update function that communicates with server and waits/checks for new instructions
|
||||
if(communication.status() == Mode.TARGET2): # TODO: implement Target change
|
||||
break
|
||||
for instructions in communication.navto:
|
||||
move.turnto(instructions[1])
|
||||
move.traversetonextstation(True)
|
||||
communication.update()
|
||||
|
||||
communication(move.getstationedges()) # TODO: Register in map
|
||||
move.turnto(communication.navto[0][1]) # TODO: add control mechanism to communication class
|
||||
move.traversetonextstation(False) # TODO: let same control mechanism decide if station is known, also traversetonextstation needs a return value
|
||||
|
||||
communication.update()
|
||||
|
||||
|
|
Loading…
Reference in a new issue