Seeking suggestions on how to implement this reactive behavior #736
-
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:
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 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! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
It's tempting to disable the multiple running check but I am not sure that I qualify for "You can disabled that check, if you know what you are doing". Though I think that I have handled/will handle the concurrent running of nodes correctly, the comments of "to work properly, this node should not have more than a single asynchronous child." do scare me a bit. Looking at the implementation I see nothing obvious that breaks when you have multiple running children, apart from that the Disabling the exception seems to work fine, but actions are not halted before new actions run, only after. This seems to mirror what's described in #83, am I correct? |
Beta Was this translation helpful? Give feedback.
-
To better understand your use case... Imagine that you are doing a Hover. What should happen if any of the ready_for_autonomy conditions become false? What is the expected behavior? |
Beta Was this translation helpful? Give feedback.
-
I am facing the same question. I wander if there is any solution? |
Beta Was this translation helpful? Give feedback.
-
Behaviour changed in #770 after discussion in issue 775 to allow for the halting behaviour I sought, meaning that my original idea is now the solution to my question. Read the mentioned threads above. |
Beta Was this translation helpful? Give feedback.
Behaviour changed in #770 after discussion in issue 775 to allow for the halting behaviour I sought, meaning that my original idea is now the solution to my question. Read the mentioned threads above.