Skip to content

Commit 925ed20

Browse files
alanxuefeimasf7g
authored andcommitted
fix(bt_nodes): Correct default server_timeout behavior by using getInputPortOrBlackboard() (ros-navigation#4649)
Signed-off-by: Alan Xue <alan.xuefei@googlemail.com>
1 parent 4d5e3b0 commit 925ed20

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ class BtActionNode : public BT::ActionNodeBase
5858
// Get the required items from the blackboard
5959
auto bt_loop_duration =
6060
config().blackboard->template get<std::chrono::milliseconds>("bt_loop_duration");
61-
server_timeout_ =
62-
config().blackboard->template get<std::chrono::milliseconds>("server_timeout");
63-
getInput<std::chrono::milliseconds>("server_timeout", server_timeout_);
61+
getInputOrBlackboard("server_timeout", server_timeout_);
6462
wait_for_service_timeout_ =
6563
config().blackboard->template get<std::chrono::milliseconds>("wait_for_service_timeout");
6664

nav2_behavior_tree/include/nav2_behavior_tree/bt_cancel_action_node.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ class BtCancelActionNode : public BT::ActionNodeBase
5656
callback_group_executor_.add_callback_group(callback_group_, node_->get_node_base_interface());
5757

5858
// Get the required items from the blackboard
59-
server_timeout_ =
60-
config().blackboard->template get<std::chrono::milliseconds>("server_timeout");
61-
getInput<std::chrono::milliseconds>("server_timeout", server_timeout_);
59+
getInputOrBlackboard("server_timeout", server_timeout_);
6260
wait_for_service_timeout_ =
6361
config().blackboard->template get<std::chrono::milliseconds>("wait_for_service_timeout");
6462

nav2_behavior_tree/include/nav2_behavior_tree/bt_service_node.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ class BtServiceNode : public BT::ActionNodeBase
5959
// Get the required items from the blackboard
6060
auto bt_loop_duration =
6161
config().blackboard->template get<std::chrono::milliseconds>("bt_loop_duration");
62-
server_timeout_ =
63-
config().blackboard->template get<std::chrono::milliseconds>("server_timeout");
64-
getInput<std::chrono::milliseconds>("server_timeout", server_timeout_);
62+
getInputOrBlackboard("server_timeout", server_timeout_);
6563
wait_for_service_timeout_ =
6664
config().blackboard->template get<std::chrono::milliseconds>("wait_for_service_timeout");
6765

0 commit comments

Comments
 (0)