Split up communication update method to get better odometry handling. Implemented rudimentary blocked path handling. Some more work ok main loop and communication/map handling.
This commit is contained in:
parent
c479954960
commit
aa6b049ce5
4 changed files with 50 additions and 20 deletions
10
src/main.py
10
src/main.py
|
@ -25,7 +25,10 @@ def run():
|
|||
communication.process_messages()
|
||||
|
||||
# run first time not in loop because odometry data is not relevant
|
||||
communication.update(None, move.getstationedges()) # TODO: Register in map
|
||||
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])
|
||||
|
@ -43,7 +46,10 @@ def run():
|
|||
move.turnto(instructions[1])
|
||||
move.traversetonextstation(True)
|
||||
|
||||
communication.update(move.getstats(), move.getstationedges()) # TODO: Register in map
|
||||
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])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue