Skip to content

Suggestions on implementing reactive behavior with multiple conditions #735

Closed

Description

@HenrikNilssonCode

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!

Activity

  1. changed the title [-]Implementing reactive behavior with multiple conditions[/-] [+]Suggestions on implementing reactive behavior with multiple conditions[/+] on Jan 8, 2024
  2. HenrikNilssonCode commented on Jan 8, 2024

    @HenrikNilssonCode
    Author

    Just discovered the forum, moving discussion there.

  3. facontidavide commented on Feb 13, 2024

    @facontidavide
    Collaborator

    Related: PR #770

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions