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

Static queue in the Loop Node gets erased #909

Open
ipa-dmo opened this issue Jan 8, 2025 · 0 comments
Open

Static queue in the Loop Node gets erased #909

ipa-dmo opened this issue Jan 8, 2025 · 0 comments

Comments

@ipa-dmo
Copy link

ipa-dmo commented Jan 8, 2025

When running a Behavior Tree with a Loop with a static queue twice, the first run works fine, but in the second run the static queue is already empty. The loop does not start and directly returns SUCCESS.

In line 63 of the loop_node.h file (https://github.com/BehaviorTree/BehaviorTree.CPP/blob/master/include/behaviortree_cpp/decorators/loop_node.h) the shared pointer static_queue_ is assigned to the current_queue_. When the current_queue_ is emptied in the first run, also the static_queue_ is emptied. Since the static_queue_ is only overwritten in the constructor, it remains empty before the next run.

Is this intended behavior?

Example:

<root BTCPP_format="4" main_tree_to_execute="MainTree">
  <include path="./free_planning.xml" />
  <BehaviorTree ID="MainTree">
    <Sequence>
      <LoopInt queue="0;1;2;3" value="{num}">
        <Sequence>
          <LoadGoalPose file_path="{transport_tasks}" number="{num}" goal="{goal}"/>
          <Fallback>
              <GoalPoseReached goal="{goal}" robot_base_frame="base_link"/>
              <SubTree ID="FreePlanning" _autoremap="true"/>
          </Fallback>
        </Sequence>
      </LoopInt>
    </Sequence>
  </BehaviorTree>
.```
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

1 participant