This is a fork of the original BehaviorTree.ROS repo, with more elaborate instructions on how to incorporate Behavior Trees with ROS1. The scripts have also been modified to work with the latest version of BehaviorTree.CPP (v4).
Currently, two wrappers are provided:
-
RosServiceNode, which can be used to call ROS Services
-
RosActionNode that, similarly, is a wrapper around actionlib::SimpleActionClient.
Most recently, two new wrappers have been added:
-
RosSubscriberNode that can be used to subscribe to a ROS topic and check whether the data satisfies a condition.
-
RosPublisherNode that can be used to publish to a ROS topic.
This package also provides an example of how to implement BT in ROS. Specifically:
-
src/main.cpp
is an example of how to create a simple BT that calls a ROS Service and a ROS Action, and connect it to Groot2. -
In the
src
directory, you can also findadd_two_ints_client.h
,fibonacci_client.h
andprint_value.h
which are header files to define the three different BT action nodes used in the example.
-
Tutorial 1: Installation and introduction to overall workflow for BT-ROS
-
Tutorial 2: Writing a simple BT node that calls a ROS Service
-
Tutorial 3: Writing a simple BT node that calls a ROS Action
-
Tutorial 5: Writing a BT node that subscribes/publishes to a ROS topic
To skip to running the example, go to Tutorial 4.
Refer to this https://github.com/NTU-Mecatron/BehaviorTree.ROS/blob/BT-JH/src/python_service.py
ROS condition node wrapper: https://github.com/NTU-Mecatron/BehaviorTree.ROS/blob/BT-JH/include/behaviortree_ros/bt_condition_node.h
Example usage of wrapper: https://github.com/NTU-Mecatron/BehaviorTree.ROS/blob/BT-JH/src/condition_nodes.h