Skip to content

BT.CPP 4.3.2 onHalted not run when halting parallel children #601

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

Closed
kd-ufr opened this issue Jun 29, 2023 · 2 comments
Closed

BT.CPP 4.3.2 onHalted not run when halting parallel children #601

kd-ufr opened this issue Jun 29, 2023 · 2 comments

Comments

@kd-ufr
Copy link

kd-ufr commented Jun 29, 2023

Hi Davide,

I am finding that when a parallel node halts a running child, its post conditions are not applied the way I expected. I have included an example below:

This tree starts and then halts a RunForever action node. The PrintString then prints the value of variable test.

  <BehaviorTree ID="test_tree">
    <Sequence>
      <Script code="test := 'start'"/>
      <Fallback>
        <Parallel failure_count="1"
                  success_count="-1">
          <RunForever _onHalted="test = 'halted'"
                                    _post="test = 'post'"/>
          <AlwaysFailure/>
        </Parallel>
        <PrintString key="{test}"/>
      </Fallback>
    </Sequence>
  </BehaviorTree>

I would have expected the onHalted condition to run and 'halted' to be printed. However, 'post' was printed, indicating the post condition was run. If I remove the post condition, 'start' is printed, indicating onHalted is not being run at all.

Thanks for your help!

@facontidavide
Copy link
Collaborator

Problem fixed. thanks for reporting.

image

@kd-ufr
Copy link
Author

kd-ufr commented Jul 5, 2023

Awesome, thanks Davide

ngxingyu pushed a commit to BumblebeeAS/BehaviorTree.CPP that referenced this issue Jul 8, 2023
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