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

Suggestions on implementing reactive behavior with multiple conditions #735

Closed
HenrikNilssonCode opened this issue Jan 8, 2024 · 2 comments

Comments

@HenrikNilssonCode
Copy link

Hi!

I'm looking for suggestions on how to implement the following behavior for an autonomous drone.

The drone should ensure some things before performing the actual mission, like ensuring that it is in autonomous mode and that is it safe to fly. Conditions can change at any time and should therefore be checked continuously. Any change to the previous conditions should abort later actions. I first implemented it like this following the principle of Backchaining to make the behavior interpretable:

image
(Note that this is a work on progress and that more conditions and actions will be added)

After reading some more, I realised that having multiple asynchronous actions is not allowed in a ReactiveSequence, but it this moment I don't see an alternative way of implementing this as all my actions will be asynchronous. Say that BatteryLevelOK is false; the resulting ticking of Hover and it returning RUNNING causes the [ReactiveSequence]: only a single child can return RUNNING to be thrown once "be in autonomous mode" is ticked again.

Reading #71, #83 and #93, I understand that a related discussion to my question has been ongoing, though I have not been able to find any suggestions on how to implement this. In a way, all I want to ensure is that only one action is performed at one time and that no later actions are allowed to be performed before the previous conditions are met, even as they change.

Your input will be greatly appreciated, thanks in advance!

@HenrikNilssonCode HenrikNilssonCode changed the title Implementing reactive behavior with multiple conditions Suggestions on implementing reactive behavior with multiple conditions Jan 8, 2024
@HenrikNilssonCode
Copy link
Author

Just discovered the forum, moving discussion there.

@facontidavide
Copy link
Collaborator

Related: PR #770

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

No branches or pull requests

2 participants