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

Precondition Node should run children to completion before checking it's if statement again #2

Closed
wants to merge 7 commits into from

Conversation

dsobek
Copy link

@dsobek dsobek commented Dec 27, 2024

I ran across an issue where a Precondition's "if" statement was evaluating from true to false while it's children were still executing. This resulted in the children only executing partway before the Precondition node short circuited the tree by returning the value of the "else" port unexpectedly.

For a more concrete example, suppose I want to implement a "RunOnce" behavior as a subtree, the xml would look like the following:

<Sequence>
    <Script code="first_run := true" />
    <Precondition if="first_run == true" else="FAILURE">
        <Sequence>
            <Script code="first_run := false" />
            <SomeLongRunningAction />
        </Control>
     </Decorator>
 </Control>

Over multiple ticks of SomeLongRunningAction this will shortcircuit return FAILURE from the "else" of Precondition. This PR would allow for SomeLongRunningAction (and any other following nodes that are children of Precondition) to run to Completion.

b-adkins and others added 7 commits November 1, 2024 08:41
…ing port is found. (BehaviorTree#876)

Example output:

    a port with name [ball_pose] is found in the XML (<GrabBall>, line 7) but not in the providedPorts() of its registered node type.
fixes the cmake export set when building behavior tree on standard cmake: CMake Error: install(EXPORT "behaviortree_cppTargets" ...) includes target "behaviortree_cpp" which requires target "minitrace" that is not in any export set.
)

* Additional XML verification for Control nodes

* Parse for async nodes based on node name

* Add a unit test

* Improve the check by counting num async children

* Minor update (const)

---------

Co-authored-by: AndyZe <[email protected]>
@dsobek dsobek closed this Dec 27, 2024
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

Successfully merging this pull request may close these issues.

6 participants