-
Notifications
You must be signed in to change notification settings - Fork 768
Added delay node and wait for enter keypress node #182
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
Added delay node and wait for enter keypress node #182
Conversation
First, thanks a lot for contributing. I think the WaitForKeyPressed should use ncurses, as https://github.com/BehaviorTree/BehaviorTree.CPP/blob/master/src/controls/manual_node.cpp |
I see apractical problem with the DelayNode . As you may now, Reactive nodes gives the illusion that the BT is multi-threaded, when actually it is single-threaded. To achieve this, any code must block as little as possible. A "delay", therefore, must return RUNNING and stop execution, not freeze. What if the DelayNode is a child of the ReactiveSequence and it has a sibling that preempt it? |
@facontidavide Thanks for your kind words! I had no idea Manual Selector node existed, thanks for pointing it out. Its a much better solution than what I had pushed, so I removed Wait for Key Press node in the latest commit. |
Regarding the delay node, I have added a TimerQueue timer to the node to keep a track of the delay and the node now has these three states ->
Please let me know if this satisfies your requirement! |
@facontidavide Hey, have you gotten any time to review this pull request? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid to me. I cross checked it with https://github.com/BehaviorTree/BehaviorTree.CPP/blob/master/src/decorators/timeout_node.cpp
Just some small adjustments in style and clarity and it should be fine 👍
@gramss Thank you for your suggestions! I have pushed them in the latest commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes are looking good. Only already introduces methods are used like in other decorators. @facontidavide should be ready to be merged 🙂
thanks and sorry for the delay. overwhelmed with other things right now |
No problem! I understand, we really appreciate all the work that you are
doing to maintain Behaviour Trees library! I would also love to connect if
you have any future feature additions in mind and if you think I can
contribute further.
Wishing you all the health during these tough times,
Yours sincerely,
Indraneel.
…On Tue, Sep 1, 2020 at 1:12 PM Davide Faconti ***@***.***> wrote:
thanks and sorry for the delay. overwhelmed with other things right now
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#182 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJI7ZR6MPT3JH5FFOFOI5ZLSDSQXZANCNFSM4MRIBHKA>
.
|
This pull request is with reference to this issue 92
Two new decorator nodes are proposed in this pull request called Delay Node and Wait for Enter Press node which I found personally very useful in my application
The delay node allows the user to add a fixed millisecond delay before ticking the child
The Wait for Enter Press Node as the name suggests stops execution of the child until enter key is pressed by the user
I am very new to contributing code online and I welcome constructive criticism about this work.
I am also thankful to the owner of the library and all maintainers!