More work towards a working main loop...

This commit is contained in:
d3rped 2018-03-25 15:09:13 +02:00
parent 1dc4f5a2d7
commit 678c94532e
6 changed files with 72 additions and 24 deletions

View file

@ -27,13 +27,14 @@ def run():
while(communication.status() is Mode.GOTOSTATION or communication.status() is Mode.TARGET): # should be triggered if current station has no unexplored edges
for instructions in communication.navto:
for instructions in communication.navto:
communication.update(None)
communication.update(None, None)
move.turnto(instructions[1])
move.traversetonextstation(True)
communication.update(move.getstationedges()) # TODO: Register in map
communication.update(move._odometry.coordinates_get(), move.getstationedges()) # TODO: Register in map
move.updatevars()
move.turnto(communication.navto[0][1]) # TODO: add control mechanism to communication class
if(communication.check(move.traversetonextstation(False)) is False): # TODO: let same control mechanism decide if station is known, also traversetonextstation needs a return value
if(communication.check(move.traversetonextstation(False)) is False):
move.setcurdir(communication.getdir())