Skip to content
This repository has been archived by the owner on Feb 14, 2025. It is now read-only.

Handle interrupts smartly #66

Open
paulsonnentag opened this issue Feb 6, 2017 · 0 comments
Open

Handle interrupts smartly #66

paulsonnentag opened this issue Feb 6, 2017 · 0 comments

Comments

@paulsonnentag
Copy link
Collaborator

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:

bot is manually programmed to follow a specific path with move and rotate commands
=> If an interrupts happened the bot should move afterwards back to it's previous location and continue executing the movements

bot is programmed to move to a specific location with moveTo
=> If an interrupts happened the bot should not walk back to it's previous location as this might lead some suboptimal paths, instead the bot should recalculate the fastest route

TODO: breakdown task in subtasks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants