robotopia-x / todo

:warning: DEPRECATED - projects will be now tracked on organization level
https://github.com/orgs/robotopia-x/projects/2
The Unlicense
1 stars 0 forks source link

Handle interupts smartly #55

Closed paulsonnentag closed 7 years ago

paulsonnentag commented 7 years ago

Currently interrupts can lead to weird behaviour. This can happen for example if a mode switch happens while the main handler of a robot is in the middle of the execution of a moveTo(x, y) block. After the mode handler is completed the bot will continue executing the pre calculated move steps. The mode handler will most likely have moved the bot to a different location this means we need to recalculate the route.

My suggestion to solve that problem is that all commands should be aware that such interrupts can happen. They can only occur after an action has been executed. The runtime should set an interrupt flag which action blocks can check for. This adds a little bit of complexity for implementing new commands but I don't think we can deal with this problem in a generic way.

If we look at 2 cases:

TODO: breakdown task in subtasks