Everything should work now. But it doesn't.
This commit is contained in:
parent
aa6b049ce5
commit
6b2a19ebdc
3 changed files with 25 additions and 35 deletions
44
src/main.py
44
src/main.py
|
@ -24,40 +24,28 @@ def run():
|
|||
while(communication.planetname is None):
|
||||
communication.process_messages()
|
||||
|
||||
# run first time not in loop because odometry data is not relevant
|
||||
communication.update(None) # TODO: Register in map
|
||||
# correct odometry right here otherwise list of edges will be incorrect
|
||||
move.setcurdir(communication.getdir())
|
||||
communication.process(move.getstationedges())
|
||||
move.turnto(communication.navto[0][1]) # TODO: add control mechanism to communication class
|
||||
sleep(4)
|
||||
communication.planet.setcurdir(communication.navto[0][1])
|
||||
move.setcurdir(communication.getdir())
|
||||
move.reset()
|
||||
print("current dir:", move._odometry.angle_get())
|
||||
print("Navigation Data:", communication.navto)
|
||||
move.traversetonextstation(False)
|
||||
|
||||
while(communication.status() is not Mode.COMPLETE):
|
||||
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, None)
|
||||
move.turnto(instructions[1])
|
||||
move.traversetonextstation(True)
|
||||
|
||||
communication.update(move.getstats()) # TODO: Register in map
|
||||
# correct odometry right here otherwise list of edges will be incorrect
|
||||
move.setcurdir(communication.getdir())
|
||||
communication.process(move.getstationedges())
|
||||
move.turnto(communication.navto[0][1]) # TODO: add control mechanism to communication class
|
||||
sleep(4)
|
||||
communication.planet.setcurdir(communication.navto[0][1])
|
||||
move.setcurdir(communication.getdir())
|
||||
move.reset()
|
||||
print("current dir:", move._odometry.angle_get())
|
||||
print("Navigation Data:", communication.navto)
|
||||
move.traversetonextstation(False)
|
||||
communication.process_edges(move.getstationedges())
|
||||
if(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:
|
||||
move.turnto(instructions[1])
|
||||
move.traversetonextstation(True)
|
||||
move.setcurdir(communication.planet._planetmap[instructions[0]][instructions[1]][1])
|
||||
communication.update(None)
|
||||
communication.navto.clear()
|
||||
communication._status = Mode.EXPLORE
|
||||
else:
|
||||
move.turnto(communication.navto[0][1])
|
||||
sleep(4)
|
||||
communication.planet.setcurdir(communication.navto[0][1])
|
||||
move.setcurdir(communication.getdir())
|
||||
move.reset()
|
||||
move.traversetonextstation(False)
|
||||
|
||||
|
||||
# DO NOT EDIT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue