BehaviorTree/BehaviorTree.CPP

Bug when using Parallel Node

Opened this issue · 1 comments

Hello
I am using BT in ROS2, and I find my tree not working as expected.
My tree is as follow. The Check_Condition_Bool node returns SUCCESS in default, and if the message is 0 it will return FAILURE.
截图 2024-05-17 14-40-25

What I expect is: First ros_topic_1 publish 0, and Sleep_1 will start running. While sleep_1 is running, ros_topic_2 publish 0, then Sleep_2 will also start running, and Sleep_1 and Sleep_2 will be running parallelly.
The result is: When ros_topic_1 published 0,it run as expected. But when ros_topic_2 published 0 after ros_topic_1, the condition of Check_Condition_Bool_2 didn't change to FAILURE.
截图 2024-05-17 15-09-15

I have checked that there is no mistake in the code. I think there may be something wrong in the Parallel node. Or maybe I misunderstand the function of Parallel node?
Source code is in the attach files, please help me. Thank you!

parallel_test.zip

More likely the problem is in the ROS subscriber node, not in Parallel.
I will investigate.