Switch node in py_trees version 0.7.6?

asked 2022-05-13 05:43:40 -0500

Kevin1719 gravatar image

Hi, I'm using py_trees version 0.7.6, along with py_trees_ros version 0.6.1.

I installed these packages using sudo apt install ros-noetic-py-trees and sudo apt install ros-noetic-py-trees-ros. Is there a Switch node like in behavior_tree_cpp, which take a certain value from the blackboard and execute the equivalent child node and ignore the rests?

For example: a "Choose_mode" node has 2 child nodes: "Mode_1" and "Mode_2". The parent node take a blackboard key: "mode", the key has value "1", then "Mode_1" is executed and "Mode_2" is skipped.

I see that py_trees version 2.1.6 has an "either_or" function but it's only compatible with ROS 2, while I'm using ROS 1.

Does the package already have an available one, or I have to write one by my own? If so, is there a tutorial for it?

edit retag flag offensive close merge delete