-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Required Info:
- Operating System:
- Ubuntu 20.04.2 LTS
- ROS2 Version:
- Galactic binaries
- Version or commit hash:
- DDS implementation:
Feature request
Feature description
It is the goal to set the BT::NodeStatus of a behavior tree leave node based on the result send from the service server.
More specifically, I tried to implement a Condition-Node that makes a request to a service server via the ROS2 service interface and sets its BT::NodeStatus based on the result.. Therefore, the BtServiceNode class (bt_service_node.cpp) seemed to me to be the best suited class to use. However, in contrast to the BtActionNode class (bt_action_node.cpp) it missed the virtual on_success() function, that can be used to define the custom BT::NodeStatus behavior based on the service's answer. The current BtServiceNode class sets the BT::NodeStatus solely based on the success of the service request.
I am not sure if I missed a class that implements this feature, if there is a simpler solution or if I should just use the BT::ConditionNode base class with a normal service client after all.
Implementation considerations
The proposed implementation simply adds a call to the virtual on_success() function in the check_future() function (Similar to the BtActionNode).
The changes do not change do not affect the default behavior of the BtServiceNode as the default definition of on_success() does still simply return BT::NodeStatus::SUCCESS.
If the proposed implementation is an appropriate modification I could create a pull request.
Edit: Updated BtServiceNode Link to no longer point to the changed/forked version.