Abstract class representing a service based BT node.
More...
#include <nav2_behavior_tree/include/nav2_behavior_tree/bt_service_node.hpp>
|
| BtServiceNode (const std::string &service_node_name, const BT::NodeConfiguration &conf, const std::string &service_name="") |
| A nav2_behavior_tree::BtServiceNode constructor. More...
|
|
BT::NodeStatus | tick () override |
| The main override required by a BT service. More...
|
|
void | halt () override |
| The other (optional) override required by a BT service.
|
|
virtual void | on_tick () |
| Function to perform some user-defined operation on tick Fill in service request with information if necessary.
|
|
virtual BT::NodeStatus | on_completion (std::shared_ptr< typename ServiceT::Response >) |
| Function to perform some user-defined operation upon successful completion of the service. Could put a value on the blackboard. More...
|
|
virtual BT::NodeStatus | check_future () |
| Check the future and decide the status of BT. More...
|
|
virtual void | on_wait_for_result () |
| Function to perform some user-defined operation after a timeout waiting for a result that hasn't been received yet.
|
|
|
std::string | service_name_ |
|
std::string | service_node_name_ |
|
std::shared_ptr< rclcpp::Client< ServiceT > > | service_client_ |
|
std::shared_ptr< typename ServiceT::Request > | request_ |
|
rclcpp::Node::SharedPtr | node_ |
|
rclcpp::CallbackGroup::SharedPtr | callback_group_ |
|
rclcpp::executors::SingleThreadedExecutor | callback_group_executor_ |
|
std::chrono::milliseconds | server_timeout_ |
|
std::chrono::milliseconds | max_timeout_ |
|
std::chrono::milliseconds | wait_for_service_timeout_ |
|
std::shared_future< typename ServiceT::Response::SharedPtr > | future_result_ |
|
bool | request_sent_ {false} |
|
rclcpp::Time | sent_time_ |
|
bool | should_send_request_ |
|
template<class ServiceT>
class nav2_behavior_tree::BtServiceNode< ServiceT >
Abstract class representing a service based BT node.
- Template Parameters
-
Definition at line 37 of file bt_service_node.hpp.
◆ BtServiceNode()
template<class ServiceT >
◆ check_future()
template<class ServiceT >
Check the future and decide the status of BT.
- Returns
- BT::NodeStatus SUCCESS if future complete before timeout, FAILURE otherwise
Definition at line 190 of file bt_service_node.hpp.
◆ on_completion()
template<class ServiceT >
Function to perform some user-defined operation upon successful completion of the service. Could put a value on the blackboard.
- Parameters
-
response | can be used to get the result of the service call in the BT Node. |
- Returns
- BT::NodeStatus Returns SUCCESS by default, user may override to return another value
Definition at line 181 of file bt_service_node.hpp.
◆ providedBasicPorts()
template<class ServiceT >
Any subclass of BtServiceNode that accepts parameters must provide a providedPorts method and call providedBasicPorts in it.
- Parameters
-
addition | Additional ports to add to BT port list |
- Returns
- BT::PortsList Containing basic ports along with node-specific ports
Definition at line 110 of file bt_service_node.hpp.
◆ providedPorts()
template<class ServiceT >
Creates list of BT ports.
- Returns
- BT::PortsList Containing basic ports along with node-specific ports
Definition at line 125 of file bt_service_node.hpp.
◆ tick()
template<class ServiceT >
The main override required by a BT service.
- Returns
- BT::NodeStatus Status of tick execution
Definition at line 134 of file bt_service_node.hpp.
The documentation for this class was generated from the following file: