From 14494d726d01d4c302fcc943dc84ab1828ea056f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Ga=C5=82ecki?= <73710544+embeddedadam@users.noreply.github.com> Date: Mon, 20 Nov 2023 20:02:03 +0100 Subject: [PATCH] WIP: Make BT nodes have configurable wait times. (#3960) * Make BT nodes have configurable wait times. Previous solution provided hardcoded 1s value. Right now the value can be configured for BT Action, Cancel and Service nodes. [#3920] Signed-off-by: Adam Galecki * Make BT nodes have configurable wait times. Previous solution provided hardcoded 1s value. Right now the value can be configured for BT Action, Cancel and Service nodes. [#3920] Signed-off-by: Adam Galecki * Fix typos, linting errors and value type from float to int * Fix extra underscores * Fix extra underscore * Update unit tests with blackboard parameter Signed-off-by: Adam Galecki * Fix formatting errors Signed-off-by: Adam Galecki * Update system tests to match new parameter Signed-off-by: Adam Galecki --------- Signed-off-by: Adam Galecki --- .../include/nav2_behavior_tree/bt_action_node.hpp | 3 +++ .../include/nav2_behavior_tree/bt_service_node.hpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp index 3e4e5ea1f4..7a9f86af33 100644 --- a/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp @@ -471,6 +471,9 @@ class BtActionNode : public BT::ActionNodeBase // The timeout value for waiting for a service to response std::chrono::milliseconds wait_for_service_timeout_; + // The timeout value for waiting for a service to response + std::chrono::milliseconds wait_for_service_timeout_; + // To track the action server acknowledgement when a new goal is sent std::shared_ptr::SharedPtr>> future_goal_handle_; diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/bt_service_node.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/bt_service_node.hpp index db1fc8d15c..3bc21ecd3a 100644 --- a/nav2_behavior_tree/include/nav2_behavior_tree/bt_service_node.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/bt_service_node.hpp @@ -257,6 +257,9 @@ class BtServiceNode : public BT::ActionNodeBase // The timeout value for waiting for a service to response std::chrono::milliseconds wait_for_service_timeout_; + // The timeout value for waiting for a service to response + std::chrono::milliseconds wait_for_service_timeout_; + // To track the server response when a new request is sent std::shared_future future_result_; bool request_sent_{false};