Integrating BTs with ROS 2 actions
The execution of a BT should never be blocked. If certain nodes within the tree perform checks during their tick to modify the robot’s actions and react to unexpected situations, the tree’s flow must remain uninterrupted. So, how can we allow complex task execution, such as commanding the robot to reach a given location or perform a manipulation task? The general way to do this is to implement the core functions with long-term executions as a ROS 2 server. The client is implemented in the tree nodes. Based on the result of the ROS 2 action, the node in which the client is implemented can return RUNNING
(the action is not completed), SUCCESS
(the action returns a successful state), or FAILURE
(the action returns a failure state). Let’s discuss this case in the following example.
The steps to implement a similar tree are the same as already seen in the previous examples. The source code discussed here is included in the ROS...