BehaviorTree.CPP icon indicating copy to clipboard operation
BehaviorTree.CPP copied to clipboard

Bug when using Parallel Node

Open RRinsy opened this issue 1 year ago • 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

RRinsy avatar May 17 '24 07:05 RRinsy

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

facontidavide avatar May 20 '24 08:05 facontidavide