Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants