Skip to content

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

Closed
@kd-ufr

Description

@kd-ufr

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!

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